IDL_management_page contains the user interface
Gateway-Generator contains the Code generator
pages-backend-test contains the backend server for interacting with the database
- RUN
docker pull quay.io/coreos/etcd:v3.5.0
to pull etcd image from dockerhub - RUN
docker network create --driver bridge etcd-net
create a etcd-net network - RUN
docker-compose up
at root directory to start he docker container for etcd - RUN
docker pull postgres:latest
to pull etcd image from postgres - RUN
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=mydatabase -p 5432:5432 -d postgres
to run the database on port 5432 - Start the containers on docker, preferably through docker desktop
- RUN
cd IDL_management_page/page/my-app/
from ROOT DIRECTORY - RUN
npm install
to ensure that the dependencies are up to date - RUN
npx prisma migrate dev --name init --schema=prisma/schema.prisma
to apply the migration using the schema to the database - RUN
npx prisma generate --schema=prisma/schema.prisma
generate a prisma client using the schema - RUN
npm run dev
to run the user interface on port 3000
- RETURN TO ROOT DIRECTORY
- RUN
cd pages-backend-test/pages-backend
- RUN
npx prisma migrate dev --name init --schema=prisma/schema.prisma
to apply the migration using the schema to the database. Your database needs to be up by now so the migration can be executed. - RUN
npx prisma generate --schema=prisma/schema.prisma
generate a prisma client using the schema - RUN
node index.js
to run your backend expressjs server on port 3333
- RUN
brew install nginx
install nginx on system
- Download Nginx from official Nginx website
- RUN
setx NGINX_PATH "C:\path\to\nginx\directory" /M
on terminal (IMPORTANT) so as to make the nginx directory availble as a system environmental variable to be located to start nginx
- RUN
npm run dev
under /IDL_management_page/page/my-app to run the frontend UI if you haven't yet - RUN
node index.js
under /pages-backend-test/pages-backend to run the backend server if you haven't yet - Open a browser on localhost:3000
- Docker is installed
- Node.js is installed
- Nginx is installed
- Prisma installed globally using
npm install -g prisma
- No process is running on ports 8888, 8889, 8890, 20000, 20001, 20002, 5432, 3000, 3333 (Will make improvements to the customisability in the future)
- Do the files in Gateway-Generator have execute permission enabled? If not, you might need to change their permissions to be able to execute them.
- Is your etcd cluster up and running? Refer to our etcd setup guide
- Are your microservices up and running and registered to the etcd cluster?
- Does your microservice follow the specifications defined in our System Design Document?
- Go onto your browser's console and run these to reset the values:
localStorage.setItem('running','n')
associated with whether the gateway is runninglocalStorage.setItem('generated','n')
associated with whether the gateway is generated in Gateway-Generator/gateway
- Go into Gateway-Generator/gateway and delete everything in the folder
- Kill all processes on all ports (3000, 3333, 8888, 8889, 8890, [your nginx port, normally 80])
- Delete the docker container
some-postgres
which is used as our database - Rerun step 5 of Docker Setup, steps 3-5 of Frontend setup and steps 3-5 of Backend setup to bootup everything again.
- Create shared prisma client so client generation does not have to happen twice
- Move pages-backend out of nested directory