A modern e-commerce application built for a local discount store in Kigali, Rwanda. Features a complete shopping experience with product browsing, cart management, order processing, and admin dashboard.
- Product Catalog: Browse products by categories (Electronics, Clothing, Home & Garden, Sports, Books)
- Set-Based Pricing: Products sold in sets with automatic quantity calculations
- Shopping Cart: Add, remove, and update quantities with real-time total calculations
- Currency Display: Prices displayed in Rwandan Francs (RWF) with automatic USD conversion
- Order Tracking: Track order status from pending to delivered
- Wishlist: Save favorite products for later
- Recently Viewed: Keep track of browsed products
- Search: Find products quickly with search functionality
- Newsletter: Subscribe to updates and promotions
- Order Management: View and update order statuses
- Newsletter Management: View subscriber list and analytics
- Inventory Tracking: Monitor stock levels and product information
- Status Updates: Change orders from pending β processing β shipped β delivered
- Pickup Only: Items must be collected at the physical store location
- Location: Kigali, Rwanda
- Payment: Cash on pickup
- Tax Rate: 18% (Rwanda standard rate)
- React 18 with TypeScript
- Wouter for client-side routing
- TanStack Query for server state management
- Tailwind CSS + shadcn/ui for styling
- React Context for cart, wishlist, and recently viewed state
- Vite for build tooling
- Node.js with Express.js
- TypeScript with ES modules
- PostgreSQL with Drizzle ORM
- Neon serverless database
- RESTful API design
- Categories, Products, Cart Items, Orders, Order Items, Newsletter subscriptions
- Full relational design with proper foreign key constraints
- Optimized for e-commerce operations
- Node.js 18+
- PostgreSQL database (or Neon account)
- npm or yarn
-
Clone the repository
git clone https://github.com/casmonster/LocalDiscountMart.git cd LocalDiscountMart -
Install dependencies
npm install
-
Set up environment variables
# Create .env file DATABASE_URL=your_postgresql_connection_string -
Push database schema
npm run db:push
-
Start development server
npm run dev
-
Open browser
http://localhost:5000
- Browse products by category or use search
- Click on products to view details
- Add items to cart (note: sold in sets)
- Proceed to checkout and enter contact information
- Complete order (pickup required at store)
- Track order status using provided order number
- Navigate to
/admin/orders/manage - View all orders and their current status
- Update order statuses as items are processed
- View newsletter subscribers in the second tab
- Monitor inventory and customer activity
discountmart/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ context/ # React Context providers
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utility functions
βββ server/ # Express backend
β βββ db.ts # Database connection
β βββ storage.ts # Data access layer
β βββ routes.ts # API endpoints
β βββ index.ts # Server entry point
βββ shared/ # Shared types and schemas
β βββ schema.ts # Drizzle database schema
βββ package.json
GET /api/categories- List all categoriesGET /api/products- List all productsGET /api/products/featured- Featured productsGET /api/cart/:cartId- Get cart itemsPOST /api/cart- Add item to cartPOST /api/orders- Create new orderGET /api/admin/orders- Admin: List all ordersPATCH /api/orders/:id/status- Admin: Update order status
- Primary: Blue (#3B82F6)
- Secondary: Gray (#6B7280)
- Success: Green (#10B981)
- Error: Red (#EF4444)
- Warning: Yellow (#F59E0B)
- All prices displayed in Rwandan Francs (RWF)
- Automatic conversion from USD base prices
- Exchange rate: 1 USD = 1,200 RWF (approximate)
- Tax rate: 18% added at checkout
DATABASE_URL=postgresql://user:pass@host:port/db
PGDATABASE=database_name
PGHOST=localhost
PGPASSWORD=password
PGPORT=5432
PGUSER=usernameThe application uses Drizzle ORM with PostgreSQL. Schema is defined in shared/schema.ts and migrations are handled automatically with npm run db:push.
- Lazy Loading: Components loaded on demand
- Query Caching: TanStack Query caches API responses
- Image Optimization: Responsive images with proper sizing
- Database Indexing: Optimized queries with proper indexes
- Connection Pooling: Efficient database connection management
- Input Validation: Zod schemas validate all inputs
- SQL Injection Protection: Parameterized queries via Drizzle ORM
- Error Handling: Comprehensive error boundaries and API error handling
- Data Sanitization: All user inputs properly sanitized
npm run build
npm run start# Build container
docker build -t discountmart .
# Run container
docker run -p 5000:5000 -e DATABASE_URL=your_db_url discountmart- Connect GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on git push
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email admin@discountmart.rw or visit our store in Kigali, Rwanda.
- Built with modern web technologies
- Designed for the Rwanda market
- Supports local business growth
- Community-driven development
Made with β€οΈ for local businesses in Rwanda