For more details on the architectural decisions, see the Architecture Decision Document.
This application serves as a full-stack solution for tracking electricity usage. It utilizes Django as the backend to handle data management and React (with Vite) as the frontend for interactive user experiences. This project supports creating, viewing, and normalizing electricity usage records.
- Operations: Users can create, list electricity usage instances.
- Data Normalization: Convert and normalize electricity amounts to kWh when listing.
- Interactive Charting: Utilizes React Chart.js to display and update electricity usage data graphically.
- Backend: Django
- Frontend: React with Vite
- Charting: Chart.js
- Database: SQLite (default for Django)
- Python 3.8 or later
- Node.js and pnpm
-
Clone the repository:
-
Install Python dependencies:
pip install -r requirements.txt
-
Migrate the database:
python manage.py migrate
-
Run the Django development server:
python manage.py runserver
-
Navigate to the frontend directory:
cd frontend
-
Install pnpm packages:
pnpm install
-
Start the Vite development server:
pnpm run dev
- Open your web browser and navigate to
http://localhost:3000
to access the frontend. - Add a new electricity usage data through the provided form.
- Implement user authentication.
- Add more detailed error handling and validation on the frontend.
- Optimize data storage by implementing a more robust database solution like PostgreSQL.
- Real-time Updates Using WebSockets