App backend for 'Practicas de desarrollo de software' signature S12024
Using latest versions for all technologies (March 2024)
- Nodejs 18.17.0
- Typescript 5.4
- Express 4.19
- Jest 29.7
- OvernightJS 1.7
- MongoDB (Mongoose 8.2)
- Swagger 2 (OpenAPI 3)
-
Change name file .env.example to .env
-
Run
npm install
to get the dependencies installed. -
Run
docker compose -p apc-backend up -d --force-recreate
to get images and create containers.
- Backend:
- Server: http://localhost:8080/api
- API documentation: http://localhost:8080/api-docs/
- Mongo client web: http://localhost:8081
- User: admin
- Password: pass
-
In folder docker/sonar then run
docker compose up -d sonarqube --force-recreate
to up docker container. -
You can to access on: http://localhost:9000
- User: admin
- Password: pass
The first time you should to change password and write it on sonar-project.properties before run scanner.
-
Create a new project, take the token and write it on sonar-project.properties before run scanner
-
Run
sh run-sonar-scanner.sh
to start scanner in root folder.
-
Change on run-sonar-scanner.sh file line:
-v ".:/usr/src" \
-
to line:
-v "/$(pwd).:/usr/src" \
-
Go to folder docker/grafana then run
docker compose up -d grafana --force-recreate
to up docker container -
You can to access on: http://localhost:3001
โ ๏ธ Important!
First to run k6 you need Grafana container up ๐
- Go to folder docker/k6 then run
sh run-load-test
-
Go to folder docker/prometheus then run
docker compose up -d prometheus --force-recreate
to up docker container -
You can to access on: http://localhost:9090
Using RailWay to deploy backend (Nodejs server and Mongo data base)
-
Swagger docs: https://apc-backend-pdes-s1-2024-production.up.railway.app/api-docs
-
Connection string:
mongodb://mongo:[email protected]:12140
Enjoy , thanks!