A modern, full-stack e-commerce store built with React, TypeScript, FastAPI, and SQLAlchemy. Features a beautiful storefront, shopping cart, checkout flow, and comprehensive admin panel for product management.
- Product Browsing - Browse products with beautiful card layouts
- Product Details - Detailed product pages with image galleries
- Shopping Cart - Add/remove items, update quantities
- Checkout - Secure checkout flow with Stripe integration
- User Authentication - Sign up, login, and manage account
- Responsive Design - Mobile-first, works on all devices
- Product Management - Create, edit, delete products
- Inventory Tracking - Monitor stock levels and low-stock alerts
- Order Management - View and manage customer orders
- Image Management - Upload and manage product images
- Multi-variant Products - Support for sizes and colors
- FastAPI Backend - High-performance Python API
- React + TypeScript Frontend - Type-safe, modern UI
- SQLAlchemy ORM - Database abstraction layer
- JWT Authentication - Secure token-based auth
- RESTful API - Clean, documented API endpoints
- Stripe Integration - Ready for payments
(Add your screenshots here)
- React 18 - UI library
- TypeScript - Type safety
- Vite - Build tool & dev server
- Tailwind CSS - Utility-first styling
- Framer Motion - Animations
- React Router - Client-side routing
- Radix UI - Accessible components
- FastAPI - Modern Python web framework
- SQLAlchemy - SQL toolkit & ORM
- Pydantic - Data validation
- JWT - Authentication
- Uvicorn - ASGI server
- SQLite/PostgreSQL - Database
- Python 3.11+ (Python 3.14 not supported yet)
- Node.js 18+
- npm or yarn
git clone https://github.com/YOUR-USERNAME/balm-store.git
cd balm-storecp .env.example .envEdit .env with your values:
VITE_API_URL=http://localhost:8000
VITE_STRIPE_PUBLIC_KEY=pk_test_your_key_here
ADMIN_USERNAME=admin
ADMIN_PASSWORD=your_secure_password
SECRET_KEY=your_secret_key_here
DATABASE_URL=sqlite:///./store.dbcd backend
# Create virtual environment
python3.11 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Initialize database
python scripts/init_db.pycd frontend
# Install dependencies
npm installTerminal 1 - Backend:
cd backend
source venv/bin/activate
python -m uvicorn app.main:app --reloadTerminal 2 - Frontend:
cd frontend
npm run devSee STRIPE_QUICKSTART.md for a 5-minute setup guide.
Quick version:
- Get your Stripe test key from https://dashboard.stripe.com/test/apikeys
- Add
STRIPE_SECRET_KEYto Netlify environment variables - Redeploy
- Store: http://localhost:5173
- Admin Panel: http://localhost:8000/admin/store
- Username:
admin - Password:
admin123(change this!)
- Username:
- API Docs: http://localhost:8000/docs
balm-store/
βββ frontend/ # React frontend
β βββ src/
β β βββ store/ # Store pages & components
β β βββ components/ # Shared UI components
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # Utilities
β β βββ config/ # Configuration
β βββ public/ # Static assets
β βββ package.json
β
βββ backend/ # FastAPI backend
β βββ app/
β β βββ api/ # API routes
β β βββ models/ # Database models
β β βββ schemas/ # Pydantic schemas
β β βββ core/ # Config & security
β β βββ db/ # Database setup
β βββ scripts/ # Utility scripts
β βββ store_admin.html # Admin panel
β βββ requirements.txt
β
βββ .env # Environment variables (gitignored)
βββ .env.example # Environment template
βββ README.md
Access the admin panel at http://localhost:8000/admin/store
- Products Tab - Add, edit, delete products
- Inventory Tab - View inventory logs
- Orders Tab - Manage customer orders
- Add product with ID, title, description
- Set prices and SKUs
- Upload images
- Configure sizes and colors
- Set stock quantities
- Control visibility
Interactive API documentation available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Products
GET /api/products- List all productsGET /api/products/{id}- Get product detailsPOST /api/products- Create product (admin)PUT /api/products/{id}- Update product (admin)DELETE /api/products/{id}- Delete product (admin)
Orders
GET /api/orders- List orders (admin)POST /api/orders- Create orderGET /api/orders/{id}- Get order details
Inventory
GET /api/inventory/logs- View inventory logs (admin)POST /api/inventory/adjust- Adjust inventory (admin)
- Build the frontend:
cd frontend
npm run build- Deploy to Netlify:
# Install Netlify CLI
npm install -g netlify-cli
# Deploy
netlify deploy --prodOr connect your GitHub repo to Netlify for automatic deployments.
- Create a
railway.jsonin the backend directory:
{
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "uvicorn app.main:app --host 0.0.0.0 --port $PORT",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}- Deploy to Railway:
railway login
railway init
railway up- Use PostgreSQL instead of SQLite
- Set strong
SECRET_KEYandADMIN_PASSWORD - Configure production CORS origins
- Use production Stripe keys
- Set up SSL/HTTPS
- Configure environment variables on hosting platform
- Enable database backups
- Set up monitoring and logging
- JWT-based authentication
- Password hashing with bcrypt
- CORS protection
- SQL injection protection via SQLAlchemy
- Environment-based configuration
- Admin-only routes protected
# Backend tests (if implemented)
cd backend
pytest
# Frontend tests (if implemented)
cd frontend
npm testDetailed guides and references for the BALM Store.
- Installation & Setup - Get up and running in minutes.
- CLI & Automation - Master hub for all CLI tools and scripts.
- Architecture Guide - Technical overview and structural details.
- Stripe Guide - Quickstart for "Buy Now" and Cart Checkout.
- General Deployment - Guides for Netlify, Railway, and Render.
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.
- Check Python version (must be 3.11 or 3.12, not 3.14)
- Ensure virtual environment is activated
- Try:
pip install --upgrade -r requirements.txt
- Check that backend is running on port 8000
- Verify
VITE_API_URLin.env - Check CORS settings in
backend/app/core/config.py
- Delete database:
rm backend/store.db - Reinitialize:
python backend/scripts/init_db.py
- Make sure you're in the correct directory
- Virtual environment activated for backend
- All dependencies installed
For issues and questions:
- Open an issue on GitHub
- Check existing documentation
- Review API docs at
/docs
- Add product reviews and ratings
- Implement order tracking
- Add email notifications
- Support for product categories
- Wishlist functionality
- Advanced search and filtering
- Analytics dashboard
- Multi-currency support
- Shipping calculator
- Built with β€οΈ for BALM merchandise
- Powered by FastAPI and React
- Icons from Lucide React
- UI components from Radix UI
Made with π¨ by [Your Name]