Rest API for a daily diet application
Report Bug
.
Request Feature
This project is the backend API for a daily diet application, providing functionality related to user authentication, data storage, and retrieval for managing daily dietary information.
This API is built with Fastify and TypeScript, utilizing various libraries for testing, database management, and environment variable handling. It's designed to support a daily diet application, providing a reliable and performant backend for managing user data related to dietary habits.Here are a few examples.
This project is available at: https://daily-diet-api-r1k9.onrender.com/
- npm
npm install npm@latest -g- Clone the repo
git clone https://github.com/brunod-e/daily-diet-api- Install NPM packages
npm install- Configure your .env
DATABASE_URL="./db/app.db"
DATABASE_CLIENT="sqlite"
NODE_ENV="development"- Run migrations
npm run dev-knex -- migrate:latest- Run server
npm run dev- Run tests
npm testPOST /users
Descrição: Rota para criar um usuário. Parâmetros: name(string): Nome do usuário. email (string): Email do usuário.
GET /meals
Descrição: Obter todas as refeições registradas.
POST /meals
Descrição: Adicionar uma nova refeição ao usuário. Parâmetros: name (string): Nome da refeição. description (string): Descrição da refeição. isOnDiet (boolean): Se está ou não incluso na dieta. date (string): Data que foi feita a refeição.
GET /meals/:id
Descrição: Obter uma refeição específica. Parâmetros: id (string): Identificador único da refeição.
PUT /meals/:id
Descrição: Atualiza uma refeição. Parâmetros: id (string): Identificador único da refeição. name (string): Nome da refeição. description (string): Descrição da refeição. isOnDiet (boolean): Se está ou não incluso na dieta. date (string): Data que foi feita a refeição.
DELETE /meals/:id
Descrição: Apaga uma refeição. Parâmetros: id (string): Identificador único da refeição.
GET /meals/metrics
Descrição: Retorna os dados relacionados a todas as refeições feitas pelo usuário.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PR for each suggestion.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
- Bruno D. - Fullstack Developer - Bruno D. - Built full application
