HydroponicSystem is a web-based application built with Django and Django REST Framework (DRF) that allows users to monitor and manage hydroponic systems. The application integrates sensor data collection, device control, and real-time analytics to optimize plant growth.
- Hydroponic System Management – Users can create and manage their hydroponic systems.
- Sensor Data Collection – The system records pH, temperature, and TDS (total dissolved solids) measurements.
- User Authentication – Secure user authentication using JWT (JSON Web Token).
- REST API – Provides a structured API for integration with external systems.
- Backend: Django, Django REST Framework (DRF)
- Database: PostgreSQL (or SQLite for development)
- Containerization: Docker, Docker Compose
- Authentication: JWT authentication (SimpleJWT)
- Python 3.11 or higher
- Poetry
- Docker and Docker Compose
- PostgreSQL (for production use)
Before running the application, create a .env file in the root directory and define the following:
SECRET_KEY = your_secret_key
DEBUG= True/False (for production please use False)
DB_NAME = dbname
DB_USER = username
DB_PASSWORD = password
DB_HOST = address
DB_PORT = port- Clone the repository:
git clone https://github.com/user/HydroponicSystem.git cd HydroponicSystem - Install dependencies using Poetry:
poetry install
- Activate Poetry virtual environment:
poetry shell
- Apply database migrations:
python manage.py migrate
- Start the development server:
python manage.py runserver
- Build and start containers:
docker-compose up --build
- The application will be available at
http://host:8000for examplehttp://localhost:8000.
Dockerfile: Configures the Django application environment.docker-compose.yml:webservice: Runs Django.dbservice: PostgreSQL database container..envfile: Stores environment variables.
To run in detached mode:
docker-compose up -dTo stop and remove containers:
docker-compose downHydroponicSystem/
│── HydroponicsSystem/ # Django project configuration
│ ├── __init__.py # Package initializer
│ ├── settings.py # Application settings
│ ├── urls.py # Main URL routing
│ ├── asgi.py # ASGI entry point
│ ├── wsgi.py # WSGI entry point
│ ├── .env # Example environment variables file
│
│── api/ # API module
│ ├── __init__.py # Package initializer
│ ├── models.py # Database models
│ ├── serializers.py # API serializers
│ ├── views.py # API views
│ ├── urls.py # API routing
│ ├── admin.py # Admin panel configurations
│ ├── apps.py # Django app configuration
│ ├── migrations/ # Database migrations
│ ├── tests/ # Test cases
│
│── requirements.txt # Dependencies list
│── manage.py # Django management tool
│── Dockerfile # Docker configuration
│── docker-compose.yml # Docker Compose configuration
│── README.md # Readme
│── CHANGELOG.md # Changelog
│── .gitignore # Gitignore
The API is powered by Django REST Framework. Below are the actual endpoints:
GET /api/systems/– Retrieve the list of hydroponic systems.POST /api/systems/– Create a new hydroponic system.GET /api/systems/{id}/– Retrieve details of a specific system.PUT /api/systems/{id}/– Update an existing hydroponic system.DELETE /api/systems/{id}/– Delete a hydroponic system.
GET /api/measurements/– Retrieve all sensor measurements.POST /api/measurements/– Submit a new sensor measurement.GET /api/measurements/{id}/– Retrieve a specific sensor measurement.
POST /api/auth/register/– Register a new user.POST /api/auth/login/– Obtain authentication token.POST /api/auth/logout/– Log out the user.GET /api/auth/me/– Retrieve authenticated user details.
API documentation can be accessed at /swagger/ or /redoc/ if configured.
- Run unit tests:
python manage.py test - API testing can be done using Postman or
curl.
- Fluorky(Maciej Bujalski) – Lead Developer
This project is licensed under the MIT License. See LICENSE for details.
For questions, reach out to maciej.bujalski.dev@gmail.com.