EcoLearn — Gamified Environmental Education Platform for Schools and Colleges
Back to ProjectGamified Environmental Education Platform for Schools and Colleges
Follow the steps below carefully to set up and run the EcoLearn project on your local machine.
Make sure the following are installed on your system before proceeding:
After purchasing from CodeAj, extract the downloaded ZIP file or clone the repository using the command below:
git clone <your-repo-url>
cd "Gamified Environmental Education Platform for Schools and Colleges"
If you received a ZIP file, extract it and open the extracted folder in your terminal or command prompt.
It is strongly recommended to use a virtual environment to avoid dependency conflicts with other Python projects on your system.
python -m venv venv
venv\Scripts\activate
python -m venv venv
source venv/bin/activate
Once activated, you will see (venv) appear at the beginning of your terminal prompt. This confirms the virtual environment is active.
All required packages are listed in the requirements.txt file. Install them with the following command:
pip install -r requirements.txt
This will install Django, scikit-learn, XGBoost, LightGBM, Plotly, pandas, numpy, TensorFlow, WhiteNoise, django-crispy-forms, and all other required packages.
This step may take a few minutes depending on your internet speed. Make sure your virtual environment is active before running this command.
EcoLearn uses Django's built-in ORM with SQLite as the default database. Run the following commands to create the database schema:
python manage.py makemigrations accounts gamification education analytics core
python manage.py migrate
After this, a db.sqlite3 file will be created in the root project directory. This is your local development database.
EcoLearn includes a custom management command that populates the database with sample data including lessons, quizzes, badges, eco challenges, eco facts, and a demo school. Run:
python manage.py seed_data
This step is important. Without seed data, the lessons, quizzes, and gamification content will not appear in the application.
To access the Django admin panel at /admin/, you need to create a superuser account:
python manage.py createsuperuser
You will be prompted to enter a username, email address, and password. Once created, log in at http://127.0.0.1:8000/admin/ to manage all data from the admin interface.
Start the Django development server with the following command:
python manage.py runserver
Open your web browser and visit:
http://127.0.0.1:8000
The EcoLearn platform should now be fully running. Register a new account, select your role (Student, Teacher, or Eco Club Coordinator), and start exploring the platform.
EcoLearn includes six Jupyter notebooks that train and save machine learning models used by the analytics pages. This step is optional — if you skip it, the analytics pages will automatically fall back to rule-based logic.
To generate the trained models, first make sure Jupyter is installed (it is included in requirements.txt), then run:
jupyter notebook
This will open Jupyter in your browser. Open and run the notebooks in the following order:
01_water_quality_model.ipynb — Trains a Random Forest classifier for water potability prediction. Saves water_quality_model.pkl02_air_quality_analysis.ipynb — AQI trend analysis and pollutant correlation. Saves air_quality_model.pkl03_waste_classification_cnn.ipynb — MobileNetV2 CNN for organic vs recyclable waste classification. Saves waste_classifier_best.h504_deforestation_analysis.ipynb — K-Means clustering and choropleth map generation05_emissions_analysis.ipynb — India CO2 forecast with BAU vs Green Transition comparison06_student_performance_analysis.ipynb — Random Forest classifier for student academic performance predictionAll trained model files will be saved in the saved_models/ directory and will be automatically loaded by the analytics views when the server restarts.
Once the server is running, you can navigate to the following pages:
| Page | URL |
|---|---|
| Home | http://127.0.0.1:8000/ |
| Register | http://127.0.0.1:8000/accounts/register/ |
| Login | http://127.0.0.1:8000/accounts/login/ |
| Eco Dashboard | http://127.0.0.1:8000/gamification/dashboard/ |
| Leaderboard | http://127.0.0.1:8000/gamification/leaderboard/ |
| Badges | http://127.0.0.1:8000/gamification/badges/ |
| Challenges | http://127.0.0.1:8000/gamification/challenges/ |
| Lessons | http://127.0.0.1:8000/education/lessons/ |
| Quizzes | http://127.0.0.1:8000/education/quizzes/ |
| Analytics Home | http://127.0.0.1:8000/analytics/ |
| Air Quality | http://127.0.0.1:8000/analytics/air-quality/ |
| Water Quality | http://127.0.0.1:8000/analytics/water-quality/ |
| Deforestation | http://127.0.0.1:8000/analytics/deforestation/ |
| CO2 Emissions | http://127.0.0.1:8000/analytics/emissions/ |
| Natural Disasters | http://127.0.0.1:8000/analytics/disasters/ |
| SDG Dashboard | http://127.0.0.1:8000/analytics/sdg/ |
| Admin Panel | http://127.0.0.1:8000/admin/ |
If you face any issues during setup, CodeAj offers a dedicated Project Setup and Source Code Explanation service. Our team will help you get the project running and walk you through the entire codebase.
Visit projects.codeaj.com/services to book a setup session.
Our team is here to assist you with installation and setup.