This is a Flask backend project that connects to a PostgreSQL database. It provides API endpoints to retrieve cumulative data.
Before you begin, make sure you have the following prerequisites installed on your system:
-
Clone this repository to your local machine:
git clone https://github.com/KevinArce/flask-postgresql.git cd flask-postgresql
-
Create a virtual environment for the project. You can use the built-in venv module in Python:
python -m virtualenv . .\scripts\activate
-
Install the project dependencies:
pip install -r requirements.txt
-
Create a .env file in the root directory of the project and add the following environment variables:
DATABASE_URL=postgresql://<username>:<password>@localhost:5432/<database_name>
-
Run the backend server:
flask run
-
Endpoints, you'll see a Postman Collection with the endpoints in the root directory of the project:
-
Shutdown the server:
CTRL + C
-
Deactivate the virtual environment:
.\scripts\deactivate