A modern, scalable full-stack e-commerce platform built with React, TypeScript, Node.js, Express, PostgreSQL, and Stripe integration.
- Modern React 18 with TypeScript
- Vite for fast development and optimized builds
- Tailwind CSS for responsive design
- JWT-based authentication
- Shopping cart with persistent storage
- Product browsing and filtering
- Stripe payment integration
- User dashboard
- Admin panel for product management
- Node.js with Express and TypeScript
- PostgreSQL with Prisma ORM
- JWT authentication with refresh tokens
- Role-based access control (User/Admin)
- RESTful API design
- Input validation with Zod
- Error handling and logging
- Stripe API integration
- AWS S3 integration for product images
- Node.js 18+
- PostgreSQL 14+
- npm or yarn
- Docker & Docker Compose (optional)
- Stripe account (for payments)
- AWS account (for S3 storage)
git clone <repository-url>
cd ecommerce-platformcd backend
# Copy environment variables
cp .env.example .env
# Install dependencies
npm install
# Setup database
npm run db:migrate
npm run db:seed
# Start development server
npm run devThe backend will run on http://localhost:5000
cd frontend
# Copy environment variables
cp .env.example .env.local
# Install dependencies
npm install
# Start development server
npm run devThe frontend will run on http://localhost:5173
# Start all services
docker-compose up
# Run migrations
docker-compose exec backend npm run db:migrate
# Seed database
docker-compose exec backend npm run db:seedPOST /api/auth/register Register a new user
{
"name": "John Doe",
"email": "john@example.com",
"password": "SecurePassword123"
}POST /api/auth/login Login user
{
"email": "john@example.com",
"password": "SecurePassword123"
}GET /api/products Get all products (with optional filters)
GET /api/products/:id Get single product details
POST /api/products (Admin only) Create new product
{
"name": "Product Name",
"description": "Product description",
"price": 99.99,
"stock": 100,
"category": "Electronics"
}DATABASE_URL=postgresql://user:password@localhost:5432/ecommerce
JWT_SECRET=your-secret-key
STRIPE_SECRET_KEY=sk_test_...
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_S3_BUCKET=your-bucket
NODE_ENV=development
PORT=5000
VITE_API_URL=http://localhost:5000/api
VITE_STRIPE_PUBLIC_KEY=pk_test_...
ecommerce-platform/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── hooks/
│ │ ├── contexts/
│ │ ├── utils/
│ │ ├── types/
│ │ ├── styles/
│ │ └── App.tsx
│ └── package.json
├── backend/
│ ├── src/
│ │ ├── controllers/
│ │ ├── middleware/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── services/
│ │ ├── utils/
│ │ ├── config.ts
│ │ └── app.ts
│ ├── prisma/
│ └── package.json
└── docker-compose.yml
cd frontend
npm run test
npm run test:uicd backend
npm run test# Build images
docker build -t ecommerce-backend ./backend
docker build -t ecommerce-frontend ./frontend
# Run with Docker Compose
docker-compose up -dThe project includes Docker configuration for AWS Elastic Beanstalk deployment. See deployment documentation for setup instructions.
# Frontend
cd frontend
npm run type-check
npm run lint
# Backend
cd backend
npm run type-check
npm run lint# Create migration
cd backend
npm run db:migrate
# View database in studio
npm run db:studio
# Seed database
npm run db:seedAll API responses follow this format:
{
"success": true,
"data": { /* response data */ },
"message": "Operation successful"
}Error responses:
{
"success": false,
"error": "Error message"
}- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
For issues and questions:
- Open an issue on GitHub
- Check existing documentation
- Contact the development team
- Advanced product filtering
- Real-time notifications
- Product recommendations
- Email notifications
- PDF invoices
- Multi-language support
- PWA capabilities
- GraphQL API
- Advanced analytics
- Inventory management system
Last Updated: January 2024