GithubHelp home page GithubHelp logo

solnsumei / flask-rest-api-setup Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 10.0 16 KB

Starter template for your Flask and Flask Rest API projects. Build on or modify to suit your development need. No need to setup, just fork this repo and start building your project.

Python 100.00%
flask flask-application flask-api flask-sqlalchemy flask-restful flask-server rest-api restful-api gunicorn gunicorn-web-server gunicorn-flask-webserver gunicorn-with-flask-rest-api starter-template flask-rest-api-starter-template api-starter-template hacktoberfest

flask-rest-api-setup's Introduction

Flask Rest API Setup

Initial scaffolding for a flask rest API development. Starter template for building your Flask and Flask Rest API applications.

Features

  • Gunicorn server setup
  • Database migration setup for SQLAlchemy Models
  • JWT authentication at <your-host>/api/v1/login
  • Url to register your admin and users at <your-host>/api/v1/signup
  • Provisioned route file for all your routes with admin blueprints
  • Test environment setup

Built With

This App was developed with the following stack:

  • Python
  • Flask
  • Flask-restful
  • Postgres DB
  • Gunicorn Web Server

Requirements

  • Python 3.6+
  • Python pip
  • Postgres SQL

Installation

  • fork this repository
  • create a .env file as shown in the env_example file
  • setup your database
  • on the terminal cd into the app folder
  • run pip install -r requirements.txt to install required modules
  • run python manage.py db init to setup alembic migrations
  • run python manage.py db migrate -m='<your migration message>' to create migration files
  • then run python manage.py db upgrade to create tables

Running the App

  • on the terminal run gunicorn main:app
  • To run app on a specific port use gunicorn -127.0.0.1:port main:app

Usage

  • src/api/resources --- flask-restful resources for your project
  • src/models --- SQLAlchemy models and schema
  • src/routes/api --- contains all your route definition
  • src/utils --- contains validations, security and helper files
  • src/middlewares --- define your middleware files here
  • You can modify the app to suit your need.
  • Happy usage.

Credits

[email protected]

flask-rest-api-setup's People

Contributors

dependabot[bot] avatar solnsumei avatar

Stargazers

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

Watchers

 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.