A full-stack web-based application for managing college events with separate interfaces for administrators and students.
- Frontend: HTML, CSS, JavaScript, Bootstrap 5
- Backend: Node.js with Express.js
- Database: MySQL (connected using mysql2)
- Authentication: JWT-based login system
- Password Security: bcrypt for password hashing
- Environment Configuration: .env file for database credentials and secret keys
- Admin login/logout using JWT
- Add, edit, delete, and view events
- View all registered students per event
- Dashboard with:
- Total events
- Total students
- Total registrations
- Upcoming events
- Student registration and login
- View upcoming and past events
- Register for events
- View "My Registered Events" list
- Homepage showing all upcoming events
- About Us and Contact Us pages
The application uses a MySQL database named college_event_db with the following tables:
- admins - Admin login information
- students - Student registration information
- events - Event details (name, date, venue, description)
- registrations - Mapping of students to events
college-event-management-system/
│
├── backend/
│ ├── config/
│ ├── controllers/
│ ├── middleware/
│ ├── routes/
│ └── utils/
│
├── frontend/
│ ├── assets/
│ ├── css/
│ ├── js/
│ └── *.html
│
├── .env
├── package.json
├── server.js
└── database_schema.sql
-
Clone the repository
git clone <repository-url> cd college-event-management-system -
Install dependencies
npm install -
Set up the database
- Create a MySQL database named
college_event_db - Update the
.envfile with your database credentials - Run the SQL commands in
database_schema.sqlto create the tables
- Create a MySQL database named
-
Configure environment variables Update the
.envfile with your database credentials and JWT secret:# Server Configuration PORT=3000 # Database Configuration DB_HOST=localhost DB_USER=your_username DB_PASSWORD=your_password DB_NAME=college_event_db # JWT Configuration JWT_SECRET=your_jwt_secret_key JWT_EXPIRES_IN=24h -
Start the server
npm start -
Access the application Open your browser and navigate to
http://localhost:3000
POST /api/admin/login- Admin loginPOST /api/admin/create- Create admin (for initial setup)GET /api/admin/dashboard- Get admin dashboard dataGET /api/admin/events- Get all eventsPOST /api/admin/events- Create eventPUT /api/admin/events/:id- Update eventDELETE /api/admin/events/:id- Delete eventGET /api/admin/events/:id/registrations- Get registered students for an event
POST /api/student/register- Student registrationPOST /api/student/login- Student loginGET /api/student/profile- Get student profilePUT /api/student/profile- Update student profileGET /api/student/events/upcoming- Get upcoming eventsGET /api/student/events/past- Get past eventsPOST /api/student/events/register- Register for an eventGET /api/student/events/registered- Get student's registered eventsPOST /api/student/events/cancel- Cancel event registration
GET /api/public/events/upcoming- Get all upcoming eventsGET /api/public/events/:id- Get event by ID
- JWT for secure authentication
- Input validation on both client and server
- Prepared statements to prevent SQL injection
- Password hashing with bcrypt before storing in the database
To run the application in development mode with auto-restart:
npm run dev
This project is licensed under the MIT License.