Portfolio
Loading Shiham's portfolio
Preparing the latest projects, skills, and contact paths with a quiet production-ready polish.
Initializing portfolio
Projects · Skills · Contact
Portfolio
Preparing the latest projects, skills, and contact paths with a quiet production-ready polish.
Initializing portfolio
Projects · Skills · Contact
Built as a four-member academic project, PowerWise helps Sri Lankan households understand and reduce electricity costs. It brings manual usage records, appliance estimates, configurable tariffs, monthly budgets, alerts, and saving guidance into one application for families and administrators.
Household users can manage profiles and members, record meter readings, track appliances, view consumption comparisons, estimate bills, monitor budget risk, receive alerts, and review dashboard summaries. The tips workflow provides recommendations, search and filtering, bookmarks, implementation tracking, feedback, dismissals, and estimated saving snapshots.
The system uses a React/Vite single-page client communicating through Axios with a versioned Express API and MongoDB via Mongoose. Routes, validation, controllers, services, and models separate responsibilities. My stated contribution focused on tips management, the module spanning administrator tip maintenance and household tip interactions; repository history does not map individual files to team members.
Related projects
Jan 2026 – Jun 2026
A multi-vendor commerce platform connecting buyers, sellers, and administrators through dedicated storefronts, dashboards, payments, chat, and personalized discovery.
A React/Vite SPA sends JSON requests through a shared Axios client to an Express API under /api/v1. The backend uses route and validation middleware, controllers, domain services, and Mongoose models backed by MongoDB. JWT, administrator roles, and household-access checks protect private operations.
A full-stack electricity bill reduction assistant for Sri Lankan households.
PowerWise helps families record electricity use, estimate bills before they arrive, manage a monthly budget, understand what each appliance is really costing them, and act on practical saving tips — all from one household-focused dashboard.
Live Demo · Report an Issue · Architecture · Deployment Guide
This is an academic and portfolio project. It is deployed and functional, but its configured tariff data must be checked against current official utility rates before any real-world use.
Electricity bills can be difficult to predict, especially when households have limited access to clear usage data. PowerWise brings meter readings, appliance estimates, budget tracking, alerts, and saving guidance into one household-focused application, so families can see a bill coming before it arrives instead of being surprised by it.
| Area | Technology |
|---|---|
| Frontend | React, Vite, Tailwind CSS, React Router, Axios, Recharts |
| Backend | Node.js, Express |
| Database | MongoDB, Mongoose |
| Authentication | JSON Web Tokens, bcrypt |
| Validation | Joi, express-validator |
| Security | Helmet, CORS allow-list, rate limiting |
| Backend tests | Jest, Supertest |
| Frontend tests | Vitest, React Testing Library, MSW, jest-axe |
| API documentation | Swagger UI |
| CI |
flowchart LR
A[React + Vite SPA] -->|Axios / JSON / JWT| B[Express API<br/>/api/v1]
B -->|Controllers → Services → Mongoose| C[(MongoDB)]
The frontend lazy-loads route pages and uses a shared Axios client for authenticated API requests. The backend separates HTTP routing, validation, controllers, business services, and persistence models. Household access checks protect private records, while admin middleware protects management endpoints.
See Architecture for the detailed system design.
PowerWise/
.github/workflows/ Continuous integration
backend/
scripts/seed/ Tariff and saving-tip seeders
src/
config/ Environment, database, and Swagger setup
controllers/ HTTP request handlers
data/ Appliance preset data
middleware/ Authentication, validation, and errors
models/ Mongoose models
routes/ API route definitions
services/ Domain and calculation logic
utils/ Response and email helpers
validators/ Shared request schemas
tests/
integration/ API and authorization tests
load/ Local Artillery scenarios
unit/ Calculation and helper tests
frontend/
public/ Static public files
src/
assets/ Imported images
components/ Layout, feature, and UI components
context/ Authentication state
lib/ Shared frontend utilities
pages/ Route-level screens
services/ API clients
test/ Shared test setup and accessibility checks
docs/ Architecture, testing, and deployment guidance
The backend alone supports Node.js 20.19 or later. Use Node.js 22.22 or later for local full-stack work and deployment so both applications use the same supported runtime.
cd backend
npm install
cp .env.example .env
npm run dev
At minimum, configure MONGODB_URI and a long random JWT_ACCESS_SECRET. The API starts at http://localhost:5000 by default.
| Endpoint | Purpose |
|---|---|
http://localhost:5000/api/v1/health | Health check |
http://localhost:5000/api/v1/docs | Swagger UI |
http://localhost:5000/api/v1 | API base |
Optional starter data:
npm run seed:tariffs
npm run seed:tips
Seeded tariffs are configuration examples and are not guaranteed to match current official rates.
For a connected demo household, set DEMO_USER_PASSWORD in the trusted shell environment and run:
npm run seed:demo
Optional administrator seeding uses DEMO_SEED_ADMIN=true and DEMO_ADMIN_PASSWORD. To remove only the allowlisted demo accounts and PowerWise Demo Home data, set DEMO_SEED_RESET_CONFIRM=POWERWISE_DEMO_RESET and run npm run seed:demo:reset. Never store demo passwords in source files or public documentation.
cd frontend
npm install
cp .env.example .env
npm run dev
The frontend starts at http://localhost:5173 by default.
Backend variables are documented in backend/.env.example.
| Variable | Purpose |
|---|---|
MONGODB_URI | MongoDB connection string |
MONGO_TEST_URI | MongoDB database used by tests |
PORT | API port, default 5000 |
FRONTEND_URL | Allowed frontend origin |
CORS_ALLOWED_ORIGINS | Optional comma-separated additional origins |
JWT_ACCESS_SECRET | JWT signing secret |
JWT_ACCESS_EXPIRE | JWT lifetime |
Frontend configuration:
VITE_API_BASE_URL=http://localhost:5000/api/v1
Never commit real credentials or production environment files.
The project ships with automated backend and frontend suites: 50 backend tests across 5 suites, and 14 frontend tests across 8 files.
Backend:
cd backend
npm test
npm run test:unit
npm run test:integration
npm audit
Frontend:
cd frontend
npm run lint
npm test
npm run build
npm audit
Local load-test instructions are available in backend/tests/load/README.md. See Testing for full coverage details and known gaps.
PowerWise is deployed and live:
| Layer | Service | Status |
|---|---|---|
| Frontend | Vercel | ✅ Live — powerwise.vercel.app |
| Backend | Render web service | ✅ Live |
| Database | MongoDB Atlas | ✅ Live |
To deploy your own instance, follow Deployment and complete the Production Checklist before publishing an environment.
The case-study preview is collapsed. Activate the button to make the full content available.
Mar 2026 – Jul 2026
A full-stack developer portfolio, combining a public project showcase with a protected dashboard for managing content and media.
Aug 2025 – Oct 2025
A marketplace for verified Sri Lankan homestays, supporting guest bookings, host onboarding, admin approval, and test-mode payments.
| GitHub Actions |
| Hosting | Vercel (frontend), Render (backend), MongoDB Atlas (database) |
ADMIN_SECRET_KEY | Controls administrator registration |
RATE_LIMIT_* | General API rate-limit settings |
AUTH_RATE_LIMIT_* | Authentication rate-limit settings |
SMTP_* and FROM_* | Optional password-reset email configuration |
OPENWEATHER_API_KEY | Optional weather enrichment |
CARBON_API_KEY | Optional carbon data enrichment |