This project is a dashboard for visualizing weight data using Streamlit and FastAPI. The data is stored in a JSON file and can be accessed and manipulated through the FastAPI endpoints.
-
Clone the repository:
git clone https://github.com/yourusername/descartin-dashboard.git cd descartin-dashboard
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.streamlit
directory in thestreamlit
folder:mkdir -p streamlit/.streamlit
-
Create a
secrets.toml
file in the.streamlit
directory with the following content:# filepath: /home/bubu/Documents/Descartin/streamlit/.streamlit/secrets.toml password = "your_password_here"
Replace
"your_password_here"
with your actual password.
-
Build and start the containers:
docker-compose up --build
-
Open your web browser and go to
http://localhost:8501
to access the Streamlit dashboard.
-
Start the FastAPI server:
uvicorn server:app --reload
-
In a new terminal, start the Streamlit app:
streamlit run streamlit/app.py
The following endpoints are available in the FastAPI server:
GET /weight/{index}
: Get weight data by index.POST /weight
: Add new weight data.PUT /weight/{index}
: Update weight data by index.DELETE /weight/{index}
: Delete weight data by index.GET /weight
: Get all weight data.
- Open your web browser and go to
http://localhost:8501
to access the Streamlit dashboard. - Enter the password to log in.
- Use the dashboard to visualize weight data by type of residue, by month, and with a linear trend.
This project is licensed under the MIT License. See the LICENSE file for details.