Skip to content

Latest commit

 

History

History
80 lines (54 loc) · 2.03 KB

README.md

File metadata and controls

80 lines (54 loc) · 2.03 KB

🍏 Daily Diet API

The Daily Diet API is an application developed as part of Challenge 02 of the "Creating RESTful APIs with Node.js" module.

📋 Rules

  • 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

🚀 How to run:

  1. Clone the repository:

    $ git clone https://github.com/your-username/daily-diet-api.git
  2. Access the project folder:

    $ cd daily-diet-api
  3. Install the dependencies:

    $ npm install
  4. Configure the environment variables in a .env file:

    # Example environment variables
    NODE_ENV=development
    DATABASE_CLIENT=sqlite
    DATABASE_URL=./db/dev.sqlite3
  5. Run the database migrations:

    $ npx knex migrate:latest
  6. Start the server:

    $ npm start

Now, the Daily Diet API is up and running, ready for use.

👨‍💻 Author

Luiz Henrique - Software Developer

Linkedin | E-mail

This project was developed as part of Challenge 02 of the "Creating RESTful APIs with Node.js" course at Rocketseat. 🚀📚