http://ec2-13-239-119-130.ap-southeast-2.compute.amazonaws.com:5000
> .github - Github Actions CICD Pipeline
| cd.yml - continuous deployment workflow
| ci.yml - continuous integration workflow
> backend - Node & Express & MongoDB code
| .env local node config/creds
| package.json - backend dependencies
> diagrams - stores all diagram code(if any)
| sequence-diagram.txt - sequence diagram code
> e2eTests - playwright e2e tests(chrome only)
| .env - local playwright configs
> frontend - Vite React
| .env local frontend config/creds
| package.json - frontend dependencies
> infrastructure AWS CDK TypeScript
| package.json - AWS CDK dependencies
> scripts - useful scripts for local dev, CI and CD
> wiremock - mock gemini ai response for local dev
.env - MONGODB local config/creds
docker-compose-ci.yml - docker-compose for CI environment
docker-compose-prod.yml - docker-compose for PROD environment
docker-compose.yml - docker-compose for LOCAL DEV environment
Dockerfile - Frontend & Backend App docker container
Download the Zip (nvm-noinstall.zip) HERE
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install 20.11.1
nvm use 20.11.1
npm install -g nodemon
cd ./frontend
npm install
cd ../backend
npm install
Follow the instruction HERE
brew install docker
How to run frontend react, backend node, mongodb in dev mode or as docker containers
Run this from Git Bash if you use Windows
# In a new shell, and keep this shell opened
cd ./backend
npm run start:dep
#Verify the env, Open http://localhost:8080/db/admin/ in your browser, and login with dev/dev
cd ./frontend
npm run dev
cd ./backend
npm start
# (starts node server at `localhost:3000`)
- default username: devroot
- default password: devroot
- default database: cs732
http://localhost:8080/db/admin/
Username: dev
, Password:dev
- Visit the backend: http://localhost:8001/api/users
- Visit the frontend: http://localhost:8000/
- Visit mongodb admin portal: http://localhost:8080 with username: dev, password: dev
cd ./frontend
npm test
cd ./backend
npm test
- spin up backend node.
- spin up mongodb database through docker-compose
cd ./backend
npm run test:e2e
You can also manually test APIs with swagger UI
- go to http://localhost:3000/api/api-docs
- view and call apis for testing
We currently put dev and prod stacks all in one account but you can test deploying the stack with your own suffix. You need to reachout to Mark(mzhu929) for giving you permission to access AWS console and deploying stacks as this is his personal AWS account.
cd ./infrastructure
npm run deploy-dev
Put your mock files under deployment/wiremock/__files
and deployment/wiremock/mappings
Refere the json
example here: https://wiremock.org/docs/stubbing/
install playwright and chromium
npx playwright install --with-deps chromium
Ensure you have spinned up react, node servers & mongodb docker containers locally. If you have not, follow the How to run frontend react, backend node, mongodb in dev mode or as docker containers
guide above.
under project root folder:
cd e2eTests
npm run test:e2e
If you raise a pr, Github Actions will trigger the ./github/workflow/ci.yml
workflow which runs all automated tests