Experience our e-commerce platform live: https://e-shop-shop.onrender.com/
Try out the full functionality including user authentication, product browsing, cart management, and checkout process.
- Full-Stack Application: Built with React, Node.js, Express, and MongoDB
- Advanced Payment System: Integrated TeleBirr payment gateway for Ethiopian mobile payments
- Admin Dashboard: Complete administrative control with analytics and order management
- Responsive Design: Mobile-first approach with Tailwind CSS
- JWT Authentication: Secure user authentication and authorization
- Shopping Cart: Full cart functionality with persistent storage
- Order Management: Complete order tracking and management system
- Email Notifications: Automated order confirmations and updates
- PDF Receipts: Automatic receipt generation and download
- Product Management: CRUD operations for products and categories
- React 18: Component-based UI library
- TypeScript: Type-safe JavaScript development
- Tailwind CSS: Utility-first CSS framework
- React Router: Client-side routing
- Framer Motion: Smooth animations and transitions
- Recharts: Data visualization and analytics
- React Icons: SVG icon library
- Axios: HTTP client for API requests
- Node.js: JavaScript runtime environment
- Express.js: Web application framework
- MongoDB: NoSQL database with Mongoose ODM
- JSON Web Tokens (JWT): Authentication mechanism
- Stripe: Payment processing (additional payment option)
- Nodemailer: Email service integration
- Multer: File upload handling
- Puppeteer: PDF generation for receipts
- TypeScript: Static type checking
- ESLint: Code linting
- Concurrently: Running multiple npm scripts
- Nodemon: Development server with auto-restart
Before you begin, ensure you have the following installed:
- Node.js (v16.x or higher)
- npm or yarn package manager
- MongoDB (local instance or MongoDB Atlas account)
- Git for version control
git clone https://github.com/devasol/E-Commerce__C-2-C.git
cd E-Commerce__C-2-C# Install root dependencies
npm install
# Install backend dependencies
cd backend
npm install
cd ..
# Install frontend dependencies
cd frontend
npm install
cd ..Create .env files in both the backend and frontend directories:
Backend (.env in backend directory):
NODE_ENV=development
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JWT_EXPIRE=30d
SMTP_HOST=your_smtp_host
SMTP_PORT=your_smtp_port
SMTP_EMAIL=your_smtp_email
SMTP_PASSWORD=your_smtp_password
TELEBIRR_APP_ID=your_telebirr_app_id
TELEBIRR_APP_SECRET=your_telebirr_app_secret
TELEBIRR_CALLBACK_URL=your_telebirr_callback_url
STRIPE_API_KEY=your_stripe_api_key
FRONTEND_URL=http://localhost:3001Frontend (.env in frontend directory):
REACT_APP_API_URL=http://localhost:5000
REACT_APP_STRIPE_PUBLIC_KEY=your_stripe_public_keyOption 1: Run both servers simultaneously (Recommended)
npm run devOption 2: Run servers separately
In one terminal (Backend):
cd backend
npm run devIn another terminal (Frontend):
cd frontend
npm run startThe application will be available at http://localhost:3001
E-Commerce__C-2-C/
βββ backend/ # Express.js server
β βββ config/ # Database and configuration
β βββ controllers/ # Request handlers
β βββ middleware/ # Authentication and validation
β βββ models/ # Mongoose schemas
β βββ routes/ # API route definitions
β βββ utils/ # Utility functions
β βββ server.js # Server entry point
βββ frontend/ # React application
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Application pages
β β βββ context/ # React context providers
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API service functions
β β βββ utils/ # Utility functions
β β βββ App.tsx # Main application component
βββ .env.example # Environment variables template
βββ package.json # Root package configuration
This platform features an advanced payment system with TeleBirr integration for Ethiopian mobile payments:
- TeleBirr: Primary payment method for Ethiopian users
- Stripe: Additional payment gateway (coming soon)
- User adds products to cart
- Proceeds to checkout with shipping information
- Selects payment method (TeleBirr)
- Payment is processed immediately
- Order is created and marked as paid
- Email confirmation and PDF receipt are sent automatically
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Modern UI: Clean, intuitive interface with smooth animations
- Admin Dashboard: Comprehensive analytics and management tools
- Product Catalog: Filterable and searchable product listings
- Shopping Experience: Intuitive cart and checkout process
- JWT-based Authentication: Secure token-based system
- Role-based Access: Different permissions for users and admins
- Protected Routes: Secure access to sensitive areas
- Password Encryption: Bcrypt for secure password storage
The admin dashboard provides comprehensive control over the platform:
- Analytics: Sales, revenue, and user metrics
- Product Management: Add, edit, and remove products
- Order Management: Track and update order statuses
- User Management: View and manage user accounts
- Category Management: Organize products by categories
Automated email system for:
- Order confirmations
- Payment confirmations
- Shipping updates
- Promotional emails
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Get current user
GET /api/products- Get all productsGET /api/products/:id- Get specific productPOST /api/products- Create new product (admin only)PUT /api/products/:id- Update product (admin only)DELETE /api/products/:id- Delete product (admin only)
GET /api/cart- Get user's cartPOST /api/cart- Add to cartPUT /api/cart- Update cart itemDELETE /api/cart/item/:productId- Remove itemDELETE /api/cart- Clear cart
POST /api/orders- Create orderGET /api/orders/myorders- Get user's ordersGET /api/orders/:id- Get specific orderPUT /api/orders/:id- Update order (admin only)
Run tests for the frontend:
cd frontend
npm test- Set up MongoDB Atlas or your preferred database
- Configure environment variables
- Deploy to platforms like Heroku, Railway, or AWS
- Build the production version:
npm run build - Deploy to platforms like Netlify, Vercel, or GitHub Pages
- Configure environment variables
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you encounter any issues, please open an issue in the GitHub repository.
This project is licensed under the ISC License - see the LICENSE file for details.
For support, please contact the project maintainers or open an issue in the repository.
- Thanks to the open-source community for the amazing libraries and tools
- Special thanks to TeleBirr for the payment integration
- Inspired by modern e-commerce best practices
Made by Dawit Solomon