Get Engagement Report
This is a Flask project built using Flask framework and several additional libraries. It provides a RESTful API with Swagger documentation.
- Python 3.7 or higher
- Flask 2.2.2
- Connexion with Swagger UI 2.14.1
- Flask-Marshmallow with SQLAlchemy support 0.14.0
- Flask-SQLAlchemy 3.0.3
- Marshmallow 3.19.0
- Marshmallow-SQLAlchemy 0.29.0
- Make sure you have Python 3.7 or higher installed (3.11.0 preferred)
- Clone this repository:
git clone https://github.com/majidm55/assignment-api.git
- Navigate to the project directory:
cd assignment-api
- Create a virtual environment (optional but recommended) for a custom path:
python3 -m venv /path/to/new/virtual/environment
. If you are in the right directory/project folderpython3 -m venv ./venv
- Activate the virtual environment
- Install the required dependencies:
pip3 install -r requirements.txt
- If you are running into issues with pip make sure you are using and referencing the correct/consistent python and pip versions for env creation/installation (pip3 vs pip, python vs python3)
- To view the sqlite database and make edits, install the VS code extension named SQLite3 Editor v1.0.77
- Open the
config.py
file and update the configuration settings according to your environment - The database resides within a sqlite3 file named content_management.db
- Run the Flask application:
python app/assignment-api.py
(you can try python3 /app... if you have not aliased your python version) - Open your web browser and go to
http://localhost:8000
to access the API which will also print the database content table.
app.py
: Entry point of the application.config.py
: Configuration file for the application.controllers/
: Contains the API controllers which call the models.models/
: Contain the models which define datadatabases/
: References to adding data which don't need to be run again.templates/
: Contains HTML templates to render locally.