Luft Backend is a Node.js and TypeScript service for tracking user investments and balances. It exposes REST endpoints for user authentication, registering transactions and retrieving consolidated investment data.
- Express server using OvernightJS with TypeScript
- PostgreSQL database managed via Drizzle ORM
- Redis cache and scheduled jobs that refresh user balances every five minutes
- Integrates with the Brapi API to fetch stock and cryptocurrency prices
- Unit and integration tests with Jest
- Install dependencies:
yarn install
- Start required services:
docker-compose up -d db redis
- Provide environment variables (see below) in a
.envfile or your shell. - Run database migrations:
yarn db:migrate
- Development:
yarn start:dev
- Production build:
yarn start
| Variable | Description |
|---|---|
PORT |
Port for the HTTP server |
BRAPI_API_URL |
Base URL for the Brapi API |
BRAPI_API_TOKEN |
Authentication token for Brapi |
BRAPI_SIMULTANEOUS_REQUEST_LIMIT |
Max simultaneous requests to Brapi |
POSTGRES_URL |
PostgreSQL connection string |
REDIS_URL |
Redis connection string |
JWT_SECRET_KEY |
Secret key used to sign JWT tokens |
- Run all tests:
yarn test - Lint the codebase:
yarn lint
- Seed the database:
yarn db:seed
- Automatically fix lint issues:
yarn lint:fix
MIT