Full-stack web app for Web and Mobile Design coursework: users sign in, search Twitter via the Twitter API v2, and view analytics with Chart.js. Sessions and data live in MongoDB; contact, signup, and password flows use Nodemailer, Google reCAPTCHA, and JWT reset links.
Live demo: https://my-twitter-analytics-app.onrender.com
| Area | Technologies |
|---|---|
| Runtime & server | Node.js, Express, EJS |
| Data | MongoDB, Mongoose, connect-mongo sessions |
| External APIs | Twitter API v2, Google reCAPTCHA |
| Frontend | Bootstrap, Chart.js, Web Workers |
| Security & UX | Helmet (CSP), bcrypt, JWT (password reset), Gravatar |
- Node.js (LTS recommended)
- MongoDB Atlas (or compatible cluster) and a Twitter developer Bearer token
- SMTP credentials if you use contact / forgot-password email
- Google reCAPTCHA v2 keys (site key is in the EJS views; secret goes in env)
npm installCreate a .env file in the project root (never commit real secrets):
| Variable | Purpose |
|---|---|
PORT |
HTTP port (default 3000) |
Db_Username, Db_Password, Db_Cluster, Db_Name |
MongoDB Atlas connection |
Session_name, Session_secret |
Express session cookie name and secret |
Bearer_Token |
Twitter API v2 bearer token |
CAPTCHA_SECRET |
Google reCAPTCHA secret |
EMAIL, EMAIL_PSW |
Nodemailer SMTP user and password |
Server_Secret |
Base secret for JWT password-reset tokens |
HOSTNAME |
Host used in reset links (e.g. localhost:3000 or your production domain) |
npm run devStartUses nodemon on server.js. For a one-off run without file watching:
node server.js| Command | Description |
|---|---|
npm run devStart |
Start with nodemon (reloads on changes; *.json ignored per config) |
Sameera Kaluwaduge — ISC (see package.json).
Repository: https://github.com/samdsk/lab-pwm