Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/Ecommerce/llms.txt

Use this file to discover all available pages before exploring further.

The Ecommerce API is a RESTful backend service for managing an online shirt store. Built with Node.js, Express, and MongoDB, it handles everything from user registration and authentication to product catalog management and shopping cart operations — including multi-angle product image processing via Google Cloud Storage.

Quickstart

Get your local server running and make your first API call in minutes.

Configuration

Set up environment variables for MongoDB, JWT, email, and Google Cloud.

Authentication

Learn how JWT tokens and Google OAuth protect API endpoints.

API Reference

Explore every endpoint across Users, Products, and Shopping Cart.

What’s Included

User Management

Registration, email verification, login, password recovery, and role-based access control.

Product Catalog

Full CRUD for shirt products with multi-angle image upload, size variants, discounts, and pagination.

Shopping Cart

Add products, manage quantities, track stock, and view purchase and sales history.

Get Started

1

Clone and install

Clone the repository and install dependencies with npm install.
2

Configure environment

Create a .env file with your MongoDB URI, JWT secret, email credentials, and Google Cloud keys. See Configuration for all required variables.
3

Start the server

Run npm run dev to start the server with hot-reloading via Nodemon and Babel.
4

Make your first request

Register a user via POST /api/user/register, verify the account, then log in to receive a JWT token. Pass the token in the token-access header on protected routes.

Tech Stack

LayerTechnology
RuntimeNode.js with Babel (ESM)
FrameworkExpress 4
DatabaseMongoDB via Mongoose 6
AuthJSON Web Tokens + Passport.js (Google OAuth 2.0)
Image ProcessingSharp — resizes to 4 sizes, converts to WebP
Image StorageGoogle Cloud Storage
EmailNodemailer
API DocsSwagger UI at /api-docs
All endpoints use POST HTTP method. Include Content-Type: application/json in request headers for JSON bodies. For protected routes, also include token-access: <your-jwt-token>.

Build docs developers (and LLMs) love