Giter Site home page Giter Site logo

backend-flask-server's Introduction

backend-flask-server

運行環境在 backend,此 repo 乃 API server 之原始碼。

Architecture

MVC 架構加上 Service Layer 與 SQLAlchemy ORM。

main.py 是主程式,launch_thread 是 backend_app(詳看 backend)會開啓的 process,主要工作回收過期 domains。

models 負責與資料庫、資料來源互動,models/db.sql 是 ORM 的本體,而 models/users.pymodels/domains.pymodels/records.py……則類似 Repository Pattern 中的 Repository。

services 中負責簡化 Controller 的邏輯,將一部分邏輯和功能放入 Services,如與 DNS 相關的認證、註冊功能放入 DNSService 中。

controllers 負責處理 API 請求,會使用 services 中寫好的邏輯,在大多數的情況下,controllers 不該直接與 models 互動。

tests 則存放 Unit Tests。

References

Flask Docs

backend-flask-server's People

Contributors

leelin2602 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.