Book-me is a backend API that allows students and staff to book meeting rooms at Hive Helsinki. It supports calendar-based views, role-based access control (students & staff), and 42 Intra OAuth2 authentication.
- Live Preview: room.hive.fi [Hive Login required]
- Frontend: Frontend Source code
- 42 Intra OAuth2 Login: Secure authentication using Hive Helsinki’s 42 Intranet
- Smart Booking Logic: Prevents overlapping reservations and restricts cancellation rights
- Role-Based Access:
- Staff can view who booked each slot and cancel any booking
- Students can only see availability and cancel their own bookings
- Calendar API: Fetches unavailable time slots for specific date ranges
- Secure JWT Authentication: Stateless session management using JSON Web Tokens
- Email Notifications: Sends confirmations and updates to users
- Spring Boot (Security, JPA), Java 17+, MySQL, Lombok, MapStruct
src/main/java/com/hivestudent/bookme/
├── Auth/ # OAuth2 login logic & Jwt
│ ├── JwtFilter # Filter for Jwt on every request
│ ├── JwtService # Jwt logic
│ ├── OAuthController # 42 OAuth2 endpoints
│ ├── OAuthService # OAuth2 logic
├── config/ # Security configurations
├── controllers/ # API endpoints
├── dao/ # Data Access Object / JPA Repositories
├── dtos/ # Response/request models
│ ├── ReservedDto # Response model for /reservation/unavailable
├── entities/ # Room, Reservation, User, etc.
├── exceptions/ # Exception Handler
├── Google/ # Google Auth & Calender integration
├── mapper/ # Mapstruct AutoMapper
└── services/ # Business logic- Java 17+, MySQL, 42 Intra client ID/secret
git clone https://github.com/IbnBaqqi/book-me.git
cd book-meCreate local database "bookMe"
In src/main/resources/application-dev.yaml, add:
spring.datasource.url=jdbc:mysql://localhost:3306/bookMespring.datasource.username=your_mysql_username (most likely "root")spring.datasource.password=your_mysql_password
- Rename the
.env.yaml.examplefile to.env.yaml. - Update the following environment variables inside .env:
Generate a secure random key using openssl or any secure generator tool:
openssl rand -base64 32- Generate a new API application on the 42 intranet
- In the field Redirect URI add: http://localhost:8080/oauth/callback
- From the available scopes, choose "Access the user public data" and then proceed to submit.
- Environment variables:
CLIENT_ID: 42 API client IDSECRET: 42 API client secretREDIRECT_URI: http://localhost:8080/oauth/callbackOAUTH_AUTH_URI: https://api.intra.42.fr/oauth/authorizeOAUTH_TOKEN_URI: https://api.intra.42.fr/oauth/tokenJWT_SECRET: YOUR JWT_SECRETREDIRECT_TOKEN_URI: http://localhost:8080/?token=
Then run the app. For Windows, use mvnw.cmd:
./mvnw spring-boot:runAPI Overview here
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License
- Use Docker
- Add Swagger
- System Architecture Diagram
- Sequence Diagram
- Email notifications
- Google Calendar Integration
