Skip to content

VaultMart is a scalable e-commerce backend built with NestJS, designed to handle high-performance operations efficiently. It integrates MySQL, Redis, and AWS services for a robust infrastructure, ensuring secure authentication, seamless file uploads, and efficient data management.

Notifications You must be signed in to change notification settings

AtharvDalal/VaultMart

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

VaultMart

VaultMart is a scalable e-commerce backend built with NestJS, designed to handle high-performance operations efficiently. It integrates MySQL, Redis, and AWS services for a robust infrastructure, ensuring secure authentication, seamless file uploads, and efficient data management.

🚀 Features

  • Scalable and modular architecture
  • Authentication & Authorization using JWT
  • Database integration with MySQL & TypeORM
  • Redis caching for improved performance
  • File uploading with AWS S3 and Multer
  • Request validation using Joi & Zod

🛠 Tech Stack

  • Backend: NestJS (TypeScript, Node.js)
  • Database: MySQL with TypeORM
  • Cache: Redis
  • File Storage: AWS S3, Multer
  • Validation: Joi, Zod
  • Deployment: AWS EC2

📌 Installation

Prerequisites

Ensure you have the following installed:

  • Node.js (>= 16.x)
  • MySQL
  • Redis
  • AWS S3 bucket (for file uploads)
  • Docker (optional for containerized deployment)

Setup & Run

# Clone the repository
git clone git@github.com:AtharvDalal/VaultMart.git
cd valuetmart

# Install dependencies
npm install

# Create a .env file and configure your database, Redis, and AWS credentials

# Run migrations (if using TypeORM migrations)
npm run migration:run

# Start the server
npm run start

Docker Setup (Optional)

# Build and start the container
docker-compose up --build

📌 API Endpoints

Authentication Routes

  • Register: POST http://localhost:3000/auth/register

    Request:

    {
      "username": "testuser",
      "email": "test@example.com",
      "password": "password123"
    }

    Response:

    {
      "message": "User registered successfully",
      "user": {
        "id": 1,
        "username": "testuser",
        "email": "test@example.com"
      },
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    }
  • Login: POST http://localhost:3000/auth/login

    Request:

    {
      "email": "test@example.com",
      "password": "password123"
    }

    Response:

    {
      "message": "Login successful",
      "user": {
        "id": 1,
        "username": "testuser",
        "email": "test@example.com"
      },
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    }

Product Routes

  • Create Product: POST http://localhost:3000/product/create

    Request:

    {
      {
    "name": "Laptop",
    "price": 999.99,
    "description": "A high-end gaming laptop",
    "category": "Electronics",
    "brand": "XYZ Gaming",
    "image_url": "https://my-awesome-bucket.s3.amazonaws.com/products/laptop-image.jpg"
    "color": "Black",
    "quantity": 50,
    "rating": 4.5,
    "weight": "2.5 kg",
    "release_date": "2025-02-01",
    "warranty": "2 years",
    "discount": "10%"
    }
    }
    
    
    

    Response:

    {
      "message": "Product created successfully",
      "product": {
        {
    "name": "Laptop",
    "price": 999.99,
    "description": "A high-end gaming laptop",
    "category": "Electronics",
    "brand": "XYZ Gaming",
     "image_url": "https://my-awesome-bucket.s3.amazonaws.com/products/laptop-image.jpg"
    "color": "Black",
    "quantity": 50,
    "rating": 4.5,
    "weight": "2.5 kg",
    "release_date": "2025-02-01",
    "warranty": "2 years",
    "discount": "10%"
     }
    
    
    
    
  • Delete Product: DELETE http://localhost:3000/product/delete

  • Update Product: PUT http://localhost:3000/product/update

  • Get All Products: GET http://localhost:3000/product/getall

📄 License

This project is licensed under the MIT License.


💡 Feel free to contribute and raise issues in the repository!

About

VaultMart is a scalable e-commerce backend built with NestJS, designed to handle high-performance operations efficiently. It integrates MySQL, Redis, and AWS services for a robust infrastructure, ensuring secure authentication, seamless file uploads, and efficient data management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published