Skip to content

This is the backend service for the WasteManagement project, built using NestJS and Prisma with MongoDB. It provides APIs for efficient waste tracking, collection management, and user engagement.

Notifications You must be signed in to change notification settings

RadimYassin/WasteManagementBackend

Repository files navigation

API Documentation - UserController

This controller handles user-related operations using UserService and Prisma.

Routes:

  1. POST /user

    • Creates a new user.
    • Parameters: A createUserDto object in the body of the request, of type Prisma.UserCreateInput.
  2. GET /user

    • Retrieves all users.
    • Response: An array of users.
  3. GET /user/:id

    • Retrieves a specific user by their id.
    • Parameter: id in the URL, of type string.
    • Response: The user corresponding to the id.
  4. PATCH /user/:id

    • Updates an existing user.
    • Parameter: id in the URL, of type string.
    • Request Body: A updateUserDto object of type Prisma.UserUpdateInput.
  5. DELETE /user/:id

    • Deletes a user by their id.
    • Parameter: id in the URL, of type string.
    • Response: Confirmation of deletion.

Example Usage:

  • Create a user:
    Send a POST request with a JSON object in the body (e.g., name, email, etc.).

  • Get all users:
    Send a GET request to /user.

  • Update a user:
    Send a PATCH request with the user's id and the data to be updated.

Installation

To use this API, ensure that you have installed the necessary dependencies:

  1. Install NestJS and Prisma:

    npm install @nestjs/common @nestjs/core @nestjs/platform-express prisma
  2. Set up the Prisma database models and migrate:

    npx prisma db push
  3. Start the application:

    npm run start

Now, your API should be ready to handle user management with the UserController. "# WasteManagementBackend"

About

This is the backend service for the WasteManagement project, built using NestJS and Prisma with MongoDB. It provides APIs for efficient waste tracking, collection management, and user engagement.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published