Try the webapp here
Demonstration project to deepen my skills with FastAPI, Flask, DynamoDB and the web stack (I'm not frontend dev)
All this code is made for educational purposes, take and make of it what you want!
If you want to improve some parts and have them uploaded to this repo just commit!
- FastAPI: Used for the API with which the database interacts with Flask.
- Flask: Used to render HTML documents (using Jinja2) and receive frontend requests.
- Boto3: Used to interact with the database (AWS DynamoDB).
This tutorial is only going to work if you use DynamoDB!
You need create an IAM user with application access.
Then copy the login data and paste it into the credentials.json
file.
This file must be inside the db/.aws
folder (create the last folder).
Now you must apply the rot-13 algorithm to this data. So that they are not exposed to the naked eye in your project.
Let's think of your login data as looking like this without the rot-13 algorithm:
{
"aws_access_key_id": "KeyIDExposed",
"aws_secret_access_key": "ThiIstheacceskey",
"region_name": "your-aws-region"
}
After applying the rot-13 algorithm it should look like this:
{
"aws_access_key_id": "XrlVQRkcbfrq",
"aws_secret_access_key": "GuvVfgurnpprfxrl",
"region_name": "lbhe-njf-ertvba"
}
Finally, your file structure for the database should look like this:
- Make a Virtual Enviroment
python -m venv venv
- Activate the Virtual Enviroment
# Windows
.\venv\Scripts\activate
# Linux
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Execute the
webapp.py
program
python webapp.py
- In other terminal execute the
api.py
program.
python api.py