Simba 2.0 is a modernized, high-performance E-commerce platform designed with a focus on modularity, security, and a premium user experience. Built with a robust FastAPI backend and a sleek React (Vite) frontend, it offers a seamless shopping journey from product discovery to secure checkout.
- Modular Profile System: A clean, tab-based user dashboard for managing Personal Info, Order History, Wishlist, Addresses, and Payment Methods.
- Hardened Checkout Flow: A multi-step transaction process with real-time validation and error handling.
- Standardized API: Tagged and documented FastAPI endpoints for predictable service interaction.
- Full Auth Lifecycle: Secure Registration, Login, and a robust Password Reset system.
- Email Verification: Built-in logic for account verification with a local "Development Mailbox" for instant link access.
- Type-Safe Hydration: Real-time user profile synchronization to ensure consistent UI state.
- Dynamic Product Catalog: 789+ seeded items with multi-word search and category filtering.
- Intelligent Notifications: Real-time alerts for price drops on wishlist items and restock notifications.
- Glassmorphic UI: Ultra-modern design using Tailwind CSS and Framer Motion for smooth, premium interactions.
- Core: Python (FastAPI)
- Database: SQLAlchemy (SQLite)
- Security: JWT-based Authentication, Argon2 Hashing
- Validation: Pydantic Models
- Framework: React 18 (Vite)
- Styling: Tailwind CSS, Shadcn/UI
- Animations: Framer Motion
- State Management: TanStack Query (React Query), React Context API
git clone git@github.com:mug1sha/Simba-2.0.git
cd "Simba 2.0"cd backend
python -m venv venv
source venv/bin/activate # Or venv\Scripts\activate on Windows
pip install -r requirements.txt
uvicorn app.main:app --reloadThe backend will be available at http://localhost:8000
cd frontend
npm install
npm run devThe frontend will start at http://localhost:8080 (or available port)
Create backend/.env from backend/.env.example and set production values:
APP_ENV=production
SECRET_KEY=<strong-random-secret>
DATABASE_URL=<production-database-url>
FRONTEND_URL=https://your-frontend-domain.example
CORS_ORIGINS=https://your-frontend-domain.example
GOOGLE_CLIENT_ID=<google-oauth-web-client-id>
SMTP_HOST=<smtp-host>
SMTP_PORT=587
SMTP_USER=<smtp-user>
SMTP_PASSWORD=<smtp-password>
EMAIL_FROM=no-reply@your-domain.exampleFRONTEND_URL is always added to the allowed CORS origins. Use CORS_ORIGINS for any extra origins that should also be able to call the API.
Email behavior:
- Development: if SMTP variables are not set, verification and reset messages are written to
backend/dev_mailbox.log. The API also returns a localdev_linkso the UI can show an "Open local email link" button. - Production: set SMTP variables and verify your sending domain with your email provider. The backend will send verification and reset messages through SMTP and will not expose
dev_link. - Useful free SMTP/API providers: Brevo has a free plan with 300 email sends/day, Resend has a free plan with 3,000 emails/month and 100/day, and SendGrid advertises a free trial with 100 emails/day for 60 days.
Local mailbox endpoint:
curl http://127.0.0.1:8000/api/dev/mailboxThat endpoint is disabled when APP_ENV=production.
For production serving:
cd backend
gunicorn -w 1 app.main:app -k uvicorn.workers.UvicornWorkerIf DATABASE_URL is SQLite, keep Gunicorn on a single worker. SQLite is not a good fit for multi-process write traffic, so -w 4 can produce database is locked failures. Use Postgres before scaling worker count up.
Set the API URL before building:
cd frontend
VITE_API_BASE_URL=https://your-backend-domain.example/api \
VITE_GOOGLE_CLIENT_ID=<google-oauth-web-client-id> \
npm run build- In Google Cloud Console, create or open a project.
- Configure the OAuth consent screen.
- Create a Web application OAuth client.
- Add authorized JavaScript origins for your frontend, for example
http://127.0.0.1:8080during local development. - Use the generated client ID for both
GOOGLE_CLIENT_IDin the backend andVITE_GOOGLE_CLIENT_IDin the frontend.
Google auth is wired for customer accounts. Branch manager and branch staff access remain invite-based.
Deploy frontend/dist to your static hosting provider.
During local development, verification and reset emails are mocked to prevent spam and allow for instant testing.
- Terminal: Check the backend console output.
- Log File: Open
backend/dev_mailbox.logto find and click your latest links.
├── backend/
│ ├── app/
│ │ ├── auth.py # Security logic
│ │ ├── crud.py # Database interactions
│ │ ├── main.py # API Endpoints
│ │ ├── models.py # SQLAlchemy Tables
│ │ └── schemas.py # Pydantic Types
│ └── dev_mailbox.log # Local email log
├── frontend/
│ ├── src/
│ │ ├── components/ # UI Modules
│ │ ├── contexts/ # App State
│ │ ├── lib/ # API Helpers
│ │ └── pages/ # View Layouts
└── README.md
This project is part of the Simba Modernization Audit. All rights reserved.