Skip to content

Xelvise/e-commerce-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimalist E-commerce web app

A minimalist e-commerce web application built with modern TypeScript and Node.js technologies. This project demonstrates fundamental and advanced concepts in backend development, including user authentication, payment processing, PDF generation, email notifications, and more.

🚀 Features

  • User authentication and authorization
  • Shopping cart management
  • Order processing and history
  • Payment integration with Stripe
  • PDF invoice generation
  • Email notifications
  • File upload capabilities
  • MongoDB session management
  • CSRF protection
  • Input validation
  • Responsive views with EJS templating

🛠️ Technologies Used

  • Runtime: Node.js with TypeScript
  • Framework: Express.js
  • Database: MongoDB with Mongoose ODM
  • Template Engine: EJS
  • Authentication: bcryptjs
  • Session Management: express-session with MongoDB store
  • File Handling: Multer
  • Email Service: Nodemailer with SendGrid
  • Payment Processing: Stripe
  • PDF Generation: PDFKit
  • Security: CSRF protection, input validation
  • Development Tools: Nodemon, TypeScript

📋 Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (LTS version recommended)
  • MongoDB (local installation or MongoDB Atlas account)
  • npm or yarn package manager

🔧 Installation

  1. Clone the repository:

    git clone <your-repo-url>
    cd e-commerce-app
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory with the following variables:

    MONGODB_URI=your_mongodb_connection_string
    SESSION_SECRET=your_session_secret
    STRIPE_KEY=your_stripe_secret_key
    SENDGRID_API_KEY=your_sendgrid_api_key
  4. Start the development server:

    npm start

The application will be available at http://localhost:3000 (or your configured port).

📁 Project Structure

src/
├── app.ts              # Application entry point
├── controller/         # Route controllers
├── routes/            # Application routes
├── models/            # Database models
├── views/             # EJS templates
├── public/            # Static files
├── utils/             # Utility functions
└── invoices/          # Generated PDF invoices

🔐 Environment Variables

  • MONGODB_URI: Your MongoDB connection string
  • SESSION_SECRET: Secret key for session management
  • STRIPE_KEY: Stripe secret key for payment processing
  • SENDGRID_API_KEY: SendGrid API key for email notifications

🛡️ Security Features

  • Password hashing with bcrypt
  • CSRF protection
  • Session management
  • Input validation
  • Secure file uploads
  • MongoDB injection prevention

📝 License

ISC

👤 Author

Elvis Gideon

About

A minimalist e-commerce web app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published