/todo-api

A robust api, for creating lists and tasks, plus all the functionality of login, password recovery and password reset, and account creation, created with nodejs in typescript using express

Primary LanguageTypeScriptMIT LicenseMIT

Logo

API to register tasks todo

GitHub top language Made by Repository size GitHub last commit Repository issues GitHub

About the project   |    Technologies   |    Getting started   |    How to contribute   |    License

👨🏻‍💻 About the project

This API allows you to create a user and log in, create lists and tasks, in addition to creating tasks for the current day or independent tasks. Project developed using TDD, in addition to being developed based on 3 entities, User, Task, List.

🚀 Technologies

Technologies that I used to develop this api

💻 Getting started

Import the Insomnia.json on Insomnia App

Requirements

Clone the project and access the folder

$ git clone https://github.com/imperadorxs/todo-api && cd todo-api

Follow the steps below

# Create a docker container postgres
# Change POSTGRES_PASSWORD
# if your have other container using postres change the first external port to 5436 or greather
$ docker run --name todo-api -e POSTGRES_PASSWORD=your-password -p 5432:5432 -d postgres

# Create a docker container redis
# if your have other container using redis change the first external port to 6380 or greather
$ docker run -d --name redis -e REDIS_PASSWORD= -p 6379:6379 redis:alpine

# Install the dependencies
$ yarn

# Make a copy of '.env.example' to '.env'
# and set with your environment variables
# remenber generate an md5 code at http://www.md5.cz/ and change the variable APP_SECRET

$ cp .env.example .env

# Make a copy of 'ormconfig.example.json' to 'ormconfig.json'
# and set with your database variables

$ cp ormconfig.example.json ormconfig.json

# Run the migrations and seeds
$ yarn typeorm migration:run

# Run this command to start the server in development mode
$ yarn dev:server

# to generate your build
# when you generate build remenber for change src to dist and ts to js in ormconfig.json
$ yarn build

# start aplication *NEED BUILD *
$ yarn start

# Well done, project is started!

👨🏻‍💻 Endpoints

User

  • /users: [ POST ] Sign up to create a new user.
  • /users/avatar: [ PUT ] To change a profile image.
  • /password/forgot: [ POST ] To generate a new token to reset password.
  • /password/reset: [ POST ] To use a token for reset password.
  • /profile: [ GET ] To get user profile data.
  • /profile: [ PUT ] To update use profile data.
  • /sessions: [ POST ] Sign in to get the access token.

Lists

  • /lists: [ GET ] Get all user lists.
  • /lists: [ POST ] Create a new list.
  • /lists: [ DEL ] Delete one user list.
  • /lists: [ PUT ] Update one user list.

Tasks

  • /tasks: [ GET ] Get all user tasks.
  • /tasks/scheduled: [ GET ] Get all user scheduled tasks.
  • /tasks/type: [ GET ] Get all user tasks by type.
  • /tasks/today: [ GET ] Get all user today tasks.
  • /tasks: [ POST ] Create a new task.
  • /tasks: [ DEL ] Delete one task.
  • /tasks: [ PUT ] Update one task.

🤔 How to contribute

  • Make a fork of this repository
# Fork using GitHub official command line
# If you don't have the GitHub CLI, use the web site to do that.

$ gh repo fork imperadorxs/todo-api
# Clone your fork
$ git clone your-fork-url && cd todo-api

# Create a branch with your feature
$ git checkout -b my-feature

# Make the commit with your changes
$ git commit -m 'feat: My new feature'

# Send the code to your remote branch
$ git push origin my-feature

After your pull request is merged, you can delete your branch

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with 💜  by Allan Santiago 👋 See my linkedin