This Project contains following services and folders:
api-server
: HTTP API Server for REST API'sbuild-server
: Docker Image code which clones, builds and pushes the build to S3s3-reverse-proxy
: Reverse Proxy the subdomains and domains to s3 bucket static assets(build code)
- Run
npm install
in all the 3 services i.e.api-server
,build-server
ands3-reverse-proxy
- Docker build the
build-server
and push the image to AWS ECR. - Setup the
api-server
by providing all the required config such as TASK ARN and CLUSTER arn. - Run
node index.js
inapi-server
ands3-reverse-proxy
At this point following services would be up and running:
S.No | Service | PORT |
---|---|---|
1 | api-server |
:9000 |
2 | socket.io-server |
:9002 |
3 | s3-reverse-proxy |
:8000 |
-
Start a PostgreSQL database using Docker:
docker run -d \ --name cms-db \ -e POSTGRES_USER=myuser \ -e POSTGRES_PASSWORD=mypassword \ -e POSTGRES_DB=mydatabase \ -p 5432:5432 \ postgres
based on this command the connection url will be
DATABASE_URL=postgresql://myuser:mypassword@localhost:5432/mydatabase?schema=public
-
Create a
.env
file based on the.env.example
file and configure theDATABASE_URL
with your postgreSQL connection string. -
Install dependencies:
npm install
-
Run database migrations:
npm run prisma:migrate