Skip to content

amritbiswal/store-easy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

72 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘Ÿ Shoe Store - Full Stack E-Commerce Application

A modern, full-featured shoe store application with separate admin and customer interfaces built with React and JSON Server.

πŸ“‹ Table of Contents


✨ Features

πŸ‘€ Customer Features

  • βœ… Browse products by category
  • βœ… View detailed product information with images
  • βœ… Add products to favorites/wishlist
  • βœ… Shopping cart management
  • βœ… Secure checkout process
  • βœ… Order tracking with status updates
  • βœ… Write product reviews and ratings
  • βœ… Manage multiple shipping addresses
  • βœ… View order history
  • βœ… Real-time notifications
  • βœ… User profile management

πŸ” Admin Features

  • βœ… Complete product management (CRUD operations)
  • βœ… Inventory management by size and color
  • βœ… Stock level tracking with alerts
  • βœ… Order management (accept/reject/update status)
  • βœ… Customer management
  • βœ… Purchase orders to suppliers
  • βœ… Inventory log tracking
  • βœ… Low stock notifications
  • βœ… Dashboard with analytics
  • βœ… Warehouse management

πŸ›  Tech Stack

Frontend

  • React - UI Library
  • React Router DOM - Routing
  • Context API - State Management
  • Axios - HTTP Client
  • CSS Modules / Tailwind CSS - Styling

Backend

  • JSON Server - Mock REST API
  • JSON Server Auth - Authentication (optional)

πŸ“ Project Structure

shoe-store-app/
β”œβ”€β”€ public/
β”‚   └── index.html
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   └── images/
β”‚   β”‚
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminNavbar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminSidebar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ InventoryTable.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ OrderTable.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductForm.jsx
β”‚   β”‚   β”‚   └── StockOrderForm.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ customer/
β”‚   β”‚   β”‚   β”œβ”€β”€ CustomerNavbar.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductCard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ CartItem.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ReviewForm.jsx
β”‚   β”‚   β”‚   └── OrderCard.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   └── shared/
β”‚   β”‚       β”œβ”€β”€ Header.jsx
β”‚   β”‚       β”œβ”€β”€ Footer.jsx
β”‚   β”‚       β”œβ”€β”€ Loader.jsx
β”‚   β”‚       β”œβ”€β”€ Modal.jsx
β”‚   β”‚       └── Notification.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
β”‚   β”‚   β”œβ”€β”€ CartContext.jsx
β”‚   β”‚   └── NotificationContext.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useAuth.js
β”‚   β”‚   β”œβ”€β”€ useCart.js
β”‚   β”‚   └── useFetch.js
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductManagement.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ InventoryManagement.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ OrderManagement.jsx
β”‚   β”‚   β”‚   └── StockOrders.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ customer/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductList.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductDetail.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Cart.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Checkout.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Orders.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚   β”‚   β”‚   └── Favorites.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   └── Register.jsx
β”‚   β”‚   β”‚
β”‚   β”‚   └── shared/
β”‚   β”‚       β”œβ”€β”€ NotFound.jsx
β”‚   β”‚       └── Unauthorized.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ PrivateRoute.jsx
β”‚   β”‚   β”œβ”€β”€ AdminRoute.jsx
β”‚   β”‚   └── CustomerRoute.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”œβ”€β”€ authService.js
β”‚   β”‚   β”œβ”€β”€ productService.js
β”‚   β”‚   β”œβ”€β”€ orderService.js
β”‚   β”‚   β”œβ”€β”€ inventoryService.js
β”‚   β”‚   └── cartService.js
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ constants.js
β”‚   β”‚   β”œβ”€β”€ helpers.js
β”‚   β”‚   └── validators.js
β”‚   β”‚
β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   β”œβ”€β”€ global.css
β”‚   β”‚   β”œβ”€β”€ admin.css
β”‚   β”‚   └── customer.css
β”‚   β”‚
β”‚   β”œβ”€β”€ App.jsx
β”‚   └── index.js
β”‚
β”œβ”€β”€ json-server-backend/
β”‚   β”œβ”€β”€ db.json
β”‚   └── routes.json (optional)
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
└── README.md

πŸ“¦ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or higher)
  • npm or yarn
  • Git

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/yourusername/shoe-store-app.git
cd shoe-store-app

2. Install Frontend Dependencies

npm install
# or
yarn install

3. Install JSON Server

npm install -g json-server
# or install locally
npm install json-server --save-dev

4. Setup Backend

cd json-server-backend
# db.json should already be present with all the schema

🎯 Running the Application

Start JSON Server (Backend)

Open a terminal and run:

cd json-server-backend
json-server --watch db.json --port 3000

JSON Server will run on: http://localhost:3000

Start React App (Frontend)

Open another terminal and run:

npm start
# or
yarn start

React App will run on: http://localhost:3001

Access the Application

  • Customer Portal: http://localhost:3001
  • Admin Portal: http://localhost:3001/admin
  • API Server: http://localhost:3000

πŸ”‘ User Roles

Test Credentials

Admin Login

Email: admin@shoestore.com
Password: admin123

Customer Login

Email: john@example.com
Password: customer123

Email: jane@example.com
Password: customer123

πŸ“‘ API Endpoints

Products

  • GET /products - Get all products
  • GET /products/:id - Get single product
  • POST /products - Create product (Admin)
  • PUT /products/:id - Update product (Admin)
  • PATCH /products/:id - Partial update (Admin)
  • DELETE /products/:id - Delete product (Admin)

Categories

  • GET /categories - Get all categories

Authentication

  • GET /admins?email={email}&password={password} - Admin login
  • GET /customers?email={email}&password={password} - Customer login
  • POST /customers - Register new customer

Customer Operations

  • GET /customerFavorites?customerId={id} - Get favorites
  • POST /customerFavorites - Add to favorites
  • DELETE /customerFavorites/:id - Remove from favorites
  • GET /customerCart?customerId={id} - Get cart
  • POST /customerCart - Add to cart
  • PUT /customerCart/:id - Update cart
  • DELETE /customerCart/:id - Clear cart
  • GET /customerOrders?customerId={id} - Get customer orders
  • POST /customerOrders - Place order
  • GET /customerReviews?productId={id} - Get product reviews
  • POST /customerReviews - Add review
  • GET /customerNotifications?customerId={id} - Get notifications

Admin Operations

  • GET /adminInventory - Get all inventory
  • GET /adminInventory?productId={id} - Get product inventory
  • POST /adminInventory - Add inventory
  • PUT /adminInventory/:id - Update stock
  • GET /adminInventoryLog - Get inventory history
  • POST /adminInventoryLog - Log inventory change
  • GET /adminStockOrders - Get purchase orders
  • POST /adminStockOrders - Create purchase order
  • PUT /adminStockOrders/:id - Update PO status
  • GET /adminNotifications?adminId={id} - Get admin notifications
  • GET /customerOrders - Get all orders (Admin view)
  • PUT /customerOrders/:id - Update order status

πŸ”„ Development Workflow

Phase 1: Setup & Basic Features (Week 1)

  1. βœ… Setup React app and JSON Server
  2. βœ… Create folder structure
  3. βœ… Setup routing with React Router
  4. βœ… Implement authentication (login/register)
  5. βœ… Create AuthContext
  6. βœ… Build basic layout components

Phase 2: Customer Features (Week 2)

  1. βœ… Product listing page with filters
  2. βœ… Product detail page
  3. βœ… Shopping cart functionality
  4. βœ… Favorites/Wishlist
  5. βœ… Checkout process
  6. βœ… Order history

Phase 3: Admin Features (Week 3)

  1. βœ… Admin dashboard
  2. βœ… Product management (CRUD)
  3. βœ… Inventory management
  4. βœ… Order management
  5. βœ… Stock ordering system

Phase 4: Advanced Features (Week 4)

  1. βœ… Reviews and ratings
  2. βœ… Notifications system
  3. βœ… Search functionality
  4. βœ… Filters and sorting
  5. βœ… Responsive design
  6. βœ… Form validations

Phase 5: Polish & Deploy (Week 5)

  1. βœ… Error handling
  2. βœ… Loading states
  3. βœ… Toast notifications
  4. βœ… Performance optimization
  5. βœ… Testing
  6. βœ… Deployment

πŸ—„οΈ Database Schema

Main Collections

products

{
  "id": 1,
  "name": "Classic Running Shoes",
  "brand": "Nike",
  "price": 89.99,
  "sizes": [8, 9, 10, 11, 12],
  "colors": ["Black", "White"],
  "category": "Running",
  "images": ["url1", "url2"],
  "description": "...",
  "features": ["..."],
  "isActive": true,
  "averageRating": 4.5,
  "totalReviews": 120
}

customers

{
  "id": 1,
  "email": "john@example.com",
  "password": "customer123",
  "role": "customer",
  "firstName": "John",
  "lastName": "Doe",
  "addresses": [...]
}

adminInventory

{
  "id": 1,
  "productId": 1,
  "size": 10,
  "color": "Black",
  "stock": 50,
  "reorderLevel": 5,
  "status": "in_stock",
  "warehouse": "Warehouse A"
}

customerOrders

{
  "id": 1,
  "orderNumber": "ORD-2025-0001",
  "customerId": 1,
  "status": "pending",
  "items": [...],
  "total": 239.79,
  "shippingAddress": {...}
}

🎨 Styling Approach

Option 1: CSS Modules

import styles from './ProductCard.module.css';

<div className={styles.card}>...</div>

Option 2: Tailwind CSS

<div className="bg-white rounded-lg shadow-md p-4">...</div>

Option 3: Styled Components

import styled from 'styled-components';

const Card = styled.div`
  background: white;
  border-radius: 8px;
`;

πŸ”’ Security Considerations

  • Store JWT tokens securely
  • Validate all inputs on frontend and backend
  • Use HTTPS in production
  • Implement rate limiting
  • Sanitize user inputs
  • Use environment variables for sensitive data

πŸ“± Responsive Design

  • Mobile First Approach
  • Breakpoints:
    • Mobile: < 768px
    • Tablet: 768px - 1024px
    • Desktop: > 1024px

πŸ§ͺ Testing

# Run tests
npm test

# Run tests with coverage
npm test -- --coverage

πŸ“¦ Build for Production

# Create production build
npm run build

# The build folder will contain optimized files

πŸš€ Deployment

Deploy Frontend (Vercel/Netlify)

npm run build
# Deploy the build folder

Deploy Backend (Render/Railway)

# JSON Server can be deployed as Node.js app

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Your Name


πŸ™ Acknowledgments

  • React Documentation
  • JSON Server
  • Ironhack Bootcamp

πŸ“ž Support

For support, email support@shoestore.com or join our Slack channel.


πŸ› Known Issues

  • Issue 1
  • Issue 2

πŸ“ Changelog

Version 1.0.0 (2025-12-18)

  • Initial release
  • Basic customer and admin features
  • Product catalog with inventory management
  • Order processing system

Happy Coding! πŸš€

About

online store for shoes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •