Skip to content

web platform which mainly contains frontend and backend for Ondsel Service

Notifications You must be signed in to change notification settings

Ondsel-Development/Ondsel-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ondsel-Server

Prerequisite

Installation

Running frontend

  • Go to the frontend directory
  • Rename env.example to .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 dev

To 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

Running backend

  • Go to the backend directory
  • Rename env.example to .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

Running FC-Worker

  • 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 [email protected]:Ondsel-Development/FC-Worker.git
$ cd FC-Worker
$ docker build -t fc-worker .
$ docker run -p 9000:8080 --name fc_worker fc-worker:latest

Important Links

Deployment

Deployment to PROD

  1. Merge code to production branch.
  2. Now, create a zip file of backend and frontend source code. Run following commands:
    1. git fetch origin
    2. git checkout origin/production
    3. cd backend
    4. zip -r ./od-backend.zip .
    5. cd ../frontend
    6. add the .env file that you have
    7. zip -r ./od-frontend.zip .
  3. Login to AWS dashboard (https://console.aws.amazon.com/console/home).
  4. Open Elastic Beanstalk app (https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/environments)
  5. Deploying backend service (https://lens-api.ondsel.com/).
    1. Open od-backend-prod-app-env environment.
    2. Click on Upload and deploy button.
    3. This will open a dialog to upload ZIP.
    4. Upload od-backend.zip file and in Version label put commit hash (i.e d7fb86244117efb679edd0bb41bedf230cb2fc19)
    5. This will deploy backend service (https://lens-api.ondsel.com/)
  6. Deploying frontend service (https://lens.ondsel.com/).
    1. Open od-frontend-prod-app-env environment.
    2. Click on Upload and deploy button.
    3. This will open a dialog to upload ZIP.
    4. Upload od-frontend.zip file and in Version label put commit hash (i.e d7fb86244117efb679edd0bb41bedf230cb2fc19)

Running migration on PROD

  1. Login to AWS dashboard and open EC2 page.
  2. Open od-backend-prod-app-env instance page.
  3. 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

About

web platform which mainly contains frontend and backend for Ondsel Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published