A minimal Django project for booking appointments with Stripe payment integration.
- Async Django views for I/O-bound operations
- Stripe payment integration with idempotency support
- HTMX-powered frontend with DaisyUI styling
- YAML-based configuration using Dynaconf
- ASGI support for async operations
-
Install dependencies:
uv sync
-
Create a sofia_health/.secrets.yaml file with your Stripe API keys:
-
Create a copy of the template:
cp ./sofia_health/.secrets.yaml.template ./sofia_health/.secrets.yaml
-
Add your Stripe API keys (
⚠️ USE TEST KEYS⚠️ ): sofia_health/.secrets.yamlStripe Configuration
To test payments, you need to obtain test API keys from Stripe:
- Go to https://dashboard.stripe.com/test/apikeys
- Copy your publishable key (pk_test_...) and secret key (sk_test_...)
- Update
.secrets.yaml
with your keys.
When using real keys (prod, staging), remember to use secret vault services.
-
-
Run migrations:
uv run manage migrate
-
Run server:
uv run server --port 8000 --open-browser
-
Access the application:
Uses Dynaconf with YAML files:
settings.yaml
- Non-sensitive configuration.secrets.yaml
- Secrets (not committed to version control)
Environment-specific settings:
default
- Default settingsdevelopment
- Development environment settings
Static files are configured with Dynaconf and served with WhiteNoise:
STATIC_URL
- URL to serve static filesSTATIC_ROOT
- Directory where static files are collected for productionSTATICFILES_STORAGE
- Storage backend for static files
In development, static files are served automatically by Django with WhiteNoise.
In production, you should run collectstatic
and WhiteNoise will serve the collected static files.
For thousands of bookings/day:
- Find a state of art Django production ready solution for reference
- Production checklist
- Architecture.
- Why? People are doing the same things for years without searching before defining an architecture.
- Change Dabatase to a managed service on some cloud provider (eg. AWS RDS Aurora)
- Setup a monitoring service for KPI and alerting.
- Study the performance of the system and identify bottlenecks.
- Check how serve static files in production using Django.
- The more efficient way with zero or low cost.
- Use a task queue (eg. Celery, Rabbitmq, Kafka).
- Setup a cache service on Django (eg. Redi, Dragonfly) (only if strictly necessary).
Simple way: Open discussions on the project like we have in Github discussions. Link the Kanban board: - Link the table genearated by https://github.com/MrLesk/Backlog.md. - Or use Jira, AzureDevops. Explain discoveries, moves and blockers. Talk like humans on the conversation thread. Keep it asynchronous, and talk on Google Meet before releases.