A web platform that assists users to track their daily activities contributing to carbon emissions, view summaries, and get personalised tips to reduce their footprint.
- Activity Logging - Log transport, food, energy, and other activities with real CO₂ emission factors
- User Accounts - Register and log in with JWT-based authentication
- Dashboard - Visual charts, daily bar graphs, running totals, and a 7-day streak tracker
- Insight Engine - Personalised tips, weekly reduction goals, and community average comparison
- Category Filtering - Filter logs by transport, food, energy, or other
- Responsive Design - Works on desktop and mobile
| Layer | Technology |
|---|---|
| Frontend | HTML5, CSS3, JavaScript |
| Backend | Node.js, Express 4 |
| Database | MongoDB with Mongoose |
| Auth | JWT (JSON Web Tokens) + bcrypt |
| Charts | Chart.js |
footprint-logger/
├── backend/
│ ├── models/
│ │ ├── User.js
│ │ └── ActivityLog.js
│ ├── routes/
│ │ ├── auth.js
│ │ ├── logs.js
│ │ ├── dashboard.js
│ │ └── insights.js
│ ├── middleware/
│ │ └── auth.js
│ ├── server.js
│ └── package.json
├── frontend/
│ ├── index.html
│ ├── css/
│ │ └── styles.css
│ └── js/
│ ├── api.js
│ ├── auth.js
│ ├── logger.js
│ ├── dashboard.js
│ └── insights.js
├── .env.example
├── .gitignore
└── README.md
- Node.js v18 or higher
- MongoDB (local or MongoDB Atlas)
-
Clone the repository:
git clone https://github.com/karabomasoeu/capstone-footprint-logger.git cd footprint-logger -
Install backend dependencies:
cd backend npm install -
Set up environment variables:
cp ../.env.example .env
-
Start the server:
npm run dev
-
Open the frontend:
- Open
frontend/index.htmlin your browser, or - Serve it with any static file server
- Open
| Variable | Description | Example |
|---|---|---|
PORT |
Port the server runs on | 5000 |
MONGO_URI |
MongoDB connection string | mongodb://localhost:27017/fp |
JWT_SECRET |
Secret key for signing JWTs | your-secret-key |
NODE_ENV |
Environment mode | development |
| Method | Route | Auth | Description |
|---|---|---|---|
| POST | /api/auth/register | Public | Register a new user |
| POST | /api/auth/login | Public | Login and receive a JWT |
| GET | /api/logs | JWT | Get all logs for the current user |
| POST | /api/logs | JWT | Create a new activity log entry |
| DELETE | /api/logs/:id | JWT | Delete a specific log entry |
| GET | /api/dashboard | JWT | Get dashboard summary and charts |
| GET | /api/insights | JWT | Get personalised tips and goals |
| GET | /api/insights/community | JWT | Get community average comparison |