Skip to content

MAYANKSHARMA01010/MESSIA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MESSIA - Premium E-Commerce Application

MESSIA is a full-stack e-commerce platform designed for gifting premium products. It features a modern, responsive frontend built with Next.js and a robust backend powered by Node.js, Express, and PostgreSQL.

🚀 Tech Stack

Frontend

Backend

📂 Project Structure

.
├── README.md
├── apps
│   ├── backend                 # Express.js Backend
│   │   ├── config              # Database & CORS config
│   │   ├── controllers         # Route controllers (Auth, Product, Cart, etc.)
│   │   ├── middlewares         # Auth & Admin middlewares
│   │   ├── models              # Prisma models
│   │   ├── prisma              # Prisma schema & migrations
│   │   ├── routes              # API routes
│   │   └── utils               # Helper functions
│   └── frontend                # Next.js Frontend
│       ├── app                 # App Router
│       │   ├── (pages)         # Application pages
│       │   ├── components      # Reusable UI components
│       │   ├── context         # React Context (Auth, Cart)
│       │   ├── globals.css     # Global styles & Tailwind
│       │   └── layout.js       # Root layout
│       └── public              # Static assets
└── package.json

🛠️ Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • PostgreSQL database

⚙️ Installation & Setup

1. Clone the Repository

git clone https://github.com/MAYANKSHARMA01010/MESSIA.git
cd messia

2. Backend Setup

Navigate to the backend directory and install dependencies:

cd apps/backend
npm install

Create a .env file in apps/backend with the following variables:

PORT=5001
DATABASE_URL="postgresql://user:password@localhost:5432/messia_db?schema=public"
JWT_SECRET="your_super_secret_key"

Run database migrations:

npx prisma migrate dev --name init

Start the backend server:

npm run dev

The backend will run on http://localhost:5001.

3. Frontend Setup

Navigate to the frontend directory and install dependencies:

cd ..apps/frontend
npm install

Create a .env file in apps/frontend (optional, if needed for API URL):

NEXT_PUBLIC_API_URL="http://localhost:5001/api"

Start the frontend development server:

npm run dev

The frontend will run on http://localhost:3000.

🌟 Features

  • User Authentication: Sign up, Login, and Profile management.
  • Product Management: Admin dashboard to add, edit, and delete products.
  • Shopping Cart: Add items, adjust quantities, and view cart summary.
  • Address Book: Manage shipping addresses with a premium UI.
  • Responsive Design: Fully optimized for mobile and desktop devices.
  • Dark Mode: Built-in dark mode support.

📝 API Endpoints

Auth

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Login user
  • GET /api/auth/profile - Get user profile

Products

  • GET /api/products - List all products
  • GET /api/products/:id - Get single product
  • POST /api/products - Create product (Admin only)
  • PUT /api/products/:id - Update product (Admin only)
  • DELETE /api/products/:id - Delete product (Admin only)

Cart

  • GET /api/cart - Get user cart
  • POST /api/cart/add - Add item to cart
  • PUT /api/cart/update - Update item quantity
  • DELETE /api/cart/remove/:productId - Remove item from cart

Address

  • GET /api/address - List addresses
  • POST /api/address - Add new address
  • PUT /api/address/:id - Update address
  • DELETE /api/address/:id - Delete address

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published