Table of Contents

Project Food-Recipes-Backend with ExpressJs

The Food-Recipes-Backend project is an API built using the Express.js framework to manage users, recipes, and categories data in an application. This API provides various key features including CRUD (Create, Read, Update, Delete) operations, sorting, searching, and pagination to efficiently manage data. The project also utilizes environment variable management (env) and comes with a Postman collection for API testing. PostgreSQL is used as the database for this project.

image

Tools

  1. Visual Studio Code
  2. NodeJS
  3. ExpressJS
  4. PostgreSQL for database (this is what i use)
  5. Multer and Cloadinary for photo
  6. Postman for testing API

Built With

Getting Started

Installation

  1. Clone Repository: Clone this repository to your local system.
git clone https://github.com/rikiprimus/BE-Recipes.git
  1. Install Dependencies: install all required dependencies and add 'dev' to the script section to use nodemon.
npm install
"scripts": {
    "dev": "nodemon index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  1. Environment Configuration: Set the necessary environment variables in the .env file to set the application settings.
DB_HOST=
DB_USER=
DB_NAME=
DB_PASSWORD=
DB_PORT=

JWT_KEY=

CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
  1. Run Server: Start the server with command.
npm run dev
  1. Test API: First, you need to import collections to Postman to test and explore the API.

Features

  • CRUD Operations: Allows users to create, read, update, and delete entities within the system.
  • Authorization and Authentication: Validate the registered account.
  • Upload File Photo: Upload photo files to cloadinary and save the link to the database.
  • Sort: Provides options to sort data based on specific criteria, such as name, date, or price.
  • Search: Enables users to search for data based on specific search criteria, with support for partial text search.
  • Pagination: Divides search results or data into separate pages to improve performance and the user experience.
  • Env Management: Utilizes environment variables to configure the application, such as database connections or other global settings.
  • Postman Collection: Includes a Postman collection containing API requests that can be used to test and document the API.

Routes API to use

  1. '/' GET
  1. '/' POST
  1. '/:id' DELETE : use 'id' for find data, then delete
  1. '/:id' UPDATE : use 'id' for find data, then update

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b your/branch)
  3. Commit your Changes (git commit -m 'Add some features')
  4. Push to the Branch (git push origin feature/yourbranch)
  5. Open a Pull Request

Related Project

Contact

Contributors names and contact info