Server-application for Notes-app
Created with Node, Express, MongoDB, Mongoose, JWT, Cloudinary, nodeMailer
-
User registration with email.
-
Verification with link is sending to user's email.
-
Used 2 JWT tokens.
-
Creating, deleting and editing notes and saving to the database.
-
Notes available only it's creators - users.
-
Uploading, updating and removing files to the cloud. Pinned them to notes.
-
Set file-filters by mime-format and size.
-
Set validating incoming emails and passwords.
Description API methods and endpoints.
request: in body should be provided registration data
{
email: '',
password: '',
}
response: user with a new token
{
user: {
id: ''
email: '',
isActivated: false,
},
accessToken: '',
refreshToken: '',
}
also set in cookies: { refreshToken: '' }
errors: { message: '', errors: [] }
request: in body should be provided login data, in cookies refresh-token
{
email: '',
password: '',
}
response: user with token
{
user: {
id: ''
email: '',
isActivated: false,
},
accessToken: '',
refreshToken: '',
}
also set in cookies: { refreshToken: '' }
errors: { message: '', errors: [] }
request: in cookies should be provided refresh-token
response: deleted token
{
user: '',
refreshToken: '',
}
errors: { message: '', errors: [] }
request: in cookies should be provided refresh-token
response: user with updated token
{
user: {
id: ''
email: '',
isActivated: false,
},
accessToken: '',
refreshToken: '',
}
also set in cookies: { refreshToken: '' }
errors: { message: '', errors: [] }
request: none
response: redirect to the client main page
errors: { message: '', errors: [] }
request: id of a note in params, in cookies should be provided refresh-token
response: note object
{
id: '',
title: '',
body: '',
date: '',
pinned: false,
favorite: false,
tags: [''],
file?: {
id: '',
name: '',
url: ''
},
},
errors: { message: '', errors: [] }
request: in cookies should be provided refresh-token
response: array of notes
[
{
id: '',
title: '',
body: '',
date: '',
pinned: false,
favorite: false,
tags: [''],
file?: {
id: '',
name: '',
url: ''
},
},
]
errors: { message: '', errors: [] }
request: in body should be provided a new note, in cookies refresh-token
{
id: '',
title: '',
body: '',
date: '',
pinned: false,
favorite: false,
tags: [''],
file?: {
id: '',
name: '',
url: ''
},
},
response: created note
{
id: '',
title: '',
body: '',
date: '',
pinned: false,
favorite: false,
tags: [''],
file?: {
id: '',
name: '',
url: ''
},
},
errors: { message: '', errors: [] }
request: in body should be provided an edited note, in cookies refresh-token
{
id: '',
title: '',
body: '',
date: '',
pinned: false,
favorite: false,
tags: [''],
file?: {
id: '',
name: '',
url: ''
},
},
response: updated note
{
id: '',
title: '',
body: '',
date: '',
pinned: false,
favorite: false,
tags: [''],
file?: {
id: '',
name: '',
url: ''
},
},
errors: { message: '', errors: [] }
request: id of a note in params, in cookies should be provided refresh-token
response: deleted note
{
id: '',
title: '',
body: '',
date: '',
pinned: false,
favorite: false,
tags: [''],
file?: {
id: '',
name: '',
url: ''
},
},
errors: { message: '', errors: [] }
request: form-data with a file in field file
, in cookies refresh-token
response: file-info object
{
id: '',
url: '',
name: ''
}
errors: { message: '', errors: [] }
request: id of an old file in params, form-data with a new file in field file
, in cookies refresh-token
response: file-info object
{
id: '',
url: '',
name: ''
}
errors: { message: '', errors: [] }
request: id of a file in params, in cookies refresh-token
response: file-info object
{
id: '',
sucsess: ''
}
errors: { message: '', errors: [] }