Overview
JagWell is a lightweight, secure wellness tracking application built with Node.js, Express, and SQLite. It helps users log and monitor their daily wellness habits with privacy and security in mind, designed specifically for student wellness tracking at educational institutions.
Tech Stack
- Backend: Node.js + Express
- Database: SQLite
- Authentication: JWT + bcrypt for password hashing
- Security: Helmet, CORS, environment variables
- Frontend: HTML, CSS, JavaScript
Features
- Multi-role system: Supports Admin, Doctor, and Student user roles with appropriate permissions
- Wellness tracking: Students can log daily wellness data (mood, sleep, heart rate, etc.)
- Medical oversight: Doctors can view anonymous wellness trends and add medical data
- Student ID integration: Doctors can associate school-generated student IDs with patient records for linking to school records
- Secure authentication: JWT-based authentication with bcrypt password hashing
- Data privacy: All sensitive data stored locally in SQLite database
Setup Instructions
Prerequisites
- Node.js installed
- SQLite CLI (for Windows users:
winget install SQLite.SQLite)
Installation Steps
- Install dependencies:
npm install - Create database:
sqlite3 db/jagwell.db < jagwell.sql - Create first user:
node scripts/create-user.js - Configure environment in
.envfile:PORT=3000 JWT_SECRET=jagwell-secret-2025-do-not-use-in-prod - Start the app:
npm run dev
User Guides
Admin Guide
Learn how to manage users, patients, and wellness records as an administrator.
View GuideDoctor Guide
Instructions for doctors on patient management, wellness logging, and treatment tracking.
View GuideStudent Guide
How students can log their wellness information and access their health records.
View GuideAPI Documentation
The JagWell app provides a comprehensive API for managing wellness data:
- Authentication API: Login, logout, and user information retrieval
- Doctor API: Patient management, wellness records, and treatment tracking
- Admin API: User and data management capabilities
Security Features
JagWell implements multiple layers of security to protect user data and maintain privacy:
- Passwords hashed with bcrypt
- JWT tokens with 1-day expiry stored in httpOnly cookies
- Helmet middleware for hardened HTTP headers
- Content Security Policy (CSP) with strict directives to prevent XSS attacks
- CORS enabled with proper configuration
- Secrets stored in
.envfile - Server-side validation using authenticated user ID from token