The Sustainability Dashboard is a web-based application designed to visualize and report energy data for sustainability-focused initiatives. Built using Vue.js for the frontend and Node.js with Express for the backend, it employs a microservices architecture for modularity, scalability, and flexibility. The backend integrates with PostgreSQL for structured data storage and supports multiple energy sources, such as solar, utility, and fuel cells. The platform aims to provide real-time data visualization, energy usage insights, and interactive maps for users, including administrators and the general public.
- Node.js (v16 or higher recommended)
- Express.js (v4 or higher)
- PostgreSQL (v12 or higher)
- PM2 (optional, for process management)
- A modern code editor like Visual Studio Code
- Postman (optional, for API testing)
Ensure you have the following environment variables configured:
-
PostgreSQL Database Connection:
DB_USER
- PostgreSQL usernameDB_PASSWORD
- PostgreSQL passwordDB_HOST
- PostgreSQL hostDB_PORT
- PostgreSQL port (default: 5434)DB_NAME
- PostgreSQL database name
-
Backend API URL:
API_URL
- The base URL for the backend API (default:http://localhost:3000
)
- Calpine Energy Service: Fetches and processes electricity usage for on-campus locations.
- SDG&E Energy Service: Handles off-campus electricity data and sub-meter tracking.
- AE Power Solar Service: Monitors solar panel energy generation metrics.
- Bloom Energy Fuel Cell Service: Tracks fuel cell energy creation and efficiency.
-
Clone the repository.
-
Install dependencies for the entire project:
npm install
-
Start the backend server:
npm start
-
Start the frontend and create a local webpage URL:
npm run dev
-
Run tests:
npm test
-
Run the linter:
npm run lint