Tech Specification
Technical specification for the RawStack API component.
| |
|---|
| Language | TypeScript |
| Runtime | Node.js 22 |
| Framework | NestJS v11 |
| Port | 3001 |
| Package | Purpose |
|---|
@nestjs/cqrs | Command/Query bus and event bus |
@nestjs/jwt | JWT token signing and verification |
passport-jwt | JWT strategy for Passport |
@prisma/client | Database ORM |
ioredis | Redis client |
argon2 | Password hashing |
zod | Runtime schema validation |
nest-commander | CLI commands (e.g. migrations) |
dayjs | Date utilities |
| Column | Type | Notes |
|---|
id | UUID | Primary key |
email | String | Unique |
hash | String | Argon2 hashed password |
roles | Enum[] | ADMIN, VERIFIED_USER |
createdAt | DateTime | |
updatedAt | DateTime | |
deletedAt | DateTime | Soft delete |
| Column | Type | Notes |
|---|
id | UUID | Primary key |
tokenHash | String | Unique hashed token value |
userId | UUID | Foreign key → Users |
type | Enum | LOGIN, PASSWORD_RESET, EMAIL_VERIFICATION |
expiresAt | DateTime | |
# Database
DATABASE_URL=postgresql://user:pass@localhost:5434/rawstack
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# JWT
JWT_SECRET=your-strong-secret
ACCESS_TOKEN_TTL=900 # seconds
REFRESH_TOKEN_TTL=2592000 # seconds
# App
NODE_ENV=development
PORT=3001
Copy .env.dist to .env to get started.
| Service | Image | Port |
|---|
postgres | postgres:16 | 5434 |
redis | redis:7-alpine | 6379 |
postgres-test | postgres:16 | 5433 |
redis-test | redis:7-alpine | 6380 |