This guide will help you get up and running with the Flowfull Python Starter in minutes.
- Python 3.11 or higher
- PostgreSQL, MySQL, or SQLite (for development)
- Redis (optional, for distributed caching)
- Flowless instance URL and Bridge Validation Secret
# Navigate to the project directory
cd flowfull-python-starter
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt# Copy environment template
cp .env.example .envEdit .env with your configuration:
# Required - Database
DATABASE_URL=postgresql://user:password@localhost:5432/flowfull_db
# Required - Flowless Integration
FLOWLESS_API_URL=https://your-instance.pubflow.com
BRIDGE_VALIDATION_SECRET=your-shared-secret-min-32-chars
# Optional - Redis (recommended for production)
REDIS_URL=redis://localhost:6379
# Optional - CORS
CORS_ORIGINS=http://localhost:3000,http://localhost:5173If you plan to use trust tokens:
python scripts/generate_paseto_key.pyCopy the generated key to your .env file:
PASETO_PRIVATE_KEY=k4.local.your-generated-key-here# Run migrations
alembic upgrade head# Start with hot reload
uvicorn app.main:app --reload --host 0.0.0.0 --port 3001Your server is now running! 🎉
- API: http://localhost:3001
- Docs: http://localhost:3001/docs
- Health: http://localhost:3001/health
curl http://localhost:3001/healthExpected response:
{
"status": "healthy",
"timestamp": "2024-01-01T00:00:00.000000",
"environment": "development",
"version": "0.1.0"
}curl http://localhost:3001/api/v1/publicExpected response:
{
"message": "This is a public route",
"timestamp": "2024-01-01T00:00:00.000000",
"authenticated": false
}pytestAll tests should pass! ✅
If you prefer Docker:
# Start all services (app + PostgreSQL + Redis)
docker-compose up -d
# View logs
docker-compose logs -f app
# Stop services
docker-compose downRead the documentation in /to-do directory:
- Bridge Validation: Session validation with Flowless
- Validation Modes: Security levels (DISABLED, STANDARD, ADVANCED, STRICT)
- HybridCache: 3-tier caching system
- Trust Tokens: PASETO v4 token management
- Auth Middleware: Route protection
- Multi-Database: Database flexibility
- Environment Config: Type-safe configuration
Open http://localhost:3001/docs to see:
- Public routes: No authentication required
- Protected routes: Authentication required
- Optional auth routes: Enhanced experience for authenticated users
- User type restricted routes: Role-based access control
Edit app/routes/api.py:
from app.lib.auth.middleware import require_auth
from app.lib.auth.bridge_validator import SessionData
@router.get("/my-route")
async def my_route(session: SessionData = Depends(require_auth)) -> dict:
return {
"message": f"Hello {session.name}!",
"user_id": session.user_id
}Create a new model in app/models/:
from sqlalchemy import Column, String, DateTime
from app.lib.database.connection import Base
class MyModel(Base):
__tablename__ = "my_table"
id = Column(String(36), primary_key=True)
name = Column(String(255), nullable=False)
created_at = Column(DateTime(timezone=True), server_default=func.now())Generate migration:
alembic revision --autogenerate -m "Add my_table"
alembic upgrade headSolution: Verify your DATABASE_URL in .env is correct and the database server is running.
# Test PostgreSQL connection
psql -h localhost -U your_user -d your_database
# Test MySQL connection
mysql -h localhost -u your_user -p your_databaseSolution: Redis is optional. If not using Redis, the system will fall back to LRU cache only.
# Test Redis connection
redis-cli ping
# Should return: PONGSolution: Make sure you're in the virtual environment and dependencies are installed.
# Activate virtual environment
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
# Reinstall dependencies
pip install -r requirements.txt- README.md - Project overview
- to-do/QUICK-REFERENCE.md - Quick reference guide
- to-do/04-USAGE-GUIDE.md - Detailed usage examples
- IMPLEMENTATION_SUMMARY.md - Implementation details
- Check the
/to-dodirectory for comprehensive documentation - Open an issue on GitHub
- Contact: support@pubflow.com
You're all set! Start building your application! 🚀