Skip to content

This is a user management app where an user can order the product and show the total cost of the products

Notifications You must be signed in to change notification settings

sm-alamin/second-assignment

Repository files navigation

second-assignment

This is a simple user management application built with Express.js, MongoDB, and Zod for validation.

Live Demo

Check out the live demo: User Management App

Features

  • Create a new user
  • Retrieve all users
  • Retrieve a single user
  • Update a user's information
  • Delete a user
  • Add an order for a user
  • View all orders for a user
  • Calculate the total price of all orders for a user

Getting Started

Prerequisites

  • Node.js and npm installed
  • MongoDB installed and running

Installation

  1. Clone the repository:

    git clone https://github.com/sm-alamin/second-assignment.git
  2. Change into the project directory:

    cd second-assignment
  3. Install dependencies:

    npm install
  4. Set up your MongoDB database and update the connection string in config.js.

  5. Start the application:

    npm run start:dev
  6. Open your browser and navigate to (http://localhost:5000).

API Endpoints

Create a User

POST /api/users

### Get all user

```http
GET /api/users

### Get a single user

```http
GET /api/users/:userId

### Update user

```http
PUT /api/users/:userId

### Delete user

```http
DELETE /api/users/:userId

### Add an Order for a User

```http
PUT /api/users/:userId/orders

### Get All Orders for a User

```http
GET /api/users/:userId/orders

### Calculate Total Price of Orders for a User

```http
GET /api/users/:userId/orders/total-price

About

This is a user management app where an user can order the product and show the total cost of the products

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published