- Node.js (v14 or higher)
- PostgreSQL (v12 or higher)
- npm or yarn
git clone https://github.com/CSC317-F25/group-project-0xAysh.git
cd group-project-0xAyshnpm installCreate database and user:
CREATE DATABASE academic_dashboard;
CREATE USER your_db_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE academic_dashboard TO your_db_user;Copy .env.example to .env:
cp .env.example .envEdit .env with your database credentials:
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_db_user
DB_PASS=your_password
DB_NAME=academic_dashboard
JWT_SECRET=your_jwt_secret_here
PORT=3001Generate JWT secret:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"node db/reset.jsnode server.jsServer will run on http://localhost:3001
Database connection fails:
- Verify PostgreSQL is running:
sudo systemctl status postgresql - Check
.envfile has correct credentials - Ensure database exists:
psql -U postgres -l
Port already in use:
- Change
PORTin.envfile - Or kill process using port 3001:
lsof -ti:3001 | xargs kill
Module not found errors:
- Run
npm installagain - Delete
node_modulesandpackage-lock.json, then reinstall
Reset database (WARNING: deletes all data):
node db/reset.jsExport database:
node export-database.jsImport backup:
pg_restore -U your_db_user -d academic_dashboard backup-2025-11-19.tar