Development GuidePackage responsibilities

Package responsibilities

This page should answer the question: Which implementation belongs into which package of the monorepo? Currently, we have the following packages:

  • app
  • docs
  • lib
  • types
  • eslint-config
  • prettier-config

The challenge is to maintain separation of concerns for each package. The following sections list the responsibilities of each package.

app

  • the main application that consumes the lib, eslint-config, prettier-config & types package
  • Next.js pages that import components from lib and types from types
  • ESLint and Prettier apply the shared configuration from eslint-config and prettier-config
  • API implementation
  • application state
  • routing (via Next.js App Router)
  • error logging (via Sentry)
  • E2E tests (via Playwright)
  • unit tests (via Vitest)

docs (this)

  • documentation for the whole Essencium project
  • getting started
  • architecture
  • development guide
  • style guide

lib

  • single Next.js components
  • specific hooks
  • specific utility functions

types

  • shared types (‘shared’ means types that are used in app and lib together)
  • zod schemas

eslint-config

  • exports a ESLint config that is consumed by the other packages
  • is published as a npm package

prettier-config

  • exports a Prettier config that is consumed by the other packages
  • is published as a npm package