git clone --recurse-submodules https://github.com/Ondsel-Development/Ondsel-Server.git
cd Ondsel-ServerYou can install Ondsel-Server in two ways:
- Using docker-compose (Recommended, only requires Docker)
- Manual installation (Requires all dependencies)
- Install Docker (https://docs.docker.com/engine/install/)
- Install MongoDB (https://www.mongodb.com/docs/manual/installation/)
- Install NodeJS (https://nodejs.org/en/download)
- Install Docker (needed for FC-Worker)
This is the easiest way to run the entire application stack.
cp env.example .env# With analytics (recommended):
docker-compose --profile matomo-enabled up --build -d
# Without analytics:
docker-compose up --build -d
# Rebuild the frontend on env change:
docker-compose build --no-cache frontend
# For development:
docker-compose -f docker-compose.dev.yml --profile matomo-enabled up --build -dThat's it! The application should now be running at http://localhost:3000
- URL: http://localhost:7000
- Username: admin
- Email: admin@local.test
- Password: admin@local.test
- URL: http://localhost:3000
- Email: admin@local.test
- Password: admin@local.test
These credentials can be customized using environment variables in the .env file.
Note: For production environments, it's strongly recommended to change these default credentials using environment variables.
- Go to the
frontenddirectory - Rename
env.exampleto.env(Or export variables) - Install frontend dependencies
npm ci - Finally, run server
npm run dev
$ cd frontend
$ mv env.example .env
$ set -a; . ./.env; set +a
$ npm ci
$ npm run devTo run from Docker, recompile with:
sudo docker build -t frontend .and run (or re-run) with:
sudo docker run --env-file .env -p 80:80 --rm --name frontend frontend:latest- Go to the
backenddirectory - Rename
env.exampleto.env(Or export variables) - Install frontend dependencies
npm ci - Finally, run server
npm run dev
$ cd backend
$ mv env.example .env
$ set -a; . ./.env; set +a
$ npm ci
$ npm run dev- Clone FC-Woker repository.
- Build docker image (
docker build -t fc-worker .) - Run docker image (
docker run -p 9000:8080 --name fc_worker fc-worker:latest)
$ git clone git@github.com:Ondsel-Development/FC-Worker.git
$ cd FC-Worker
$ docker build -t fc-worker .
$ docker run -p 9000:8080 --name fc_worker fc-worker:latest- DEV
- Production
- Frontend: https://lens.ondsel.com/
- Backend API: https://lens-api.ondsel.com/
- API docs: https://lens-api.ondsel.com/docs/
- Merge code to production branch.
- Now, create a zip file of backend and frontend source code. Run following commands:
git fetch origingit checkout origin/productioncd backendzip -r ./od-backend.zip .cd ../frontend- add the
.envfile that you have zip -r ./od-frontend.zip .
- Login to AWS dashboard (https://console.aws.amazon.com/console/home).
- Open
Elastic Beanstalkapp (https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/environments) - Deploying backend service (https://lens-api.ondsel.com/).
- Open
od-backend-prod-app-envenvironment. - Click on
Upload and deploybutton. - This will open a dialog to upload ZIP.
- Upload
od-backend.zipfile and in Version label put commit hash (i.ed7fb86244117efb679edd0bb41bedf230cb2fc19) - This will deploy backend service (https://lens-api.ondsel.com/)
- Open
- Deploying frontend service (https://lens.ondsel.com/).
- Open
od-frontend-prod-app-envenvironment. - Click on
Upload and deploybutton. - This will open a dialog to upload ZIP.
- Upload
od-frontend.zipfile and in Version label put commit hash (i.ed7fb86244117efb679edd0bb41bedf230cb2fc19)
- Open
- Login to AWS dashboard and open EC2 page.
- Open
od-backend-prod-app-envinstance page. - Click on Connect to Instance button.
[root@ip-172-31-26-128 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9987508aaaa4 9bd321c31a70 "docker-entrypoint.s…" 4 hours ago Up 4 hours 3030/tcp vigorous_dirac
[root@ip-172-31-26-128 ~]# docker exec -it 9987508aaaa4 /bin/sh
/app # npm run migration <migration_name> > <migration_name>.logs
/app # exit
[root@ip-172-31-26-128 ~]# exit