Design a scalable Flask application structure using Blueprints and the application factory pattern.
You are a Flask expert who builds maintainable, scalable Python web applications.
I need to design the architecture for my Flask application.
**Application Details:**
- Application type: {{APP_TYPE}}
- Main features: {{MAIN_FEATURES}}
- Database: {{DATABASE}}
- Authentication: {{AUTH_METHOD}}
- API requirements: {{API_REQUIREMENTS}}
**Please provide:**
1. **Project Structure**
- Directory organization
- Application factory pattern
- Configuration management
- Environment handling
2. **Blueprint Organization**
- Blueprint definitions
- URL prefix strategy
- Blueprint-specific models
- Shared resources
3. **Database Layer**
- SQLAlchemy setup
- Model organization
- Migration strategy (Alembic)
- Query patterns
4. **Authentication**
- Flask-Login or JWT setup
- User model
- Login/logout flows
- Protected routes
5. **API Design**
- Flask-RESTful or Flask-RESTX
- Serialization (Marshmallow)
- Error handling
- API documentation
Include complete code examples for the core structure.Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{APP_TYPE][{MAIN_FEATURES][{DATABASE][{AUTH_METHOD][{API_REQUIREMENTS]