1.0.0-alpha.8 • Published 4 years ago

@usecheck/api v1.0.0-alpha.8

Weekly downloads
18
License
-
Repository
-
Last release
4 years ago

api.usecheck.com

Please Note: The current code is written quick and dirty. Final implementation with tests and better structure will be a future iteration.

Status

Code

  • Q&D implementation
  • Final implementation
  • Authentication
  • Authorization
  • Error handling
  • Validation
  • Test cases
  • Rate Limiting
  • Query size Limit
  • CI
  • CD

Database

  • Caching Layer: Redis
  • Persistence Layer: Postgres

Types

  • DateTime
  • Void
  • Direction

User

  • id
  • updatedAt
  • updatedBy
  • createdAt
  • createdBy
  • deletedAt
  • deletedBy
  • archivedAt
  • archivedBy
  • avatarUrl
  • name
  • email

Tag

  • id
  • updatedAt
  • updatedBy
  • createdAt
  • createdBy
  • deletedAt
  • deletedBy
  • color
  • title

Comment

  • id
  • updatedAt
  • updatedBy
  • createdAt
  • createdBy
  • deletedAt
  • deletedBy
  • message
  • task

Task

  • id
  • updatedAt
  • updatedBy
  • createdAt
  • createdBy
  • deletedAt
  • deletedBy
  • archivedAt
  • archivedBy
  • tags
    • items
    • count
  • isComplete
  • isFlagged
  • title
  • description
  • dueAt
  • assignedUser
  • subtasks
    • tasksOpen
      • items
      • count
    • tasksComplete
      • items
      • count
    • tasksCount
  • project
  • folder
  • parentTask
  • comments
    • items
    • count

Project

  • id
  • updatedAt
  • updatedBy
  • createdAt
  • createdBy
  • deletedAt
  • deletedBy
  • archivedAt
  • archivedBy
  • tags
    • items
    • count
  • title
  • tasksOpen
    • items
    • count
  • tasksComplete
    • items
    • count
  • folder

Folder

  • id
  • updatedAt
  • updatedBy
  • createdAt
  • createdBy
  • deletedAt
  • deletedBy
  • archivedAt
  • archivedBy
  • tags
    • items
    • count
  • title
  • projects
    • items
    • count
  • tasksOpen
    • items
    • count
  • tasksComplete
    • items
    • count

Trash

  • tasks
    • items
    • count
  • projects
    • items
    • count
  • folders
    • items
    • count

Queries

  • whoami
  • user
  • task
  • tag
  • tags
    • items
    • count
  • project
  • projects
    • items
    • count
  • folder
  • folders
    • items
    • count
  • inbox
    • tasksOpen
      • items
      • count
    • tasksComplete
      • items
      • count
    • tasksCount
  • flagged
    • tasksOpen
      • items
      • count
    • tasksComplete
      • items
      • count
    • tasksCount
  • today
    • tasksOpen
      • items
      • count
    • tasksComplete
      • items
      • count
    • tasksCount
  • tomorrow
    • tasksOpen
      • items
      • count
    • tasksComplete
      • items
      • count
    • tasksCount
  • trash
  • all
    • tasksOpen
      • items
      • count
    • tasksComplete
      • items
      • count
    • tasksCount

Mutations

Auth

  • sendMagicLink
  • authenticate

User

  • updateUser
  • archiveUser
  • restoreUser
  • deleteUser

Tag

  • createUser
  • updateUser
  • deleteUser

Task

  • createTask
  • updateTask
  • archiveTask
  • restoreTask
  • deleteTask
  • assignTask
  • completeTask
  • uncompleteTask
  • flagTask
  • unflagTask
  • addTagToTask
  • removeTagFromTask
  • addSubtaskToTask
  • removeSubtaskFromTask
  • moveSubtask
  • moveTaskToProject
  • moveTaskToFolder
  • moveInboxTask
  • moveFlaggedTask

Comment

  • createComment
  • updateComment
  • archiveComment
  • restoreComment
  • deleteComment

Project

  • createProject
  • updateProject
  • archiveProject
  • restoreProject
  • deleteProject
  • addTagToProject
  • removeTagFromProject
  • moveProjectToFolder
  • moveProjectTask
  • moveProject

Folder

  • createFolder
  • updateFolder
  • archiveFolder
  • restoreFolder
  • deleteFolder
  • addTagToFolder
  • removeTagFromFolder
  • moveFolderTask
  • moveFolder

Getting started

First clone the repository and install dependencies.

$ git clone https://github.com/usecheck/api.usecheck
$ npm ci
$ npm run start

Install and start redis server

Start local server

$ npm run dev

Generating types

The next step is updating the generated types like following:

$ npm run generate:types

Model

A model represents a type and handles the async loading of its properites

Repositories

A repository handles the read and write logic for queries and mutations