This project purpose is to read RFID cards through Raspberry Pi with this application installed and ran on it. Then in the web app generated by Flask you can manage users and their cards, as well as check when they used their cards and check the length of their "gym sessions"
-
Raspberry Pi with RC522, 3 LED's connected. (runs .NET 6 app)
-
Azure Functions handling RFID Card inputs to database.
-
Azure MS SQL Database
-
Flask web application
-
Copy this repository to your computer.
git clone https://github.com/bfokss/cdv-cc-project.git
-
Deploy this folder to Azure Functions App Service, creating new Azure function.
-
Put contents of this folder on Raspberry Pi and create
config.json
file.{ "url": "YOUR_AZURE_FUNCTION_URL" }
-
Run the .NET application on Raspberry Pi using:
dotnet run
-
Create
Config.py
inside of main folder. It should contain one const. Example:CONNECTION_STRING = 'YOUR_CONNECTION_STRING_USING_ODBC'
-
Before you start working on the Flask project, please create and activate virtual environment inside of main folder based on the
requirements.txt
file. Don't know how to do it? Check out this tutorial. -
Now activate venv and create first migration to update your database's structure.
flask db migrate flask db upgrade
-
Finally, when venv is activated simply run:
flask run
or
py app.py
-
Now head over to your localhost address. It should look like this:
http://localhost:5000
or
http://127.0.0.1:5000
- Home page
- User profile (Without active gym session)
- User profile (With active gym session)
- User sessions
- Adding user
- Listing users
- Assigning users to cards
- Adding card
- Listing cards