Skip to content

Anurav-Garg/CalendarLender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CalendarLender

A calendar API made using Express.js and Typescript, with a PostgreSQL + Redis backend, for CrUX inductions round 3. This is not hosted anywhere, and will probably never be updated after the inductions.

API Reference

Prepend the backend URL before these routes, of course.

/users

POST: register new user Sample Request Body:
{
  "username":"username",
  "password":"password",
  "email":"[email protected]",
  "name":"full name"
}
GET: get user account details (Empty body)

Notes:

  • User must be authenticated
DELETE: delete user account and all associated calendars/events (Empty body)

Notes:

  • User must be authenticated
PATCH: update user account details Sample Request Body:
{
  "username":"username",
  "password":"password",
  "name":"full name"
}

Notes:

  • User must be authenticated
  • Updating email ID is not supported
  • All parameters are optional, only entered values will be updated

/users/login

POST: log in Sample Request Body:
{
  "email":"[email protected]",
  "password":"password"
}
DELETE: log out (Empty body)

Notes:

  • User must be authenticated

/my-calendars

POST: create new calendar Sample Request Body:
{
  "name":"calendar name"
}

Notes:

  • User must be authenticated
GET: get list of all owned calendars (Empty body)

Notes:

  • User must be authenticated

/my-calendars/[calendar-id]

GET: get calendar metadata (Empty body)

Notes:

  • User must be authenticated
  • User must own the calendar
DELETE: delete calendar (Empty body)

Notes:

  • User must be authenticated
  • User must own the calendar
PATCH: rename calendar Sample Request Body:
{
  "name":"calendar name"
}

Notes:

  • User must be authenticated
  • User must own the calendar

/my-calendars/[calendar-id]/share

POST: share calendar with another user Sample Request Body:
{
  "email":"[email protected]"
}

Notes:

  • User must be authenticated
  • User must own the calendar
DELETE: remove a user from calendar share list Sample Request Body:
{
  "email":"[email protected]"
}

Notes:

  • User must be authenticated
  • User must own the calendar

/my-calendars/[calendar-id]/events

GET: get details of all events in calendar (Empty body)

Notes:

  • User must be authenticated
  • User must own the calendar
POST: create a new event Sample Request Body:
{
  "title": "event title",
  "description": "detailed description of the event",
  "startTime": "2023-01-01T12:00:00.000Z",
  "endTime":"2012-01-01T12:30:00.000Z"
}

Notes:

  • User must be authenticated
  • User must own the calendar
DELETE: delete an event Sample Request Body:
{
  "id": "xxxxxxxxxxxxxxxxxxxxxxxx"
}

Notes:

  • User must be authenticated
  • User must own the calendar
PATCH: update details of an event Sample Request Body:
{
  "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  "title": "event title",
  "description": "detailed description of the event",
  "startTime": "2023-01-01T12:00:00.000Z",
  "endTime":"2023-01-01T12:30:00.000Z"
}

Notes:

  • User must be authenticated
  • User must own the calendar
  • All parameters besides ID are optional
  • Event ID cannot be changed

/shared-calendars

GET: get list of all calendars shared to user (Empty body)

Notes:

  • User must be authenticated

/shared-calendars/[calendar-id]

GET: get calendar details and events (Empty body)

Notes:

  • User must be authenticated
  • User must be in the calendar's share list
DELETE: remove self from calendar's share list (Empty body)

Notes:

  • User must be authenticated
  • User must be in the calendar's share list

 

(The following two routes are usually accessed via emailed links instead of being used directly. They contain a token in their query strings.)

/verify

GET: verify email ID after registration (Empty body)

Notes:

  • Server generated token must be present in query string

/accept-invite

GET: agree to having a calendar shared with you (Empty body)

Notes:

  • User must be authenticated
  • Server generated token must be present in query string

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published