The Daily Diet API is an application developed as part of Challenge 02 of the "Creating RESTful APIs with Node.js" module.
- It must be possible to create a user
- It must be possible to identify the user in requests
- It must be possible to register a meal, with the following information:
- Meals must be related to a user
- Name
- Description
- Date and Time
- Is it within the diet or not
- It must be possible to edit a meal, being able to change all the above data
- It must be possible to delete a meal
- It must be possible to list all meals of a user
- It must be possible to view a single meal
- It must be possible to retrieve a user's metrics
- Total number of registered meals
- Total number of meals within the diet
- Total number of meals outside the diet
- Best sequence of meals within the diet
- The user can only view, edit, and delete the meals that he created
-
Clone the repository:
$ git clone https://github.com/your-username/daily-diet-api.git
-
Access the project folder:
$ cd daily-diet-api
-
Install the dependencies:
$ npm install
-
Configure the environment variables in a
.env
file:# Example environment variables NODE_ENV=development DATABASE_CLIENT=sqlite DATABASE_URL=./db/dev.sqlite3
-
Run the database migrations:
$ npx knex migrate:latest
-
Start the server:
$ npm start
Now, the Daily Diet API is up and running, ready for use.
Luiz Henrique - Software Developer
This project was developed as part of Challenge 02 of the "Creating RESTful APIs with Node.js" course at Rocketseat. ππ