Built: Fall 2024
A Node.js + Express web app with user accounts, sessions, profile preferences (ZIP), and weather lookup via the VisualCrossing API. Uses an MVC-style structure and MongoDB for persistence.
- Node.js, Express
- MongoDB + Mongoose
- EJS templates
- bcryptjs (password hashing)
- express-session (sessions)
- node-fetch (API requests)
- User registration + login (bcryptjs password hashing)
- Session-based authentication
- Profile management (including ZIP code preference)
- Weather data fetching by ZIP code (VisualCrossing)
- Static assets served from the client public folder
- Node.js (LTS recommended)
- MongoDB Community Server running locally
From the project root:
npm installCreate a .env file in the project root (do not commit this file). Start by copying the example:
cp .env.example .envThen fill in the values in .env.
How you start MongoDB depends on your OS:
macOS (Homebrew):
brew services start mongodb-communityLinux (systemd):
sudo systemctl start mongodWindows:
Start the “MongoDB Server” service, or run mongod if you installed it manually.
node Server/index.jsThen open:
http://localhost:3000
This project expects the following variables (see .env.example):
PORT-> Server port (default 3000)MONGODB_URI-> MongoDB connection stringSESSION_SECRET-> Secret used to sign sessionsVISUALCROSSING_API_KEY-> VisualCrossing API keyDEFAULT_ZIP-> Optional default ZIP used by the appNODE_ENV-> Runtime mode (development/production)
Project Root
│── Server
│ ├── controllers
│ │ ├── mainController.js
│ │ ├── accountController.js
│ ├── models
│ │ ├── Account.js
│ │ ├── APIData.js
│ │ ├── Account.js
│ ├── index.js
│── Client
│ ├── views (EJS templates)
│ ├── public (CSS, JS, images)
I’m aware of the following issues:
-
Login page CSS is not applying correctly.
-
Production security hardening is incomplete: This project is not production-hardened (limited input validation, no CSRF protection, no rate limiting, and session cookie settings are basic).
-
Asset licensing/attribution may be incomplete: Image assets were obtained from free-use sites, but licensing/attribution is not fully documented.
This repository is public for portfolio viewing.
Reuse, redistribution, or submission of this code for academic work is not permitted without explicit permission.