A full-stack e-commerce platform built with React, Node.js, Express, and PostgreSQL. Features product management, shopping cart, secure checkout with Stripe, and order tracking.
- 🛍️ Product browsing and search
- 🛒 Shopping cart management
- 💳 Secure payments via Stripe
- 📦 Order tracking
- 👤 User authentication
- 📍 Multiple delivery addresses
- 🔐 Seller dashboard
- 📱 Responsive design
- React with Vite
- Redux Toolkit for state management
- React Query for data fetching
- Tailwind CSS for styling
- Stripe Elements for payments
- Node.js
- Express
- PostgreSQL
- JWT authentication
- Stripe API integration
- Node.js v16+
- PostgreSQL 14+
- npm or yarn
- Stripe account
- Clone the repository:
git clone https://github.com/hadikhanhk786/ecom-app.git
cd ecom-app- Install dependencies:
# Install frontend dependencies
cd frontend
npm install
# Install backend dependencies
cd ../backend
npm install- Set up environment variables:
Frontend (.env):
VITE_API_URL=http://localhost:4000/api
VITE_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_keyBackend (.env):
PORT=4000
DATABASE_URL=postgresql://username:password@localhost:5432/ecom_db
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_secret_key- Initialize database:
psql -d ecom_db -f backend/models.sql- Start the development servers:
# Start backend server
cd backend
npm run dev
# Start frontend development server
cd frontend
npm run devecom-app/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── features/
│ │ ├── api/
│ │ └── App.jsx
│ └── package.json
├── backend/
│ ├── routes/
│ ├── models/
│ ├── middleware/
│ └── server.js
└── README.md
GET /api/products- Get all productsGET /api/products/:id- Get single productPOST /api/products- Create product (seller only)PUT /api/products/:id- Update product (seller only)
POST /api/buyers/register- Register new buyerPOST /api/buyers/login- Login buyerPOST /api/sellers/register- Register new sellerPOST /api/sellers/login- Login seller
POST /api/orders- Create orderGET /api/orders- Get user ordersGET /api/orders/:id- Get order details
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with React
- Styled with Tailwind CSS
- Payment processing by Stripe