Welcome to the backend repository for CampusSync, a comprehensive application designed to streamline campus operations, particularly focusing on student and teacher data management, attendance tracking, and session management.
This backend is built with Spring Boot and offers a robust set of features:
- Student and Teacher Management: Stores and manages data for students and teachers, including their departments, enrollment details, and subjects.
- Attendance Tracking: Facilitates student attendance marking through a dynamic token generation system.
- Secure Authentication: Implements JWT (JSON Web Tokens) for secure session management and API authentication.
- RESTful API Design: Exposes well-structured and intuitive RESTful endpoints for seamless integration with the frontend.
- Data Security: Utilizes Data Transfer Objects (DTOs) to prevent exposure of crucial information.
- Database Management: Leverages PostgreSQL for persistent data storage with JDBC for database connectivity.
- Java 17+
- Spring Boot
- Spring Security
- PostgreSQL
- JDBC
- JWT (JSON Web Tokens)
- Maven
To get the CampusSync backend up and running on your local machine, follow these steps:
- Java Development Kit (JDK) 17 or higher: Make sure you have JDK 17 or a newer version installed.
- Maven: Install Maven for building and managing project dependencies.
- PostgreSQL: Set up a PostgreSQL database instance.
-
Create a PostgreSQL Database:
CREATE DATABASE campussync_db;
-
Configure
application.properties: Updatesrc/main/resources/application.propertieswith your PostgreSQL database credentials:spring.datasource.url=jdbc:postgresql://localhost:5432/campussync_db spring.datasource.username=your_username spring.datasource.password=your_password spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
(Replace
your_usernameandyour_passwordwith your PostgreSQL credentials.)
- Clone the Repository:
git clone <repository_url> cd CampusSync-Backend
- Build the Project:
mvn clean install
- Run the Application:
The application will start on
mvn spring-boot:run
http://localhost:8080.
The following are some of the key API endpoints available in the CampusSync backend. All endpoints are prefixed with http://localhost:8080.
-
GET /attendance/all: Retrieve all attendance records.
[ { "id": 1, "student": { "id": 1, "name": "John Doe", "student_uid": "S001", "email": "john.doe@univ.edu", "jwt_token": " ", "semester": 1 }, "subject": { "id": 1, "name": "Introduction to Programming", "code": "CS101", "semester": "1", "department": { "id": 1, "name": "Computer Science" }, "teacher": { "id": 1, "name": "Dr. Alice Smith", "email": "alice.smith@univ.edu", "jwtToken": null, "departmentName": "Computer Science" } }, "date": "2025-07-06", "status": null } ]
-
GET /enrollment/all: Retrieve all enrollment records.
[ { "id": 1, "student": { "id": 1, "name": "John Doe", "student_uid": "S001", "email": "john.doe@univ.edu", "jwt_token": " ", "semester": 1 }, "subject": { "id": 1, "name": "Introduction to Programming", "code": "CS101", "semester": "1", "department": { "id": 1, "name": "Computer Science" }, "teacher": { "id": 1, "name": "Dr. Alice Smith", "email": "alice.smith@univ.edu", "jwtToken": null, "departmentName": "Computer Science" } } } ]
-
GET /subject/all: Retrieve all subject records.
{ "id": 1, "name": "Introduction to Programming", "code": "CS101", "semester": "1", "department": { "id": 1, "name": "Computer Science" }, "teacher": { "id": 1, "name": "Dr. Alice Smith", "email": "alice.smith@univ.edu", "jwtToken": null, "departmentName": "Computer Science" } }
-
GET /teacher/all: Retrieve all teacher records.
{ "id": 1, "name": "Dr. Alice Smith", "email": "alice.smith@univ.edu", "jwtToken": null, "departmentName": "Computer Science" }
-
GET /student/all: Retrieve all student records.
{ "id": 1, "name": "John Doe", "student_uid": "S001", "email": "john.doe@univ.edu", "jwt_token": " ", "semester": 1 }
- GET /attendance_token/all: Retrive all Attendance Token records.
{ "token": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "subject": { "id": 1, "name": "Introduction to Programming", "code": "CS101", "semester": "1", "department": { "id": 1, "name": "Computer Science" }, "teacher": { "id": 1, "name": "Dr. Alice Smith", "email": "alice.smith@univ.edu", "departmentName": "Computer Science" } }, "generatedAt": "2025-07-11T02:00:00.000+05:30", "expiresAt": "2025-07-11T02:15:00.000+05:30" }
Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.