Server
Server Development & Testing
How to run the NexisChat server locally and execute the automated test suite with the required PostgreSQL dependencies.
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.
Local Development
npm install
npm run dev
open http://localhost:3000These commands install dependencies, start the development server, and open the default landing page in your browser.
Testing
Prerequisites
Tests require a PostgreSQL instance. The quickest option is Docker:
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-alpineRun the Suite
pnpm testTest Environment Variables
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 (defaultpostgres://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.