- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: TailwindCSS + Shadcn UI
- Authentication: Clerk (Client-side & Middleware)
- Data Fetching: Native fetch with concurrent
Promise.alloptimizations
- Framework: FastAPI (Python 3.12+)
- Database ORM: SQLAlchemy 2.0 (Async)
- Migrations: Alembic (Async template)
- Authentication: Hybrid Clerk JWT + Custom JWT fallback
- Payments: Stripe (Checkout + Webhooks)
- Emails: Resend
- Error Monitoring: Sentry
- Deployment: Vercel (Frontend) + Railway/Any Cloud (Backend)
- Containerization: Docker & Docker Compose
- CI/CD: GitHub Actions with Black/isort formatting checks
- Live Analytics: Real-time growth trends visualized with Recharts.
- Interactive Stats: Dynamic calculation of user growth, subscriptions, and system health.
- Activity Timeline: A beautiful, real-time audit log of system and user events.
- Quick Actions: One-click access to billing, team settings, and API docs.
- Clerk Integration: Seamless sign-in/up with automatic identity syncing to local PostgreSQL.
- Hybrid Bridge: Backend verifies Clerk RS256 tokens using live JWKS fetching.
- Strict Authorization: Granular role-based access control (Owner, Admin, Member).
- Stripe Integration: Pre-built checkout sessions and billing portal.
- π οΈ Dev Mode Bypass: Test PRO features instantly without a Stripe account. Simulate checkouts with a single click.
- Webhook Engine: Automated tier updates (
FREE,BASIC,PRO) via secure Stripe events.
- Database-Backed Teams: Create teams, invite members, and manage roles permanently.
- Auto-Provisioning: Automatic team creation for new users on their first dashboard visit.
SAAS_project/
βββ frontend/ # Next.js 14 application
β βββ src/
β β βββ app/ # App Router (Dashboard, Auth, Landing)
β β βββ components/ # UI components (Shadcn + Recharts)
β β βββ lib/ # API Client & Utilities
β
βββ backend/ # FastAPI application
β βββ app/
β β βββ api/routes/ # Auth, Team, Dashboard, Subscriptions (with Dev Mode)
β β βββ core/ # Security (Clerk Bridge), Database, Config
β β βββ models/ # SQLAlchemy Async Models (User, Team, AuditLog)
β β βββ schemas/ # Pydantic V2 Type Safety
β β βββ services/ # Activity Logging, Email, Business Logic
β βββ migrations/ # Alembic Async Migration Scripts
β βββ tests/ # Pytest Suite
β βββ manage_user.py # (Local) CLI for manual user upgrades
β
βββ docker-compose.yml # Containerized Orchestration
βββ README.md # You are here
βββ ENVIRONMENT.md # Env var reference
- Node.js 18+ & Python 3.12+
- PostgreSQL instance (Local or Supabase)
cd backend
python -m venv venv
source venv/bin/activate # venv\Scripts\activate on Windows
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your PostgreSQL credentials
uvicorn app.main:app --reloadcd frontend
npm install
cp .env.example .env.local
# Add your Clerk API keys to .env.local
npm run devdocker-compose up -dIf you don't have a Stripe account or are restricted by region (e.g., India), you can use the built-in Dev Mode:
- Leave
STRIPE_SECRET_KEYempty or as the default inbackend/.env. - Click "Upgrade" on the dashboard.
- The backend will detect the missing key, simulate a successful payment, and upgrade your user to the PRO tier automatically.
- Fork the repo.
- Create a feature branch.
- Ensure formatting:
cd backend && isort . && black .. - Submit a PR.
Built with β€οΈ by LEVELING2108 "Empowering developers to ship faster, safer, and smarter."