Skip to content

arreharsh/LaundryMart-api

Repository files navigation

Laundry Mart Backend API

A simple Node.js + Express REST API for user authentication, laundry bookings, and an admin panel.

This backend is designed to support a frontend application where users can place bookings and admins can manage them securely.


Features

  • User registration & login
  • JWT-based authentication
  • Create and view laundry bookings
  • Admin login
  • Admin panel APIs to view & update bookings
  • Role-based access for admin routes

Tech Stack

  • Node.js
  • Express.js
  • MongoDB + Mongoose
  • JSON Web Tokens (JWT)
  • bcrypt
  • dotenv

Setup

  1. Clone the repository
git clone <repo-url>
cd backend
npm install
npm run dev

API Endpoints

Test

  • GET /api/test
    Health check endpoint

Authentication

  • POST /api/auth/register
    Register a new user

  • POST /api/auth/login
    Login user and receive JWT token


Orders

  • GET /api/orders
  • POST /api/orders
  • GET /api/orders/:id

Bookings (Web)

  • POST /api/bookings
    Create a new booking

  • GET /api/bookings/my
    Get logged-in user's bookings


App Bookings (Mobile)

  • POST /api/appbooking
  • GET /api/appbooking/:userId

Contact

  • POST /api/contact
    Submit contact / support form

Admin

  • POST /api/admin/login
    Admin login (returns JWT)

  • GET /api/admin/bookings
    Get all bookings (Admin only)

  • PATCH /api/admin/booking/:id
    Update booking status (Admin only)

About

A simple Node.js + Express REST API for user authentication, laundry bookings, and an admin panel. This backend is designed to support a frontend application where users can place bookings and admins can manage them securely.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors