Development Workflow¶
Day-to-day development practices for fastappkit projects.
Starting Development Server¶
Basic Command¶
IMPORTANT: Must be run from project root.
Options¶
--host <host>: Host to bind to (default:127.0.0.1)--port <port>: Port to bind to (default:8000)--reload: Enable auto-reload on code changes
Uvicorn Options Forwarding¶
All additional arguments are forwarded to uvicorn:
fastappkit core dev --workers 4
fastappkit core dev --log-level debug
fastappkit core dev --access-log
IMPORTANT: Server uses core project's DATABASE_URL from .env.
Development Cycle¶
Typical Workflow¶
-
Create/Modify Models
-
Create Migration
-
Apply Migration
-
Test Endpoints
-
Iterate
- Make changes
- Create migrations
- Test
- Repeat
Testing¶
Manual Testing with Development Server¶
- Visit
http://127.0.0.1:8000/docsfor Swagger UI - Visit
http://127.0.0.1:8000/redocfor ReDoc - Test endpoints with curl or httpx
Testing External Apps Independently¶
- Uses external app's
.envandDATABASE_URL - Test app in isolation before integrating
Integration Testing¶
After adding external app to core project:
- Uses core project's
DATABASE_URL - Test all apps together
Debugging¶
Using --debug Flag¶
Shows: - Stack traces - Detailed error messages - Full exception information
Logging Configuration¶
Configure logging in core/app.py:
import logging
logging.basicConfig(
level=logging.DEBUG if settings.debug else logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
Common Issues¶
App Not Loading¶
Error: AppLoadError: Failed to load app
Solution: Run validation:
Route Collisions¶
Warning: Route collision detected
Solution: Check route_prefix in manifests:
Import Errors¶
Error: ModuleNotFoundError
Solution:
- Check __init__.py files exist
- Verify dependencies are installed
- Check Python path includes project root
Settings Not Loaded¶
Error: Runtime errors when calling get_settings()
Solution: Verify core/app.py initializes Settings:
Critical Requirements¶
All Commands from Project Root¶
CRITICAL: All commands must be run from project root (where fastappkit.toml is located).
Commands affected:
- fastappkit app new
- fastappkit app list
- fastappkit app validate
- fastappkit migrate *
- fastappkit core dev
External Apps Must be Pip-Installed¶
CRITICAL: External apps must be pip-installed before use:
Settings Must be Initialized¶
CRITICAL: Settings must be initialized in core/app.py:
Database Must be Accessible¶
CRITICAL: Check DATABASE_URL in .env:
Best Practices¶
-
Run migrations before starting server
-
Use
--reloadfor development -
Validate apps regularly
-
Test external apps independently first
-
Check for route collisions
- Review
route_prefixin manifests - Ensure unique prefixes
Next Steps¶
- Deployment - Production deployment
- Troubleshooting - Common problems
- CLI Reference - All commands