Skip to content

DeadOce4n/suprachat-server

Repository files navigation

Suprachat Backend

pipeline status coverage report code style

This is a very simple REST-ish API for managing user accounts on SupraChat's IRC network. It allows account registration on the IRC daemon through the draft/account-registration capability. It's written entirely in TypeScript.

Built with:

And many more awesome, open source tools and libraries!

Development environment

Pre-requisites

OS dependencies:

  • Node.js >= 18.16
  • PNPM >= 8

You'll also need to copy .env.example into .dev and replace its contents according to your use case.

# install dependencies
pnpm install

# Start server in development mode
pnpm dev

The server's API docs can be accessed at http://localhost:3000/docs (change the port to whatever you've chosen).

Running tests

Run tests in watch mode to get instant feedback (powered by vitest):

pnpm test

Run tests with coverage reporting:

pnpm coverage

Linting, formatting and type-checking

This project uses pre-commit hooks (powered by husky), so you should not have to run these manually:

# Lint and fix fixable
pnpm lint

# Only check for errors
pnpm lint:check

# Format and fix
pnpm format

# Only check for style issues
pnpm format:check

This project uses tsx as its runtime, so transpiling to JS is not necessary. tsc is only used for type-checking (both in CI and in your IDE as you code), but can be run manually:

pnpm typecheck

Pipeline testing

This project uses Dagger, which means CI/CD can be tested locally with the following command:

pnpm dagger

Pro tip: install the Dagger CLI and use dagger run pnpm dagger instead to get fancier terminal output