Skip to content

Server Development & Testing

The apps/server package powers the NexisChat backend. Use this guide when you need to spin it up locally or run the Vitest-based test suite.

Terminal window
npm install
npm run dev
open http://localhost:3000

These commands install dependencies, start the development server, and open the default landing page in your browser.

Tests require a PostgreSQL instance. The quickest option is Docker:

Terminal window
docker run -d \
--name nexischat-test-db \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=nexis_chat_test \
-p 5432:5432 \
postgres:16-alpine
Terminal window
pnpm test

Tests load configuration from .env.test. Create it from .env.example if it is missing. The most important values are:

  • DATABASE_URL: PostgreSQL connection string (default postgres://postgres:postgres@localhost:5432/nexis_chat_test).
  • CI=true: Skips strict environment validation during automated runs.
  • NODE_ENV=test: Ensures the app boots in test mode.

With the database running and the environment file in place, pnpm test will exercise all server unit and integration tests.