# Standard Python Flask Application Template ## Overview This is a standardized template for Python Flask applications following professional best practices. ## Directory Structure ``` {project-name}/ ├── src/ # Source code root │ ├── __init__.py │ ├── app.py # Application entry point │ ├── config.py # Configuration management │ ├── models/ # Data models and database schemas │ │ ├── __init__.py │ │ └── *.py # Model files │ ├── api/ # API endpoints │ │ ├── __init__.py │ │ └── *.py # API route files │ ├── services/ # Business logic │ │ ├── __init__.py │ │ └── *.py # Service files │ ├── utils/ # Utility functions │ │ ├── __init__.py │ │ └── *.py # Utility files │ └── templates/ # HTML templates (if using server-side rendering) ├── frontend/ # Frontend assets (if separate) │ ├── static/ # Static assets (CSS, JS, images) │ │ ├── css/ │ │ ├── js/ │ │ └── images/ │ └── templates/ # HTML templates ├── tests/ # Test files │ ├── __init__.py │ ├── conftest.py # Test configuration │ └── test_*.py # Test files ├── docs/ # Documentation │ ├── api.md │ ├── architecture.md │ └── deployment.md ├── migrations/ # Database migrations (if using alembic) ├── requirements/ # Dependency management │ ├── base.txt │ ├── development.txt │ └── production.txt ├── scripts/ # Utility scripts │ ├── setup.py │ ├── deploy.py │ └── backup.py ├── .env.example # Environment variable examples ├── .gitignore ├── Dockerfile # Container definition ├── docker-compose.yml # Multi-container setup ├── CHANGELOG.md └── Makefile # Common commands ``` ## Usage 1. Copy this template to create a new project 2. Replace `{project-name}` with your actual project name 3. Customize the structure based on project requirements 4. Update README.md with project-specific information ## Best Practices Implemented - Clear separation of concerns - Modular design - Comprehensive testing structure - Professional documentation - Standardized configuration management - Environment variable support - Containerization support - CI/CD ready structure ## Development Setup ```bash # Create virtual environment python -m venv venv source venv/bin/activate # Install dependencies pip install -r requirements/development.txt # Run tests make test # Start development server make run ``` ## Deployment The template includes Docker support for consistent deployment across environments.