Skip to content

Ugly playground for OTel with prisma and hateoas thrown in the mix

Notifications You must be signed in to change notification settings

joanna-liana/nestjs-otel

Repository files navigation

Median

A Medium clone using this Prisma tutorial as a starting point.

Installation

$ yarn install

Running the app

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Test

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

TODO

Expose a HATEOAS REST API - inspired by Julien Topçu's Crafting Domain-Driven Designed REST APIs talk and repo

  • start with creating an aritcle draft - POST /drafts (include a self link)
  • allow for publishing the draft if both title and description have content - POST /drafts/:draftId/publish (include a self link)
  • fetch published articles - GET /articles
  • fetch a selected published article - GET /articles/:articleId. Links:
    • self
    • stats - get the likes count and other metadata - GET /articles/:articleId/stats
    • like the article if it's not yours - POST /articles/:articleId/likes
    • unlike the article if it's already liked by you - DELETE /articles/:articleId/likes

Advanced features:

  • create another revision of the article (draft) - POST /articles/:articleId/nextVersion
  • fetch the revision if there is one GET /articles/:articleId/nextVersion
  • replace the published article with the revision - PUT /articles/:articleId

About

Ugly playground for OTel with prisma and hateoas thrown in the mix

Topics

Resources

Stars

Watchers

Forks