Developer setup
How to be ready to expand the template to build your unique SaaS.
Environment Variables
All configuration is managed via environment variables. Copy .env.example to .env and configure:
Database
POSTGRES_SERVER=localhost
POSTGRES_PORT=5432
POSTGRES_DB=app
POSTGRES_USER=postgres
POSTGRES_PASSWORD=changethisAuthentication
JWT_SECRET_KEY=your-secret-key-here
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_DAYS=30Email Service
EMAIL_SERVICE=fake # or "resend"
RESEND_API_KEY= # Required if EMAIL_SERVICE=resendStripe
Initial Data
Error Tracking (Optional)
Email Configuration
The application supports two email providers:
Fake Email Service (Development):
Set
EMAIL_SERVICE=fakeEmails are logged to console
No external service required
Resend (Production):
Set
EMAIL_SERVICE=resendSet
RESEND_API_KEY=re_...Transactional email delivery
Stripe Configuration
Create Products and Prices
For each subscription plan (Basic, Pro, Enterprise), create two prices in Stripe:
Monthly Price:
Go to Products → Create Product
Set product name (e.g., "Basic Plan")
Create a recurring price with "Monthly" billing
Note the Price ID (e.g.,
price_1234monthly)
Annual Price:
In the same product, click "Add another price"
Create a recurring price with "Yearly" billing
Set price (typically 10 months worth for 20% discount)
Note the Price ID (e.g.,
price_1234annual)
Repeat for all plans.
Configure Webhook Endpoint
Set up webhooks in Stripe Dashboard (Developers → Webhooks):
URL:
https://yourdomain.com/payments/webhooks/stripeEvents to listen for:
customer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
Copy the webhook signing secret to
STRIPE_WEBHOOK_SECRET
Billing Interval Options
Users can choose between monthly and annual billing:
Monthly: Charged every month at the monthly rate
Annual: Charged once per year, displayed as monthly equivalent
Example: $96/year shown as "$8/month (billed $96 annually)"
Users select their preferred interval before subscribing
Development Workflow
Initial Setup
Daily Development
Database Operations
Testing
Code Quality
The project uses:
mypy - Static type checking (strict mode)
ruff - Fast Python linter and formatter
pre-commit - Git hooks for automatic checks
Frontend Development
Docker Commands
Last updated
