Skip to content

areasflavio/task-app-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task-App-Server

tasked

This is the backend for a task/to-do app that was develop using NodeJS, Express and MongoDB.

GitHub top language GitHub language count GitHub last commit

Features  |   API Reference  |   Technologies  |   Installation

⭐ Features

(Back to top)

This is a complete application for a task/to-do app. You can create your account, and start following your tasks.

The main actions as create, update and delete are implemented for users and tasks.

Some key features are:

  • Password are encrypted with Bcrypt package.
  • Authenticated routes using JWT Token.
  • Codebase is cover by tests with Jest and supertest.
  • Avatar upload for your user.
  • Email service for welcome and goodbye messages are connected using Nodemailer.

The application is built using Node.JS with Express framework. The database is the MongoDB. The entire codebase is written using Javascript.

Checkout the API Live version hosted on:

Heroku

You also can check the complete Application Live version hosted on:

Vercel


The email service I used suspends the KEY if don't use it regularly, so if you don't get any emails it's because of that.


💻 API-Reference

(Back to top)

Get welcome message

  GET /

Users

Create a user

  POST /users
Body Type Description
name string Required. Name of the user
email string Required. Email of the user
password string Required. Password of the user

Login with a user

  POST /users/login
Body Type Description
email string Required. Email of the user
password string Required. Password of the user

Get a user avatar

  GET /users/:id/avatar
Parameter Type Description
id string Required. Id of the user

All next routes need authentication!


Logout with current user

  POST /users/logout

Logout for all places with current user

  POST /users/logoutAll

Get current user info

  GET /users/me

Update current user

  PATCH /users/me
Body Type Description
name string Optional. New name of the user
email string Optional. New email of the user
password string Optional. New password of the user

Delete current user

  DELETE /users/me

Add avatar for current user

  POST /users/me/avatar
Body Type Description
avatar file Required. Image file for use as avatar

Get current user avatar

  GET /users/me/avatar

Delete current user avatar

  DELETE /users/me/avatar

Tasks

Create a task

  POST /tasks
Body Type Description
description string Required. Description of the task

Get all the current user tasks

  GET /tasks

Get the details of a task

  GET /tasks/:id
Parameter Type Description
id string Required. Id of the task

Update a existing task

  PATCH /tasks/:id
Parameter Type Description
id string Required. ID of the task
Body Type Description
description string Optional. New description for the task
completed string Optional. Set task as completed

Delete a existing task

  DELETE /tasks/:id
Parameter Type Description
id string Required. ID of the task

⌨️ Technologies

(Back to top)

This is what i used and learned with this project:

  • Node.JS
  • Express
  • MongoDB
  • Mongoose
  • JWT
  • Bcrypt
  • Multer
  • Nodemailer
  • Jest
  • Supertest
  • Javascript

🖱️ Installation

(Back to top)

To use this project, first you need NodeJS and MongoDB running in your device, the mail service is optional, then you can follow the commands below:

# Clone this repository
git clone https://github.com/areasflavio/task-app-server.git

# Go into the repository
cd task-app-server

# Install dependencies for the backend
npm install

# Copy the .env.example to the .env file and inject your credentials
cp .env.example .env

# To start the express development server, run the following command
npm run dev

📝 License

(Back to top)

This project is under the MIT license. See the LICENSE for more information.

👨‍💻 Author

(Back to top)

Build by Flávio Arêas 👋 Get in touch!

Releases

No releases published

Packages

No packages published