Plant today. Breathe tomorrow.
EcoReleaf is a full-stack web application helping people combat air pollution by connecting contributors with local nurseries, providing real-time Air Quality Index data, and delivering personalised plant recommendations.
- 🌫️ Live AQI Dashboard — Real-time air quality data powered by OpenWeather API
- 🌱 Plant Recommendations — Personalised suggestions based on local air quality
- 🏡 Nursery Discovery — Find verified nurseries sorted by distance from your location
- 📋 Pollution History — Track and visualise AQI snapshots over time
- 💚 Wishlist — Save plants you want to grow
- 🌐 Multilingual — English, Hindi, and Odia support
- 🔐 Auth — Separate flows for Contributors and Nursery Owners
ecoreleaf/
├── client/ # React + Vite frontend
│ ├── src/
│ │ ├── components/
│ │ ├── Styles/
│ │ ├── language/ # i18n plant data (EN, HI, OD)
│ │ └── utils/
│ └── .env.example
├── server/ # Express + MongoDB backend
│ ├── routes/
│ ├── models/
│ └── .env.example
└── package.json # Root scripts
| Tool | Version |
|---|---|
| Node.js | 18+ |
| npm | 9+ (bundled with Node 18) |
| MongoDB | Atlas or local instance |
| OpenWeather API key | Get one free |
git clone https://github.com/your-username/ecoreleaf.git
cd ecoreleafServer:
cp server/.env.example server/.envEdit server/.env:
DB_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/ecoreleaf
JWT_SECRET=your_jwt_secret_here
CORS_ORIGIN=http://localhost:5173
PORT=5001Client:
cp client/.env.example client/.envEdit client/.env:
VITE_API_BASE_URL=http://localhost:5001
VITE_OPENWEATHER_API_KEY=your_openweather_key_hereFrom the repo root:
npm run install:allOr separately:
npm --prefix server ci
npm --prefix client ciOpen two terminals:
# Terminal 1 — Backend
npm run dev:server
# Terminal 2 — Frontend
npm run dev:client| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend | http://localhost:5001 |
| Health check | http://localhost:5001/api/health |
Run these from the repo root:
| Script | Description |
|---|---|
npm run install:all |
Install all client and server dependencies |
npm run dev:client |
Start the Vite dev server |
npm run dev:server |
Start the Express server with nodemon |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Server health check |
POST |
/api/register |
Register a new user |
POST |
/api/login |
Log in |
GET |
/api/nurseries |
List all nurseries |
GET |
/api/nurseries/:id |
Get nursery details |
| Variable | Required | Description |
|---|---|---|
DB_URI |
✅ | MongoDB connection string |
JWT_SECRET |
✅ | Secret for signing JWT tokens |
CORS_ORIGIN |
✅ | Allowed frontend origin |
PORT |
❌ | Server port (default: 5001) |
| Variable | Required | Description |
|---|---|---|
VITE_API_BASE_URL |
✅ | Backend base URL |
VITE_OPENWEATHER_API_KEY |
✅ | OpenWeather API key |
- Never commit
.envfiles. Both are listed in.gitignore. - If credentials were previously committed, rotate them immediately — especially
DB_URIandJWT_SECRET— before any deployment. - The server will refuse to start if
DB_URIis missing.
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature - Commit your changes:
git commit -m "feat: add your feature" - Push to your branch:
git push origin feat/your-feature - Open a Pull Request
This project is licensed under the MIT License. See LICENSE for details.