This is the repository for the backend of the Habit Tracker application, a Node.js API for tracking daily habits. This API was developed using Node.js and PostgreSQL as the database, and it follows the principles of Hexagon Architecture.
To install the project dependencies, run the following command:
npm install
npm start
The server will run on http://localhost:8000
Additionally, you need to create a PostgreSQL database named "habit-tracker" before starting the server.
- GET /habits/: Returns the list of habits.
- POST /habits/: Creates a new habit.
- PUT /habits/: Updates an existing habit.
- DELETE /habits/: Removes a habit.
- GET /habits/{id}: Returns information about a specific habit with the corresponding ID.
- GET /habitsCompDate/: Returns the list of habit completion dates.
- POST /habitsCompDate/: Creates a new habit completion date.
Detailed API documentation is available in Swagger at the /doc route. You can access it in your browser to get information on how to use the routes and available parameters.
npm run test
This project follows GitFlow standards for branch management and development workflow. Additionally, continuous integration (CI) and continuous delivery (CD) are achieved through GitHub Actions to ensure that code is automatically tested and deployed to production.
The API is hosted at https://habit-tracker-backend.vercel.app/.