Skip to content

Alexandra2888/eShop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

160 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

eShop πŸ›’

Welcome to eShop, a fully integrated MERN stack e-commerce platform where performance and real-time experience come first. eShop provides a seamless shopping experience, complete with cart management, payment processing, and a snappy UI.

Version 🏷️

  • Backend: 1.0.0
  • Frontend: 1.0.0

Description πŸ“

eShop is designed to be a lightweight, yet powerful e-commerce solution. Built with the latest web technologies for efficiency and ease of use, it supports everything from product browsing to order management.

Features ✨

  • πŸ›οΈ E-commerce Core: Product catalog, shopping cart, checkout system
  • πŸ” User Management: Secure authentication, user profiles, order history
  • πŸ’³ Payment Integration: PayPal payment processing
  • πŸ“± Responsive Design: Mobile-first approach with TailwindCSS
  • ⚑ Real-time Updates: Live cart updates and order tracking
  • πŸ–ΌοΈ File Management: Image uploads for products
  • 🌍 Internationalization: Multi-language support (EN, DE, RO)
  • 🎨 Admin Dashboard: Product and order management
  • πŸ” Search & Filter: Advanced product discovery
  • πŸ“Š Analytics: Sales and user analytics

Technologies 🧰

Frontend

  • React 18 - Modern React with hooks
  • Redux Toolkit - State management
  • TailwindCSS - Utility-first CSS framework
  • Vite - Fast build tool
  • React Router - Client-side routing
  • i18next - Internationalization

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - MongoDB ODM
  • JWT - Authentication
  • Multer - File uploads

Security & Performance

  • Helmet - Security headers
  • CORS - Cross-origin resource sharing
  • bcryptjs - Password hashing
  • Morgan - HTTP request logger

πŸš€ Quick Deploy

Option 1: Render (Recommended)

# Run the deployment script
./deploy.sh

# Choose option 1 for Render deployment

Option 2: Docker

# Build and run with Docker
docker build -t eshop-app .
docker run -d -p 10000:10000 eshop-app

# Or use docker-compose
docker-compose up -d

Option 3: Manual Deployment

See DEPLOYMENT.md for detailed instructions.

Installation πŸ’Ύ

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • npm or yarn

Local Development

# Clone the repository
git clone https://github.com/Alexandra2888/eShop
cd eShop

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install

# Start the application
cd ..
npm run backend
npm run frontend

Usage πŸ–₯️

Development Scripts

# Backend development
npm run backend          # Start backend with nodemon
npm run start           # Start backend in production mode

# Frontend development
npm run frontend        # Start frontend dev server
npm run build           # Build frontend for production

# Database operations
npm run data:import     # Import sample data
npm run data:destroy    # Clear database

Environment Variables

Create .env files in both backend/ and frontend/ directories:

Backend (.env)

MONGO_URL=mongodb://localhost:27017/eshop
JWT_SECRET=your_jwt_secret_key
NODE_ENV=development
PORT=5001
PAYPAL_CLIENT_ID=your_paypal_client_id
PAYPAL_CLIENT_SECRET=your_paypal_client_secret

Frontend (.env)

VITE_API_URL=http://localhost:5001

πŸ“ Project Structure

eShop/
β”œβ”€β”€ docs/                   # Architecture RFCs & design documents
β”‚   └── RFC-001-system-design.md
β”œβ”€β”€ backend/                 # Backend API (Node.js + Express + TypeScript)
β”‚   β”œβ”€β”€ config/             # Database & configuration
β”‚   β”œβ”€β”€ controllers/        # Route controllers
β”‚   β”œβ”€β”€ middlewares/        # Custom middlewares
β”‚   β”œβ”€β”€ models/             # MongoDB schemas
β”‚   β”œβ”€β”€ routes/             # API endpoints
β”‚   β”œβ”€β”€ uploads/            # File uploads
β”‚   └── utils/              # Utility functions
β”œβ”€β”€ frontend/               # React frontend (Vite + TypeScript)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/          # Page components
β”‚   β”‚   β”œβ”€β”€ redux/          # State management (RTK Query + slices)
β”‚   β”‚   └── utils/          # Frontend utilities
β”‚   └── public/             # Static assets
β”œβ”€β”€ docker-compose.yml      # Docker configuration
β”œβ”€β”€ Dockerfile              # Multi-stage Docker build
β”œβ”€β”€ deploy.sh               # Deployment automation
└── DEPLOYMENT.md           # Deployment guide

🌐 API Endpoints

Authentication

  • POST /api/users/register - User registration
  • POST /api/users/login - User login
  • GET /api/users/profile - Get user profile

Products

  • GET /api/products - Get all products
  • GET /api/products/:id - Get product by ID
  • POST /api/products - Create product (admin)
  • PUT /api/products/:id - Update product (admin)

Orders

  • POST /api/orders - Create order
  • GET /api/orders/myorders - Get user orders
  • GET /api/orders/:id - Get order by ID

🎯 Portfolio Features

This project demonstrates:

  • Full-stack development with MERN stack
  • Modern React patterns (hooks, context, functional components)
  • State management with Redux Toolkit
  • API design with RESTful endpoints
  • Database modeling with MongoDB/Mongoose
  • Authentication & authorization
  • File uploads and media management
  • Payment integration with PayPal
  • Responsive design with TailwindCSS
  • Internationalization support
  • Production deployment configuration

πŸ”§ Development

Code Quality

  • ESLint configuration
  • Prettier formatting
  • SOLID principles
  • KISS design patterns

Testing

  • Manual testing for all features
  • API endpoint testing
  • Cross-browser compatibility

πŸ“Š Performance

  • Lazy loading for images
  • Code splitting with React Router
  • Optimized builds with Vite
  • Efficient state management with Redux
  • Database indexing for fast queries

🚨 Troubleshooting

Common Issues

  1. CORS errors: Check backend CORS configuration
  2. MongoDB connection: Verify connection string and network access
  3. Build failures: Ensure Node.js 18+ and all dependencies installed
  4. File uploads: Check uploads directory permissions

Getting Help

πŸ“ Architecture & Design Docs

Technical RFCs and design documents live in the /docs folder.

Document Description
RFC-001 β€” System Design Full system architecture: component design, data models, API reference, security, deployment, and future work

Contributing 🀝

Contributions are welcome! Please feel free to submit a Pull Request.

License πŸ“„

This project is licensed under the MIT License.

Author πŸ‘€

Alexandra2888 - Full-stack developer passionate about creating modern web applications.

Preview πŸ“Έ

Macbook Pro-1717079992553

Macbook Pro-1717080129745

Macbook Pro-1717080201428

🌟 Live Demo


⭐ Star this repository if you find it helpful for your portfolio!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors