tiangolo / full-stack

Full stack, modern web application generator. Using Flask, PostgreSQL DB, Docker, Swagger, automatic HTTPS and more.
MIT License
523 stars 81 forks source link
angular api apispec celery cookiecutter docker flask generator jwt letsencrypt marshmallow pgadmin postgresql python sqlalchemy swagger swarm-mode token-authetication traefik webargs

🚨 DEPRECATION WARNING 🚨

As FastAPI and the equivalent project generator provide a much better solution to all the use cases this project was built for, all the future development will be done there.

You are still free to use this project, but it won't receive any new features, changes, or bug fixes.

If you are starting a new project from scratch, check the alternatives at the FastAPI docs: Project Generation.

Full Stack Flask and PostgreSQL - Base Project Generator

Build Status

Generate a backend and frontend stack using Python, including interactive API documentation.

Screenshot

Notice: Flask or FastAPI

If you are using this project (or Flask in general to create web APIs) you would probably benefit more from FastAPI.

You can use the equivalent sibling project generator based on FastAPI: https://github.com/tiangolo/full-stack-fastapi-postgresql. It also has more features than this one.

FastAPI was created from the learnings acquired while creating and using these project generators for Flask, with all the plug-ins and ideas.


Features

How to use it

Go to the directoy where you want to create your project and run:

pip install cookiecutter
cookiecutter https://github.com/tiangolo/full-stack

Generate passwords

You will be asked to provide passwords and secret keys for several components. Open another terminal and run:

openssl rand -hex 32
# Outputs something like: 99d3b1f01aa639e4a76f4fc281fc834747a543720ba4c8a8648ba755aef9be7f

Copy the contents and use that as password / secret key. And run that again to generate another secure key.

Input variables

The generator (cookiecutter) will ask you for some data, you might want to have at hand before generating the project.

The input variables, with their default values (some auto generated) are:

How to deploy

This stack can be adjusted and used with several deployment options that are compatible with Docker Compose, but it is designed to be used in a cluster controlled with pure Docker in Swarm Mode with a Traefik main load balancer proxy handling automatic HTTPS certificates, using the ideas from DockerSwarm.rocks.

Please refer to DockerSwarm.rocks to see how to deploy such a cluster in 20 minutes.

More details

After using this generator, your new project (the directory created) will contain an extensive README.md with instructions for development, deployment, etc. You can pre-read the project README.md template here too.

History

Note about Angular: a previous version of this project generated a basic default Angular frontend application, but without any view or interaction with the rest of the stack (the backend API). I recently switched to Vue for frontend and used it to created the basic frontend views for this project (that didn't exist before). If you are interested in keeping the Angular version, let me know in an issue, I can create an Angular version of the project (without the current default views), then you can integrate your Angular app with the basic Dockerfile and additional files.

This project was based on senseta-os/senseta-base-project.

As I was the only maintainer, I'm continuing the development in this fork (https://github.com/tiangolo/full-stack).

License

This project is licensed under the terms of the MIT license.