GithubHelp home page GithubHelp logo

taskmate's Introduction

Taskmate by Group 7

Prerequisites

  • npm installed
  • IDE eg vscode
  • CLI eg postman

How to start code

  1. Clone or Download repositry
  2. Setup .env file => port, mongo_uri, jwt _secret
  3. run npm install
  4. run npm start

Post-it is ready for use

Live Server @render

Render Live

Postman Documentation

Postman Docs

Model Diagram

Diagrams on dbdiagrams.io

Design Pattern

For this API layered_structure was abopted for the main purpose of creating all the files in an order that could acomodate the rest easily. This structure was optimized as scalable and the best for the project decided by the developer.

Developer: "If I can get one path right, then the rest would be cake"

Soft Delete

This feature was implemented by adding an extra attribute to the Postit model called deleted Posts

{
    "post": "Soft delete feature",
    "ownerID": "640a12d5f6020fee349f8219",
    "deleted": false    // default: false
}

the delete http request in the controller is set to PATCH => updates deleted attribute in the post to true. Posts

{
    "post": "Soft delete feature",
    "ownerID": "640a12d5f6020fee349f8219",
    "deleted": true
}

Validations

Joi Validation Joi validation was used as my schema validator to validate all req.body data sent sent by the user to match my model before being sent to controller.js for use.

JWT jwt token for login authorization and specification too

installed jsonwebtoken

POSTMAN Features Adopted

Environment

Used postman environment to keep url paths neat and simple
  • env name => DEV: TaskMate
  • variable => USER // {{USER}}
  • initial value => localhost:3838/api/v1/users/

Set an Environment Variable

Automate authorizstion setting by setting your `jwt_token` to this an _env variable_ 

ref: Youtube Video - time @7:46:45

Error Handler

All route endpoints stored in `try/catch` to hold asyn and sync errors
API probed to remain active under all circumstance.
Ready for Deployment

User AvatarUrl / Image Tag

A special feature was adopted in this api, giving a unique avatar to all users with information drafter from their provided details, this feature was made possible using dicebear api to generate random avatars and return an avatar url. Image Tag was included in the user model to hold a html img tag for the avatar url.

Avatar

img_tag: "<img src="${avatarUrl}" alt="Avatar image for profile picture" />"

taskmate's People

Contributors

okafor-ifeanyi avatar simplycruise avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

simplycruise

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.