Giter Site home page Giter Site logo

fez2000 / flask-api-starter-with-swagger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mutegekihenry/flask-api-starter-with-swagger

0.0 0.0 0.0 20 KB

Flask code template to quickly get you up and running. Build your REST Api without going through folder structure setup hustles.

Shell 0.94% Python 93.43% Mako 5.62%

flask-api-starter-with-swagger's Introduction

Reusable Flask Starter Project API

Flask wrapper REST Api project. This project is aimed at creating a flask structure that is reusable for any flask project. All you have to do is just clone/fork, customise db details and start building your API in the less than 5minutes. This project uses the following technologies:

  1. Flask
  2. Swagger
  3. SQLAlchemy

Project Setup

Follow these steps to have a local running copy of the app.

Clone The Repo

git clone <url-to-repo>

If master is not up to date, git checkout develop. However, note that code on develop could be having some minor issues to sort.

Install PostgreSQL

Here's a great resource to check out:

How To Install and Use PostgreSQL

Create a development database and call it dev_db.

Create a Virtual Environment

create virtual enviroment called venv

Run virtualenv venv

Activate the virtual environment.

Run . venv/bin/activate

Make sure you have pip installed on your machine.

Install the dependencies.

pip install -r requirements.txt

Create a .env file

Create a .env file (which defines the environment variables used) at the root of the app.

Add the following details, customizing as needed.

export FLASK_APP=server.py
export FLASK_ENV=development
export FLASK_RUN_PORT=5000
Run Database migrations

Run migrations for the database

python manage.py db upgrade

Run Application

Run the application with this command

flask run

Test the API

Through your browser go to link localhost:<flask_port>/.

Checkout Api docs

Through your browser go to link localhost:<flask_port>/apidocs.

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.