Giter Site home page Giter Site logo

ssfdust / full-stack-flask-smorest Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 9.0 6.47 MB

Full Stack Flask Rest Api with JWT, Celery , Swagger and Admin backend manager.

License: Apache License 2.0

Makefile 0.02% Python 77.47% JavaScript 3.01% CSS 1.53% HTML 16.91% Batchfile 0.02% Mako 0.10% PLpgSQL 0.80% Dockerfile 0.09% Shell 0.05%
celery adminlte openapi flask flask-smorest mongodb swagger jwt rabbitmq

full-stack-flask-smorest's Introduction

Build Status Coverage Status Codacy Badge License Python Versions

full-stack-flask-smorest

已迁移到新版[Smorest Sync Full Stack(https://github.com/ssfdust/smorest-sfs)] ,没错 如果有时间将会有Smorest Async Full Stack,Flask即将支持Asyncio.

特性

  • Restful-Api
  • Jwt-Authorization
  • 图片验证码
  • 后台看板(adminlte)
  • 文件管理
  • 文件数据库软删除
  • 树形闭包表
  • 小型celery任务管理
  • celery自定义schedule(支持crontab与interval,且有图形界面)
  • celery进度条
  • socket-io(websocket)
  • mongodb作为日志数据库,记录所有访问的内容以及系统日志
  • rabbitmq作为队列
  • swagger(带jwt验证)
  • redoc

预览

image image image image image

安装

安装服务并启动

  1. mongodb
  2. postgresql
  3. rabbitmq
  4. nginx
  • 建议使用最新版

安装python工具以及依赖

make

生成脚本并初始化数据库

poetry shell
inv app.boilerplates.generate-config
inv app.db.create-pg-db-and-user
inv app.db.create-mg-db-and-user -a <mongodb_admin> -p <mongodb_passwd>
inv app.db.initdb
inv app.db.init-development-data
FLASK_ENV=testing inv app.db.initdb
FLASK_ENV=testing inv app.db.init-development-data

将域名写入到本机hosts

sudo vim /etc/hosts

插入

127.0.0.1           <server_name>

为nginx添加内容

  1. 在http段新增

    include        conf.d/*.conf;
  2. 在nginx.conf所在目录中不存在conf.d则创建

    sudo mkdir /etc/nginx/conf.d
  3. 复制deploy/nginx/flask.conf到conf.d

    sudo cp deploy/nginx/flask.conf /etc/nginx/conf.d/
  4. 重启nginx

    sudo systemctl restart nginx

运行服务

inv app.manager

docker发布

  1. 参考docker-compose.yml修改production.toml

  2. 根据production.toml生成模板配置

    inv app.boilerplates.generate-docker-compose
  3. 执行

    docker-compose up

默认用户名密码

访问首页

  • <server_name>/admin/login
  • <server_name>/doc/redoc
  • <server_name>/doc/swagger

full-stack-flask-smorest's People

Contributors

dependabot[bot] avatar ssfdust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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