REST API to manage users expenses.
- Node.js (v18)
- NestJS (v10)
- PostgreSQL (v15)
The API documentation (Swagger) is available at /docs route.
First, you need to create a .env file in the root of the project, based on the .env.example file.
Insert the environment variables values in the .env file.
Then, you need to install the dependencies:
npm installRun the migrations:
npm run migrations:executeAnd finally, you can run the project:
npm run start:devThat's it! The project will be running on localhost:${PORT}.
Build the image:
docker build -t expenses-api .Run the container (This command will also run the migrations):
docker run -d \
-e TZ='UTC' \
-e PORT='3000' \
-e NODE_ENV='development' \
-e DATABASE_URL='postgres://username:password@host.docker.internal:5432/databasename' \
-e JWT_SECRET='my-secret' \
-e AWS_REGION='us-east-1' \
-e AWS_ACCESS_KEY_ID='your_access_key_id' \
-e AWS_SECRET_ACCESS_KEY='your_secret_access_key' \
-p 3000:3000 expenses-apinpm run migrations:executenpm run migrations:revertnpm run typeorm migration:create src/database/migrations/NameOfTheMigrationnpm run testnpm run lint