A nodejs express server application for a note keeping, with scheduled daily email reminders
committing to a to-do list or an important note can be a hassle, especially if you run on a very busy schedule. Memoer helps to solve the issue of forgetting an important action or task to be carried out. It is a Node.js, Express with mySQL database application that helps users capture their thoughts and allows them to add notes and lists. Additionally, it provides daily email reminders for incomplete tasks based on the priority you set while creating a note. Email reminders for high-priority notes are sent every 8 hours, medium-priority notes every 16 hours, and low-priority notes every 24 hours.
MySQL database server is open-source database software that is faster, secured, reliable and cheaper because of its unique storage engine architecture.
This is the documentation for the REST API built using Express.js. The API is used for a note-keeping application that requires users to sign up and log in to access the service.
Getting Started To get started with the API, follow these steps:
-
Clone the repository onto your local machine using git clone https://github.com/jefedcreator/memoer.git.
-
Run
yarn install
to install all the required dependencies. -
Run
yarn start
to start the server.
The server will be available at http://localhost:8000/api/v1/
This template guides you through CRUD operations (GET, POST, PUT, DELETE), variables, and tests.
RESTful APIs allow you to perform CRUD operations using the POST, GET, PUT, and DELETE HTTP methods.
This collection contains each of these request types. Open each request and click "Send" to see what happens.
Observe the response tab for status code (200 OK), response time, and size.
Update or add new data in "Body" in the POST request. Typically, Body data is also used in PUT request.
{
"name": "Add your name in the body"
}
Variables enable you to store and reuse values in Postman. We have created a variable called base_url
with the sample request https://postman-api-learner.glitch.me. Replace it with your API endpoint to customize this collection.
Tests help you confirm that your API is working as expected. You can write test scripts in JavaScript and view the output in the "Test Results" tab.
- Use folders to group related requests and organize the collection.
- Add more scripts in "Tests" to verify if the API works as expected and execute workflows.
API testing basics
API documentation
Authorization methods
{{baseUrl}}/auth/signup
{
"statusCode": 201,
"message": "user created",
"data": {
"id": 219,
"name": "Jon doe",
"email": "[email protected]",
"createdAt": "2024-05-05T11:12:55.668Z",
"updatedAt": "2024-05-05T11:12:55.668Z"
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/auth/signin
{
"email": "[email protected]",
"password": "notarealpassword10"
}
{
"statusCode": 201,
"message": "logged in",
"data": {
"id": 219,
"name": "Jon doe",
"email": "[email protected]",
"password": "$2b$10$XJbIfv9dRdQCAnYzyVKeh.gjcJ1QOUlI0KFM/C824WBkiC95iA9VG",
"createdAt": "2024-05-05T11:12:55.668Z",
"updatedAt": "2024-05-05T11:12:55.668Z",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImtvZGV5b3c2MjRAYW1hbmtyby5jb20iLCJpYXQiOjE3MTQ5MDc4OTksImV4cCI6MTcxNTMzOTg5OX0.dLET8CbnW37D7MG_yAXhtz6w_SAkhucRtCsLTPTIuOw"
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/auth/password/reset
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
Gets information about the authenticated user.
{{baseUrl}}/user
{
"statusCode": 200,
"message": "user fetched",
"data": {
"email": "[email protected]",
"name": "Jon doe",
"createdAt": "2024-05-05T00:44:46.156Z",
"updatedAt": "2024-05-05T00:44:46.156Z",
"id": 217,
"totalNotes": 0
}
}
{
"error": "rateLimited",
"message": "Rate limit exceeded. Please retry after 1669048687"
}
{
"statusCode": 200,
"message": "user fetched",
"data": {
"email": "[email protected]",
"name": "Jon doe",
"createdAt": "2024-05-05T00:44:46.156Z",
"updatedAt": "2024-05-05T00:44:46.156Z",
"id": 217,
"totalNotes": 0
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/notes
Content-Type | Value |
---|---|
x-auth-token | {{token}} |
{
"title": "Random",
"content": "Random stuff",
"priority": "MEDIUM",
"category": ["work", "play"]
}
{
"statusCode": 201,
"message": "note created",
"data": {
"id": 72,
"title": "random",
"content": "Random stuff",
"status": "INCOMPLETE",
"userId": 219,
"priority": "MEDIUM",
"createdAt": "2024-05-05T11:26:57.729Z",
"updatedAt": "2024-05-05T11:26:57.729Z"
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/notes
Content-Type | Value |
---|---|
x-auth-token | {{token}} |
{
"statusCode": 200,
"message": "notes fetched",
"data": [
{
"id": 72,
"title": "random",
"content": "Random stuff",
"status": "INCOMPLETE",
"userId": 219,
"priority": "MEDIUM",
"createdAt": "2024-05-05T11:26:57.729Z",
"updatedAt": "2024-05-05T11:26:57.729Z",
"categories": [
{
"name": "play",
"id": 124
},
{
"name": "work",
"id": 125
}
]
}
]
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/notes/:id
{
"status": "COMPLETE"
}
{
"statusCode": 200,
"message": "note updated",
"data": {
"id": 72,
"title": "random",
"content": "Random stuff",
"status": "COMPLETE",
"userId": 219,
"priority": "MEDIUM",
"createdAt": "2024-05-05T11:26:57.729Z",
"updatedAt": "2024-05-05T11:35:46.971Z"
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/user
{
"name": "John doe"
}
{
"statusCode": 200,
"message": "user updated",
"data": {
"id": 219,
"name": "John doe",
"email": "[email protected]",
"password": "$2b$10$XJbIfv9dRdQCAnYzyVKeh.gjcJ1QOUlI0KFM/C824WBkiC95iA9VG",
"createdAt": "2024-05-05T11:12:55.668Z",
"updatedAt": "2024-05-05T11:36:24.367Z"
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/notes/:id
{
"statusCode": 200,
"message": "note deleted",
"data": {
"id": 72,
"title": "random",
"content": "Random stuff",
"status": "COMPLETE",
"userId": 219,
"priority": "MEDIUM",
"createdAt": "2024-05-05T11:26:57.729Z",
"updatedAt": "2024-05-05T11:35:46.971Z"
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/user
{
"statusCode": 200,
"message": "user deleted",
"data": true
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃
{{baseUrl}}/notes/:id
Content-Type | Value |
---|---|
x-auth-token | {{token}} |
{
"statusCode": 200,
"message": "note fetched",
"data": {
"id": 72,
"title": "random",
"content": "Random stuff",
"status": "INCOMPLETE",
"userId": 219,
"priority": "MEDIUM",
"createdAt": "2024-05-05T11:26:57.729Z",
"updatedAt": "2024-05-05T11:26:57.729Z"
}
}
This guide explains how to pull and run the Memoer application using Docker. Memoer is a Node.js application that can be easily deployed using Docker.
Before you start, ensure you have the following installed:
- Docker (Make sure Docker is running)
First, pull the latest Docker image for Memoer from Docker Hub using the following command:
docker docker pull jefedcreator/memoer
To run the server:
docker run -d -p 3000:3000 jefedcreator/memoer
After running the container, the Memoer application will be accessible at: http://localhost:3000
To test the authentication service, use the following command:
yarn test:auth
To test the user service, use the following command:
yarn test:user