Simple backend calendar Allows you to register new user, login using existing credentials and manage user events.
- PostgreSQL Server v9.6+
- Create database ( default name:
calendar-db
) - change
config.js
with your db connection options (defaults: username =postgres
, password =12345
) - go to project root directory run
npm i
- in project root directory run
db:init
Go to the project root directory and run npm run dev
-
Create new User
URL:/api/users
Method:POST
URL Params:None
Body:- Required:
email[string]
password[string]
- Optional:
name[string]
- Required:
-
Refresh user access token
URL:/api/users/token/refresh
Method:POST
URL Params:None
Body:- Required:
accessToken[string]
refreshToken[string]
- Required:
-
Login
URL:/api/auth
Method:POST
URL Params:None
Body:- Required:
email[string]
password[string]
- Required:
-
Logout
URL:/api/auth/logout
Method:POST
URL Params:None
Body:None
-
Get all event types
URL:/api/event-types
Method:GET
URL Params:None
Body:None
-
Create new event
URL:/api/events
Method:POST
URL Params:None
Body:- Required:
type[integer]
startDate[format - 'YYYY-MM-DD HH:mm:ss']
- Optional:
description[string]
endDate[format - 'YYYY-MM-DD HH:mm:ss']
- Required:
-
Update event
URL:/api/events/:id
Method:PUT
URL Params:- Required:
id[integer]
Body:
- Optional:
type[integer]
startDate[format - 'YYYY-MM-DD HH:mm:ss']
description
endDate[format - 'YYYY-MM-DD HH:mm:ss']
- Required:
-
Delete event
URL:/api/events/:id
Method:DELETE
URL Params:- Required:
id[integer]
Body:
None
- Required:
-
Get events for today
URL:/api/events/today/:offset?/:limit?
Method:GET
URL Params:- Optional:
offset[integer]
limit[integer]
Body:
None
- Optional:
-
Get events for current week
URL:/api/events/week/:offset?/:limit?
Method:GET
URL Params:- Optional:
offset[integer]
limit[integer]
Body:
None
- Optional:
-
Get events for current month
URL:/api/events/month/:offset?/:limit?
Method:GET
URL Params:- Optional:
offset[integer]
limit[integer]
Body:
None
- Optional:
-
Get events for current specific date
URL:/api/events/date/:date/:offset?/:limit?
Method:GET
URL Params:- Required:
date[format - 'YYYY-MM-DD']
- Optional:
offset[integer]
limit[integer]
Body:
None
Bearer Token
- Required: