Giter Site home page Giter Site logo

switch247 / one_for_all Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

flask clean architecture template

Python 40.18% HTML 59.82%
blueprint flask flask-api flask-restful flask-sqlalchemy migrations mysql-database templates clean-architecture python

one_for_all's Introduction

Flask Modern Folder Structure Python CRUD Template

This is a Flask template for building large-scale projects with a modern folder structure and CRUD (Create, Read, Update, Delete) functionality. It provides a solid foundation for developing web applications with Flask.

Features

  • Modern folder structure for better organization and scalability
  • CRUD functionality for managing data
  • Flask-SQLAlchemy for interacting with the database
  • Flask-WTF for handling forms and validation
  • Flask-Login for user authentication and session management
  • Flask-Migrate for database migrations
  • Flask-Bcrypt for password hashing
  • Flask-RESTful for building RESTful APIs
  • Flask-CORS for handling Cross-Origin Resource Sharing
  • Flask-Testing for unit testing
  • Bootstrap for responsive and mobile-first design
  • Jinja2 templating engine for dynamic HTML rendering

Folder Structure

The template follows a modular structure to keep the codebase organized and maintainable. Here's an overview of the main folders and their purposes:

  • app: Contains the core application code
    • models: Defines the database models using Flask-SQLAlchemy
    • views: Implements the routes and views for handling HTTP requests
    • forms: Contains the form classes for user input validation
    • templates: Stores the HTML templates for rendering dynamic content
    • static: Holds static files such as CSS, JavaScript, and images
  • migrations: Manages database migrations using Flask-Migrate
  • tests: Contains unit tests for the application
  • config.py: Stores configuration variables for the application
  • run.py: Entry point for running the application

Getting Started

To use this template, follow these steps:

  1. Clone the repository: git clone https://github.com/your-repo.git
  2. Install the required dependencies: pip install -r requirements.txt
  3. Configure the application settings in config.py
  4. Create the database: flask db init && flask db migrate && flask db upgrade
  5. Run the application: python run.py

Usage

Once the application is running, you can access it in your web browser at http://localhost:5000. The template provides a basic user interface for creating, reading, updating, and deleting data. You can customize and extend the functionality according to your project requirements.

Testing

To run the unit tests, use the following command: python -m unittest discover -s tests

Contributing

If you find any issues or have suggestions for improvements, please feel free to contribute by submitting a pull request or creating an issue on the GitHub repository.

License

This template is open-source and released under the MIT License. Feel free to use it for your personal or commercial projects.

Acknowledgements

This template was inspired by best practices and recommendations from the Flask community. Special thanks to all the contributors who have made this template possible.

Contact

If you have any questions or need further assistance, you can reach out to the project maintainer at [email protected]

Happy coding!

one_for_all's People

Contributors

switch247 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.