A bare minimum skeleton app for miLibris/flask-rest-jsonapi . This is a really basic api example which is based on the original First example by miLibris. The simple skeleton app can be used as starting point for more ambitious projects which requires well modularized organization of code.
Clone the repository:
git clone https://github.com/zengoma/flask-rest-jsonapi-skeleton-app.git <project-directory>
Install dependencies:
pip install requirements.txt
Create a database, /dev.db , by default.
- config.py: Setup your database and other global app settings here.
Simply run the bootstrap, run.py, file from the root directory
python run.py
- database/models.py: sqlalchemy model class declarations.
- database/ __init__.py: sqlalchemy database initialization
- database/database_setup.py: Add sample data, administrator users or perform routine database functions at startup.
The packaged flask-rest-jsonapi. Please read the documentation for more information.
- api/resources.py: Resources go here.
- api/schemas.py: Schemas go here.
- api/views.py Routes/Api Views/Endpoints go here.
By default the api is served on the path http://localhost:5000/api. This is achieved by using flask blueprints. You can modify the path or remove it by modifying the api initialization in run.py.
- auth/permissions.py: Permission manager setup
Feel free to add other aspects to the application by including additional packages and blueprints. For example add a frontend package and blueprint on the root "/" url path to create a frontend for you project with static files etc.
To the miLibris/flask-rest-jsonapi team. This project has finally convinced me to abandon my php micro-framework api's and finally embrace python. I have seen the light!