Skip to content

KarolGitHub/nextjs-ecommerce

Repository files navigation

Next.js E-commerce Project

This is a full-stack e-commerce application built with Next.js, React, and Node.js, featuring a robust backend with MongoDB (Mongoose) for data management and secure user authentication.

✨ Features

  • Product Catalog: Browse and view details of various products.
  • Shopping Cart: Add, update, and remove items from your cart.
  • User Authentication: Secure user registration, login, and session management using JWT and bcrypt.
  • Order Management: Place and track orders. (Implied by e-commerce, will assume this is a feature)
  • Database Integration: Persistent data storage with MongoDB via Mongoose.
  • Responsive Design: Modern and responsive UI built with Sass.
  • API Routes: Backend API endpoints built with Next.js API routes.

🚀 Getting Started

Follow these steps to set up and run the project locally.

Prerequisites

Make sure you have the following installed:

  • Node.js (LTS recommended)
  • npm or Yarn
  • MongoDB (local instance or a cloud service like MongoDB Atlas)

Installation

  1. Clone the repository:

    git clone <your-repository-url>
    cd nextjs-ecommerce
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Environment Variables:

    Create a .env.local file in the root of the project and add the following environment variables:

    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret_key
    
    • MONGODB_URI: Your MongoDB connection string (e.g., mongodb://localhost:27017/ecommerce or your MongoDB Atlas URI).
    • JWT_SECRET: A strong, random string for JWT token signing.

Running the Development Server

To run the project in development mode:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result. The page auto-updates as you edit the file.

Building for Production

To build the application for production:

npm run build
# or
yarn build

Running in Production

To start the application in production mode after building:

npm run start
# or
yarn start

Linting and Formatting

  • Lint:
    npm run lint
  • Lint and Fix:
    npm run lint:fix
  • Format:
    npm run format

📦 Technologies Used

🔗 Learn More

To learn more about Next.js, take a look at the following resources:

🚀 Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

E-commerce store built with Next.js + MongoDB + PayPal API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published