A class management system for students to register and manage classes with ease and style.Unlike the SFSU Student Center, our app is simple and fast and does not require users to wait 15 to 30 seconds just for it to respond.
- Look up classes for Computer Science majors as a student
- Register or log into your student account
- Edit user name or profile image
- Manage classes in your semester schedule
- Add a class to your schedule
- Remove a class from your schedule
- Clear your schedule
.
├── app.js # Application entry point
├── package.json # NPM project configuration
├── README.md # This file
├── config/ # Configuration files
│ ├── database.js # PostgreSQL connection pool
│ ├── test-classes.json # Dummy data to populate classes table
│ └── test-courses.json # Dummy data to populate courses table
├── controllers/ # Route controllers
│ ├── authController.js # Authentication logic
│ ├── courseController.js # Logic to interact with courses on the database
│ ├── scheduleController.js # User-related logic
│ └── userController.js # User-related logic
├── middlewares/ # Custom middleware
│ ├── auth.js # Authentication middleware
│ ├── error-handler.js # Error handling middleware
│ ├── locals.js # Template locals middleware
│ └── upload.js # File upload middleware
├── models/ # Database operations
│ ├── Class.js # User data access functions
│ ├── Course.js # User data access functions
│ ├── Image.js # Profile image data access functions
│ ├── Registration.js # Class registration access functions
│ └── User.js # User data access functions
├── public/ # Static assets
│ ├── css/
│ ├── js/
│ └── images/
├── routes/ # Express routes
│ ├── auth.js # Authentication routes
│ ├── courses.js # Class search page and api routes
│ ├── index.js # Public routes
│ ├── schedule.js # User-added classes page and api routes
│ └── user.js # Protected user routes
├── scripts/ # Utility scripts
│ ├── clean-db.js # Reset database tables
│ ├── test-db.js # Test js functions on database
│ └── init-db.js # Database initialization
└── views/ # EJS templates
├── partials/ # Reusable template parts (header, footer, etc.)
├── auth/ # Authentication templates
├── schedule/ # User's registered classes page
├── courses/ # List of courses page
└── user/ # User-related templates
- Node.js (v18 or higher)
- PostgreSQL (v18.*)
- Fork and clone the repository:
# Fork on GitHub first, then clone your fork
git clone https://github.com/Vixeln/CSC317-ClassManager.git
cd CSC317-ClassManager- Install dependencies:
npm install- Create a
.envfile in the root directory:
cp .env.example .env- Modify the
.envfile with your configuration:
PORT=3000
NODE_ENV=development
DATABASE_URL=postgresql://postgres:[your_password]@localhost:5432/csc317_project
SESSION_SECRET=your_secure_secret_key- Create the database and initialize tables:
createdb csc317_project
npm run db:initThis script will also populate the tables with dummy classes and courses
- Start the development server:
npm run dev- Open your browser and visit
http://localhost:3000
npm run devThis will start the server with nodemon, which automatically restarts when files change.
Write javascript in scripts/test-db.js and test it by running
npm run db:testnpm startFor deployment to Render.com:
- Create a PostgreSQL database on Render
- Create a Web Service connected to your GitHub repository
- Set environment variables (DATABASE_URL, SESSION_SECRET, NODE_ENV)
- Initialize the database using Render Shell:
npm run db:init
See SETUP.md for detailed deployment instructions.
This project is available for educational purposes.
- This project was built on top of the authentication template provided by @goleador
- Built with Express.js, PostgreSQL, and other open-source technologies