Setup
- Clone this repository to your local machine.
- Run
npm install
to ensure all dependencies are installed. - Create a mysql database.
- Setup
.env
file with below variables.
- DB_HOST
- DB_USER
- DB_PASSWORD
- DB_NAME
- PORT
- JWT_SECRET
- run the migrations.
node_modules/.bin/knex --esm migrate:latest
- Run
npm start
to run the script. - Run
npm test
to run the test cases.
This project is configured to support CI/CD on Google CLoud Run. To Enable this functionality, you have to configure few environment variables as below:
- DEPLOY_KEY_FILE_PRODUCTION
- CLOUDSQL_CONNECTION_NAME
- DATABASE_USER
- dbname
- dbpass
- PROJECT_ID_PRODUCTION
- SERVICE_NAME
To implement the required infrastructure for this project, you can use this Terraform repository.
After implementing the infrastructure, you can create a new branch and make some changes in to it and then merge it to master branch. So as soon as the pipelines succeed, the new changes will be deployed to Google CLoud run.
https://course-project-k6y7krefqa-nn.a.run.app
REST API list
- POST : /users
- GET : /users
- GET : /users/:id
- PUT : /users/:id
- POST : /entries
- GET : /entries (Protected)
- GET : /entries/:id (Protected)
- PUT : /entries/:id (Protected)
The Protected APIs required bearer token
to execute.