Loading...
Loading...
Generate a comprehensive, step-by-step Markdown tutorial for building a production-ready Flask web app using a strict 3-layer architecture (presentation, business logic, data), fully customizable for any app functionality.
You are an expert technical writer and senior Python Flask developer with deep knowledge of clean architecture patterns. Your task is to write a detailed, step-by-step tutorial on building a complete website using Flask with a strict 3-layer architecture: - **Presentation Layer**: Handles HTTP requests/responses, templates (Jinja2), routing, and user interface (e.g., HTML/CSS/JS with Flask blueprints). - **Business Logic Layer**: Contains core application logic, services, validation, and orchestration between layers (no direct DB access). - **Data Layer**: Manages database interactions using SQLAlchemy (or similar ORM) with [DATABASE_TYPE e.g., SQLite or PostgreSQL]. Include models, queries, and repository patterns. **App Details**: - Topic/Functionality: [YOUR_APP_TOPIC e.g., a simple Todo List or Blog app with CRUD operations]. - Target Audience: [TARGET_AUDIENCE e.g., intermediate Python developers learning architecture]. - Key Features: [SPECIFIC_FEATURES e.g., user authentication, CRUD for todos, search/filter]. - Additional Requirements: [EXTRA_DETAILS e.g., use Bootstrap for UI, include tests, Docker setup]. **Structure the tutorial as follows** (use Markdown with clear headings, code blocks, and explanations): 1. **Introduction**: Overview of 3-layer architecture benefits and project goals. 2. **Prerequisites**: Required tools (Python [VERSION], pip, virtualenv) and installation commands. 3. **Project Structure**: Show directory layout with placeholders for each layer (e.g., /app/presentation/, /app/business/, /app/data/). 4. **Setup**: Environment setup, dependencies (requirements.txt), database config. 5. **Data Layer**: Full code for models, database initialization, repositories. 6. **Business Logic Layer**: Services, use cases, business rules with examples. 7. **Presentation Layer**: Routes, controllers, templates, static files. 8. **Integration & Running**: How layers connect, app factory pattern, run commands. 9. **Testing**: Unit tests for each layer using pytest. 10. **Deployment**: Tips for Heroku/Vercel/Docker. 11. **Best Practices**: Error handling, security, scalability notes. Ensure code is production-ready, modular, and follows PEP8. Include full, copy-pasteable code snippets. Make it engaging and educational for [TARGET_AUDIENCE]. Output only the tutorial, no extra commentary.
This prompt generates a comprehensive Markdown roadmap for building professional, interactive, agentic CLI coding tools with stunning TUIs, inspired by Claude Code and Aider. Customize placeholders and feed to an AI for an executable build plan.
Generate ultra-detailed, canonical image prompts for Simpsons characters like Ralph Wiggum, optimized for AI generators like Midjourney or DALL-E, ensuring faithful 2D cel-shaded portraits with no background.
This reusable prompt template enhances raw AI skill descriptions into clear, structured, markdown-formatted documentation with actionable instructions, examples, and SEO optimization for maximum usability.
Transform vague AI skill descriptions into clear, structured, and professional documentation with this expert prompt template designed for technical writers and prompt engineers.
A professional prompt template for thorough AI-powered code reviews, assessing readability, performance, security, best practices, bugs, and design with scored feedback, detailed breakdowns, refactored code, and prioritized fixes.
This prompt generates a comprehensive, implementable redesign plan for glamorous terminal UIs (TUIs) in developer tools, featuring 3-pane layouts, keybinds, safety modes, and Textual code integration inspired by Charmbracelet's Crush.