- Secure authentication for user registration and login.
- Financial transaction tracking (income and expenses) with attributes like amount, category, description, and date.
- Automatic calculation of the current balance and categorization for detailed analysis.
- Management of custom categories (create, edit, and delete).
- Fast performance for calculations.
- Scalability to handle a large number of users and data.
- Intuitive and responsive interface, compatible with browsers and mobile devices.
- Must include E2E and unity testing.
- Must have run test in github's CI environment
- Advanced security (HTTPS, JWT authentication, attack prevention).
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of Node.js.
- You must have Docker installed
Open the terminal and use the following command to clone the project to your computer:
git clone https://github.com/viniciusferreira7/finance-api
cd <PROJECT_DIRECTORY_NAME>
npm install
- this env you need to run application:
NODE_ENV=dev
PORT=3333
#AUTH
JWT_SECRET=
FINANCE_APP_TOKEN=
# DATABASE
DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_NAME=
DATABASE_URL=
- Create a file with name is .env and enter with your values
docker compose --env-file .env up -d
npx prisma migrate deploy
npx prisma db seed
npm start:dev
This project can be easily run using Docker and Docker Compose. Below are the instructions to run the project in a container.
Before you start, make sure you have:
- Docker installed on your machine.
- Docker Compose installed (usually included with Docker Desktop).
First, clone the project repository to your local machine:
git clone https://github.com/username/repository-name.git
cd repository-name
Create .env file following .env.example
npm run start:containers
This command will:
- Build the container images.
- Run PostgreSQL (finance-api-postgresql container).
- Run the application (finance-api container).
- Run Prisma migrations if configured.
After running the command, you can check if the containers are working properly by running:
docker-compose ps
This will list the active containers and show their status
To stop the running containers, use the following command:
docker-compose down
This will stop and remove all the created containers, but will keep the volumes and networks persistent.
- @faker-js/faker: 8.4.1,
- @fastify/jwt: 8.0.0,
- @fastify/swagger: 8.14.0,
- @fastify/swagger-ui: 4.0.0,
- @prisma/client: 5.12.1,
- @scalar/fastify-api-reference: 1.24.35,
- bcryptjs: 2.4.3,
- chalk: 5.3.0,
- dayjs: 1.11.11,
- fastify: 4.26.2,
- supertest: 7.0.0,
- zod: ^3.22.4,
- zod-to-json-schema: 3.23.2
- @rocketseat/eslint-config: 2.2.2,
- @types/bcryptjs: 2.4.6,
- @types/fastify-jwt: 0.8.1,
- @types/node: ^20.12.7,
- @types/supertest: 6.0.2,
- @vitest/coverage-v8: 1.5.3,
- @vitest/ui: 1.5.3,
- dotenv: 16.4.5,
- eslint: 8.56.0,
- eslint-plugin-simple-import-sort: 12.1.0,
- npm-run-all: 4.1.5,
- prisma: 5.12.1,
- tsup: ^8.0.2,
- tsx: ^4.7.2,
- typescript: ^5.4.5,
- vite-tsconfig-paths: 4.3.2,
- vitest: 1.5.3