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.
Local Development
Section titled “Local Development”npm installnpm run devopen http://localhost:3000These commands install dependencies, start the development server, and open the default landing page in your browser.
Testing
Section titled “Testing”Prerequisites
Section titled “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
Section titled “Run the Suite”pnpm testTest Environment Variables
Section titled “Test 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.