The Calendar Sharing Application is a RESTful web service that allows users to create, manage, and share calendars and events. Users can register, log in, and perform various operations on their calendars, including sharing with other users and managing events.
- User registration and authentication
- Calendar creation, retrieval, and deletion
- Event management including creation, retrieval, and deletion
- Sharing calendars with other users
- Email verification for account security
- Asynchronous email delivery using RabbitMQ
- MailDev for local mail server
- Java
- Spring Boot
- Spring Data JPA
- Spring Security
- Spring Mail
- Hibernate
- PostgreSQL
- Flyway
- RabbitMQ for asynchronous email delivery
- Maildev
- Docker
- Docker
-
Clone the repository:
git clone https://github.com/yourusername/calendar-sharing-app.git cd calendar-sharing-app
-
Run the application:
docker-compose up --build;
-
The application will be available at
http://localhost:8080
.
-
Register User
POST /auth/register
- Request Body:
{ "firstName": "Ada", "lastName": "Lovelace", "email": "[email protected]", "birthDate": "1815-12-10", "password": "algorithms123" }
- Curl Command:
curl -X POST http://localhost:8080/auth/register -H "Content-Type: application/json" -d '{ "firstName": "Ada", "lastName": "Lovelace", "email": "[email protected]", "birthDate": "1815-12-10", "password": "algorithms123" }'
-
Verify Email
GET /auth/verify-email?token=your_token
- Curl Command:
curl -X GET "http://localhost:8080/auth/verify-email?token=your_token"
NOTE: You can access to the maildev container - running on http://localhost:1080 - and accept the token there
-
Login User
POST /auth/login
- Request Body:
{ "email": "[email protected]", "password": "algorithms123" }
- Curl Command:
curl -X POST http://localhost:8080/auth/login -H "Content-Type: application/json" -d '{ "email": "[email protected]", "password": "algorithms123" }'
-
Refresh Token
GET /auth/refresh-token
- Curl Command:
curl -X GET http://localhost:8080/auth/refresh-token
-
Get All Calendars
GET /calendars
- Curl Command:
curl -X GET http://localhost:8080/calendars
-
Get Calendar By ID
GET /calendars/{calendarId}
- Curl Command:
curl -X GET http://localhost:8080/calendars/{calendarId}
-
Create Calendar
POST /calendars
- Request Body:
{ "name": "AI Development Calendar" }
- Curl Command:
curl -X POST http://localhost:8080/calendars -H "Content-Type: application/json" -d '{ "name": "AI Development Calendar" }'
-
Delete Calendar
DELETE /calendars/{calendarId}
- Curl Command:
curl -X DELETE http://localhost:8080/calendars/{calendarId}
-
Share Calendar
POST /calendar-sharing
- Request Body:
{ "calendarId": "b90b1e80-1748-4419-bbf4-2360e2d1c61c", "sharedWith": "[email protected]", "calendarPermissions": "READ_WRITE" }
- Curl Command:
curl -X POST http://localhost:8080/calendar-sharing -H "Content-Type: application/json" -d '{ "calendarId": "b90b1e80-1748-4419-bbf4-2360e2d1c61c", "sharedWith": "[email protected]", "calendarPermissions": "READ_WRITE" }'
-
Validate Sharing Token
GET /calendar-sharing/token-validation?token=your_token
- Curl Command:
curl -X GET "http://localhost:8080/calendar-sharing/token-validation?token=your_token"
NOTE: You can access to the maildev container - running on http://localhost:1080 - and accept this invitation there
-
Delete Calendar Sharing
DELETE /calendar-sharing
- Request Body:
{ "calendarId": "b90b1e80-1748-4419-bbf4-2360e2d1c61c", "email": "[email protected]" }
- Curl Command:
curl -X DELETE http://localhost:8080/calendar-sharing -H "Content-Type: application/json" -d '{ "calendarId": "b90b1e80-1748-4419-bbf4-2360e2d1c61c", "email": "[email protected]" }'
-
Get All Events for a Calendar
GET /events/calendar/{calendarId}?startDate={startDate}&endDate={endDate}
- Curl Command:
curl -X GET "http://localhost:8080/events/calendar/{calendarId}?startDate={startDate}&endDate={endDate}"
-
Get Event by ID
GET /events/{eventId}
- Curl Command:
curl -X GET http://localhost:8080/events/{eventId}
-
Create Event
POST /events
- Request Body:
{ "title": "Tech Conference 2024", "description": "Annual tech conference for developers.", "startTime": "2024-10-20T10:00:00", "endTime": "2024-10-20T18:00:00", "calendarId": "b90b1e80-1748-4419-bbf4-2360e2d1c61c" }
- Curl Command:
curl -X POST http://localhost:8080/events -H "Content-Type: application/json" -d '{ "title": "Tech Conference 2024", "description": "Annual tech conference for developers.", "startTime": "2024-10-20T10:00:00", "endTime": "2024-10-20T18:00:00", "calendarId": "b90b1e80-1748-4419-bbf4-2360e2d1c61c" }'
-
Delete Event
DELETE /events/{eventId}
- Curl Command:
curl -X DELETE http://localhost:8080/events/{eventId}
- Get All Shared Calendars
GET /shared-calendars
- Curl Command:
curl -X GET http://localhost:8080/shared-calendars