NestJS backend for StellarSplit - a crypto-powered bill splitting application.
- Node.js 18+
- PostgreSQL 12+
- npm
-
Install dependencies:
npm install
-
Configure environment variables:
cp .env.example .env
Edit
.envwith your database credentials and configuration. -
Build the project:
npm run build
-
Start the application:
# Development with live reload npm run dev:watch # Or production build npm run start
The API will be available at http://localhost:3000
Once the application is running, visit:
- Swagger UI: http://localhost:3000/api/docs
- OpenAPI JSON: http://localhost:3000/api-docs
src/
├── main.ts # Application entry point
├── app.module.ts # Root application module
├── config/ # Configuration modules
│ ├── app.config.ts # Application configuration
│ └── database.config.ts # Database configuration
├── database/ # Database configuration and utilities
│ └── typeorm.config.ts # TypeORM configuration
└── modules/ # Feature modules
└── health/ # Health check module
├── health.controller.ts
├── health.service.ts
└── health.module.ts
Create a .env file in the backend root directory:
# Server
NODE_ENV=development
PORT=3000
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_NAME=stellarsplit_dev
DB_SYNCHRONIZE=true
DB_LOGGING=false
# Swagger
SWAGGER_PATH=/api/docs
SWAGGER_TITLE=StellarSplit API
SWAGGER_DESCRIPTION=API for StellarSplit - Split bills instantly with crypto
SWAGGER_VERSION=1.0.0GET /health
Returns the API health status:
{
"status": "ok",
"timestamp": "2026-01-21T12:00:00.000Z",
"uptime": 123.456
}@nestjs/core- NestJS core framework@nestjs/common- Common NestJS utilitiesreflect-metadata- Metadata reflection APIrxjs- Reactive programming library
@nestjs/typeorm- TypeORM integration for NestJStypeorm- ORM for database managementpg- PostgreSQL driver
@nestjs/config- Configuration managementdotenv- Environment variable loading
class-validator- Data validation decoratorsclass-transformer- DTO transformation
@nestjs/swagger- Swagger/OpenAPI integration
typescript- TypeScript compilerts-node- Execute TypeScript directlynodemon- Auto-reload on file changes
npm run build- Build the project for productionnpm run start- Run the built applicationnpm run dev- Run the application in development modenpm run dev:watch- Run with auto-reload on file changesnpm test- Run tests (not yet configured)
The application uses PostgreSQL with TypeORM. On first run with DB_SYNCHRONIZE=true, the database schema will be automatically created.
# If running PostgreSQL locally
psql -U postgres -d stellarsplit_dev✅ NestJS project initialized
✅ TypeORM connected to PostgreSQL
✅ Environment variables loaded
✅ Health check endpoint returns 200
✅ Swagger API docs configured
✅ Backend starts without errors
See CONTRIBUTING.md for development guidelines.
See LICENSE for licensing information.