Skip to content

mgolvers/microblog-api

 
 

Repository files navigation

microblog-api

Build status codecov

A modern (as of 2022) Flask API back end.

Deploy to Heroku

Click the button below to deploy the application directly to your Heroku account.

Deploy

Deploy on your Computer

Setup

Follow these steps if you want to run this application on your computer, either in a Docker container or as a standalone Python application.

git clone https://github.com/miguelgrinberg/microblog-api
cd microblog-api
cp .env.example .env

Open the new .env file and enter values for the configuration variables.

Run with Docker

To start:

docker-compose up -d

The application runs on port 5000 on your Docker host. You can access the API documentation on the /docs URL (i.e. http://localhost:5000/docs if you are running Docker locally).

To populate the database with some randomly generated data:

docker-compose run --rm microblog-api bash -c "flask fake users 10 && flask fake posts 100"

To stop the application:

docker-compose down

Run locally

Set up a Python 3 virtualenv and install the dependencies on it:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Create the database and populate it with some randomly generated data:

flask db upgrade
flask fake users 10
flask fake posts 100

Run the application with the Flask development web server:

flask run

The application runs on localhost:5000. You can access the API documentation at http://localhost:5000/docs.

About

A modern (as of 2022) Flask API back end.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.7%
  • Shell 1.6%
  • Other 1.7%