Skip to content

MeowningMaster/task-manager-api

Repository files navigation

task-manager-api

Claimr technical assignment. Task description

Hosted API

API is hosted on Railway. Visit interactive documentation

Warning

Later description is outdated. There is bun, elysia, new IOC and configs, tests are broken

How to run

  1. Clone this repository
  2. Install Docker
  3. Copy config.docker.template.yaml file as config.docker.yaml
  4. (Optional) Provide .env file to change MySQL credentials in docker-compose.yml. Reflect changes to config.docker.yaml
  5. Run docker compose up -d
  6. Done! Visit documentation

Technical overview

  • REST server via Fastify
    • validation and documentation from one source via typebox
    • JWT authentification
    • rate limiting
    • pagination, filtering, and sorting for list queries
    • comprehensive error handling
    • graceful shutdown
  • Logging via pino
  • Simple inverse on control container
    • clean server components structure with automatic resolution
    • disable unnecessary dependencies during tests via partial
    • does not use decorators and reflect-metadata, so the server can be built via esbuild in future
  • MySQL & Drizzle ORM
    • describe database schema
    • powerful query builder
    • typescript types via inference
    • generate and run migrations
  • Email sender via NodeMailer
  • Redis & BullMQ
    • persistent scheduling of notifications
  • Unit tests via Vitest
  • Deployment via Github Actions. Workflow

Development setup

  • Install Volta
  • Install Node.js: volta install node
  • Install pnpm: volta install pnpm
  • Install dependencies: pnpm install
  • Copy config.template.yaml file as config.yaml
  • Setup MySQL and Redis, edit hosts and credentials in config.yaml

Now you can

  • Run project: pnpm start or launch debug in vscode
  • Run unit tests: pnpm test
  • Generate SQL migrations from database schemas: pnpm migrate