Ratham Backend is a Go-based web application that manages sessions between students and deans at a university. It provides a set of APIs for user registration, login, session booking, and management.
Ratham Backend offers the following key features and functionalities:
-
Session Management
- Session Booking: Students can view and book available dean sessions. Each dean session is one hour long, scheduled on Thursdays and Fridays at 10 AM every week.
- Pending Sessions: Deans can log in to view a list of pending sessions, including student names and session details.
-
User Management
- Student Registration: New students can register with their university ID and password.
- Dean Registration: New deans can register with their university ID and password.
- User Login: Registered students and deans can log in to the system.
- User Logout: Users can log out to end their sessions securely.
-
Upcoming Free Sessions
- Upcoming Sessions: Deans can log in to see a list of upcoming free sessions, including session start and end times.
-
Authentication
- JWT Authentication: User authentication is implemented using JSON Web Tokens (JWT) for secure access to protected routes. To access protected routes, include the JWT token in the request headers as a Bearer token.
To run this application locally, follow these steps:
- Clone the repository to your local machine.
git clone https://github.com/Sahil-4555/ratham-backend.git
- Navigate to the project directory.
cd ratham-backend
- Install the required dependencies.
go mod tidy
- Start the server
go run main.go
The Server will start on port 8080 by default.
- Register:
// Register a new student. --POST Method
http://localhost:8080/student/register
- Login:
// Authenticate and log in a student. --POST Method
http://localhost:8080/student/login
- Get Student Details:
// Retrieve student details. --GET Method
http://localhost:8080/student/user
- Logout:
// Log out the student. --POST Method
http://localhost:8080/student/logout
- Register:
// Register a new dean. --POST Method
http://localhost:8080/dean/register
- Login:
// Authenticate and log in a dean. --POST Method
http://localhost:8080/dean/login
- Get Student Details:
// Retrieve dean details. --GET Method
http://localhost:8080/dean/user
- Logout:
// Log out the dean. --POST Method
http://localhost:8080/dean/logout
- Add New Session:
// Add a new session (deans only) --POST Method
http://localhost:8080/session/addsession
- Get All Free Sessions:
// Get a list of free sessions (students only). --GET Method
http://localhost:8080/session/getfreesession
- Book a Session:
// Book a session (students only). --POST Method
http://localhost:8080/session/booksession/:sessionid
- Get Upcoming Free Sessions:
// Get upcoming free sessions (deans only). --GET Method
http://localhost:8080/session/getupcomingfreesession
- Go (Golang)
- Fiber - Web framework for Go
- MongoDB - Database for storing user and session data