A real-time dashboard built with FastAPI and Svelte that displays and monitors sensor data using Server-Sent Events (SSE).
Frontend:
Backend:
Clone the repository:
git clone https://github.com/yourusername/svelte-fastapi-dashboard.git
cd svelte-fastapi-dashboard
Set up the backend:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
pip install -r requirements.txt
Set up the frontend:
cd frontend
npm install
Start the backend server:
cd backend
source venv/bin/activate # On Windows: .\venv\Scripts\activate
python main.py
In a new terminal, start the frontend development server:
cd frontend
npm run dev
The application will be available at:
The backend uses FastAPI to create a REST API with SSE support. The main components are:
main.py
: Application entry pointapp/api.py
: API routes and SSE implementationapp/sensor.py
: Mock sensor data generationThe frontend is built with Svelte and includes:
This project is licensed under the MIT License - see the LICENSE file for details.