A modern, full-stack e-commerce platform for selling premium ergonomic split keyboards. Built with React, Express.js, MongoDB, and Stripe integration.
This is a production-ready e-commerce platform designed specifically for selling ergonomic split keyboards. The platform emphasizes user experience, modern design, and comprehensive functionality for both customers and administrators.
- ποΈ Full E-Commerce Functionality: Browse products, add to cart, and complete purchases
- π User Authentication: Secure JWT-based authentication with bcrypt password hashing
- π³ Payment Integration: Ready for Stripe payment processing
- π¦ Order Management: Complete order tracking from placement to delivery
- β Product Reviews: Customer review system with verified purchases
- π€ User Profiles: Manage personal information and view order history
- π¨ Modern UI: Beautiful, responsive design with Tailwind CSS and Framer Motion
- π± Mobile-First: Fully responsive across all devices
- π§ Admin Dashboard: Comprehensive tools for managing products and orders
- React 18 - UI library
- Vite - Build tool and dev server
- React Router v6 - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Zustand - Lightweight state management
- React Hook Form - Form validation
- Zod - Schema validation
- Framer Motion - Animations
- Axios - HTTP client
- React Hot Toast - Notifications
- React Icons - Icon library
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- bcryptjs - Password hashing
- Stripe - Payment processing
- Helmet - Security middleware
- Express Rate Limit - API rate limiting
- Morgan - HTTP request logger
- Cors - Cross-origin resource sharing
smart-reader/
βββ client/ # Frontend React application
β βββ public/
β βββ src/
β β βββ components/
β β β βββ layout/ # Header, Footer
β β β βββ product/ # ProductCard
β β β βββ cart/ # Cart components
β β β βββ common/ # Reusable components
β β βββ pages/
β β β βββ Home.jsx
β β β βββ Products.jsx
β β β βββ ProductDetail.jsx
β β β βββ Cart.jsx
β β β βββ Checkout.jsx
β β β βββ Login.jsx
β β β βββ Register.jsx
β β β βββ Profile.jsx
β β β βββ OrderHistory.jsx
β β β βββ OrderDetail.jsx
β β β βββ admin/ # Admin pages
β β βββ store/ # Zustand state management
β β βββ services/ # API service layer
β β βββ utils/ # Utility functions
β β βββ App.jsx
β βββ package.json
β βββ vite.config.js
β βββ tailwind.config.js
β
βββ server/ # Backend Express application
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ models/ # Mongoose models
β β βββ routes/ # API routes
β β βββ middleware/ # Custom middleware
β β βββ config/ # Configuration files
β β βββ utils/ # Utility functions
β β βββ server.js # Server entry point
β βββ package.json
β
βββ README.md
- Node.js (v16 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd smart-reader
-
Install server dependencies
cd server npm install -
Install client dependencies
cd ../client npm install -
Set up environment variables
Create a
.envfile in theserverdirectory:PORT=5000 NODE_ENV=development MONGODB_URI=mongodb://localhost:27017/split-keyboard-shop JWT_SECRET=your_jwt_secret_key_change_this_in_production JWT_EXPIRE=30d STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key CLIENT_URL=http://localhost:5173
Create a
.envfile in theclientdirectory:VITE_API_URL=http://localhost:5000/api VITE_STRIPE_PUBLIC_KEY=pk_test_your_stripe_public_key
-
Seed the database (optional)
cd server npm run seed -
Start the development servers
Terminal 1 (Backend):
cd server npm run devTerminal 2 (Frontend):
cd client npm run dev -
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
After seeding the database, you can use these demo accounts:
Customer Account:
- Email: john@example.com
- Password: password123
Admin Account:
- Email: admin@splitkeyboard.com
- Password: admin123
- β Browse products with filtering and sorting
- β View detailed product information with images and specifications
- β Add products to cart with quantity selection
- β Complete checkout with shipping information
- β User registration and authentication
- β Profile management
- β Order history and tracking
- β Product reviews and ratings
- β Admin dashboard with statistics
- β Product management (CRUD operations)
- β Order management and status updates
- β View customer information
- β Sales analytics (basic)
- β JWT-based authentication
- β Protected routes (client and server)
- β Password hashing with bcrypt
- β Input validation (client and server)
- β Error handling and user feedback
- β Responsive design for all screen sizes
- β Loading states and spinners
- β Toast notifications
- β Cart persistence in local storage
- β Rate limiting on API endpoints
- β Security headers with Helmet
- β CORS configuration
- JWT token authentication
- Password hashing with bcrypt (10 rounds)
- Protected API routes
- Input validation on both client and server
- Rate limiting to prevent abuse
- Security headers with Helmet
- CORS configuration
- Environment variable protection
- firstName, lastName, email, password (hashed)
- role (customer/admin)
- addresses array
- timestamps
- name, slug, description, price, compareAtPrice
- images array
- category, stock, variants
- specifications (object)
- features array
- rating (average, count)
- timestamps
- orderNumber (auto-generated)
- user reference
- items array with product details
- shippingAddress (object)
- paymentMethod, paymentResult
- subtotal, shippingCost, tax, total
- status (pending, processing, shipped, delivered, cancelled)
- timestamps
- user reference (optional)
- sessionId (for guest users)
- items array
- timestamps
- product and user references
- rating (1-5), title, comment
- verified (boolean)
- timestamps
- Clean & Modern: Minimalist design with clear visual hierarchy
- Product-First: Large, high-quality images and detailed information
- Trust Signals: Reviews, ratings, and security badges
- Mobile-First: Responsive design optimized for all devices
- Performance: Optimized images, code splitting, and fast loading
- Create a new project on Railway or Render
- Connect your GitHub repository
- Set environment variables
- Deploy
- Install Vercel CLI:
npm i -g vercel - Navigate to client directory:
cd client - Run:
vercel - Follow the prompts
- Create a free cluster on MongoDB Atlas
- Update
MONGODB_URIin your environment variables - Whitelist your deployment IP addresses
# Run tests (when implemented)
npm test
# Run linting
npm run lint- Stripe payment integration (currently demo mode)
- Email notifications for orders
- Advanced search with filters
- Wishlist functionality
- Product comparison tool
- Blog/Resources section
- Newsletter subscription
- Inventory management improvements
- Advanced analytics dashboard
- Multi-language support
- Product recommendations
- Social media integration
Contributions are welcome! Please feel free to submit a Pull Request.
- 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 β€οΈ for ergonomic typing enthusiasts
- Product images from Unsplash
- Icons from React Icons
- UI inspiration from Lofree and NuPhy
- Community feedback and support
For support, email support@splitkeyboard.com or open an issue in the GitHub repository.
Happy Coding! πβ¨οΈ
Transform the typing experience, one split keyboard at a time.