Git Product home page Git Product logo

taskr's Introduction

Taskr

This repo hosts the code for a Task App that uses a REST API to allow users to perform operations to a MongoDB database in the backend.

Before Deployment

Dependencies

  • Run npm install to install all required dependencies.

  • Create a config directory under the root directory dev.env file for the dev server and add the private API_KEYS test.env file for the test server and add the private API_KEYS

    Note: Remember to add these files to gitignore

  • Run npm run dev to start the dev server

  • Run npm run test to start the test server

  • Run npm start to start the prod server

  • Visit localhost:3000 in a browser window to access the REST API

Database

  • The API uses a MongoDB cloud cluster as its production database.
  • Here's a basic ERD for my DB

ERD Diagram

API Endpoints

User Model

  • GET User /users/me

  • GET User by Id /users/id

  • POST Create User /users

  • POST Login User /users/login

  • POST logout User /users/logout

  • POST Logout All /users/logoutAll

  • PATCH Update User /users/me

  • DELETE Delete User /users/me

  • POST Upload/Update Avatar /users/me/avatar

  • DELETE Delete Avatar /users/me/avatar

Task Model

  • GET Task by Id /tasks/id

  • GET Tasks /tasks?sortBy=createdAt:asc/desc&

  • POST Create Task /tasks

  • PATCH Update Task /tasks/id

  • DELETE Delete Task /tasks/id

API Docs

API doc generated using POSTMAN and can be found here!

Concepts learned:

  • MongoDB and Mongoose
  • Promises
  • REST API
  • Promise Chaining
  • Async/Await
  • Authentication using JWT
  • Middleware
  • API Testing with Postman
  • Postman Env Set-up & Auth Set-up
  • Software Testing with Jest
  • Pagination/Sorting
  • File Uploads

Deployment

The app is deployed to Heroku!

taskr's People

Contributors

dependabot[bot] avatar siddharthpk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.