You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is my implementation of calendly with below-mentioned components, features, use cases, assumptions, future scopes, etc.
Components
This is a spring boot application which is divided into controller(API layer), service(service layer), model(contains object/DTOs), datastore(in-memeroy DB).
We have 2 entities i.e. User & Meeting, these entities in turn have 2 dedicated singleton datastores, 2 services and 2 controllers.
UserController has user CRUD APIs.
MeetingController has scheduleMeeting() API which is used to schedule a meeting between a requestor and a requestee.
Features
Users can be created, deleted, read and modified(new available slots can be added).
Meetings can be scheduled between 2 people.
Exception handling is added at all the required places.
APIs
Create User
Delete User
Display all users
Display a specific user
Add available slots to an user
Schedule meeting between the requestor and the requestee.
Assumptions:
A user will always call an API with only his userId as a requestor to schedule a meeting.
An in-memory singleton database is used.
Requestor will schedule a meet in his own available slot, if not then our pre-validation check throws an exception.
By default, all slots are unavailable for a new user.
Time format used is [yyyy-MM-dd HH:mm].
Use Case
Create user1
Add available slots to user1 e.g. [2024-09-20 10:00 to 2024-09-20 10:30], [2024-09-20 12:00 to 2024-09-20 13:00], [2024-09-20 16:00 to 2024-09-20 16:45]
Create user2
Add available slots to user1 e.g. [2024-09-20 10:00 to 2024-09-20 10:30], [2024-09-20 13:00 to 2024-09-20 14:00], [2024-09-20 16:00 to 2024-09-20 16:30]
user1 requests to schedule a meeting with user2 at [2024-09-20 10:00 to 2024-09-20 10:30]