This is the Node.js API backend for Stellar, a modern, next-generation community content tracker and forum software.
- Runtime: Node.js (LTS)
- Framework: Express.js
- Database: PostgreSQL with Prisma ORM
- Validation: Zod (with OpenAPI generation)
- Testing: Jest & Supertest
See the stellar-compose repository for the fastest way to spin up a full instance of Stellar (API, UI, and Database) using Docker.
If you prefer to run the API directly on your local machine for development:
- Node.js (LTS version)
- A running PostgreSQL instance
git clone https://github.com/orphic-inc/stellar-api.git
cd stellar-api
npm installCopy .env.example to .env (or create one) and configure the following variables:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
Prisma connection string to your Postgres DB | postgresql://... |
STELLAR_AUTH_JWT_SECRET |
Secret for signing JWTs (must be securely set) | undefined |
STELLAR_LOG_LEVEL |
Winston log level (e.g., debug, info, error) | info |
STELLAR_HTTP_PORT |
API listening port | 8080 |
STELLAR_HTTP_CORS_ORIGIN |
Allowed CORS origin (usually the UI url) | http://localhost:3000 |
Before running the app, ensure your database schema is initialized and the Prisma Client is generated:
npx prisma migrate dev
npx prisma generateStart the server in development mode (with hot-reloading):
npm run devStellar relies on an OpenAPI specification to maintain type-safety between the API and the UI. When you make changes to Zod schemas or API routes, you must export the new OpenAPI spec:
npm run openapi:exportThis generates an openapi.json file in the project root. The stellar-ui repository will read this file to generate its frontend TypeScript types.
Run the test suite:
npm run testRun integration tests (requires a stellar_test database and .env.test file):
npm run test:integration