You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Questify is a modular Q&A backend API built with NestJS and TypeScript for collaborative learning and discussion workflows.
It provides JWT-based authentication, role-based permissions (STUDENT and INSTRUCTOR), and complete management of questions, answers, comments, attachments, and notifications.
The platform also includes domain-event-driven notifications and Redis caching to improve performance while keeping question data consistent after updates.
🛠️ Tech Stack
Category
Technology
Runtime
Node.js
Language
TypeScript
Framework
NestJS
Validation
Zod, custom Zod pipe
Authentication
Passport JWT, @nestjs/jwt
Authorization
Roles decorator + RolesGuard
Database
PostgreSQL
ORM / Data Access
Prisma Client + Prisma PG Adapter
Caching
Redis (ioredis), cache abstraction layer
Eventing
@nestjs/event-emitter
Storage integration
Firebase Admin SDK (default), fake provider for tests/local scenarios
npm run test
npm run test:unit
npm run test:integration
npm run test:e2e
npm run test:cov # TODO: Add information
npm run test:watch
npm run test:coverage
npm run test:ui
Note: The script available in this repository is test:coverage (not test:cov).
📜 Available Scripts
Script
Description
npm run build
Compile NestJS application to dist
npm run format
Format source and test files with Prettier
npm run start
Start application
npm run start:dev
Start application in watch mode
npm run start:debug
Start application in debug + watch mode
npm run start:prod
Run compiled application from dist/main
npm run lint
Run ESLint with autofix
npm run test
Run full test suite (unit + integration + e2e)
npm run test:unit
Run unit tests
npm run test:integration
Run integration tests
npm run test:e2e
Run end-to-end tests
npm run test:watch
Run unit tests in watch mode
npm run test:coverage
Run unit tests with coverage report
npm run test:ui
Run Vitest UI for unit tests
🚢 Deployment
Production flow
Set production environment variables (NODE_ENV=production, database, Redis, JWT, storage credentials).
Build the project:
npm ci
npm run build
Apply database migrations:
npx prisma migrate deploy
Start the application:
npm run start:prod
Production considerations
Use a dedicated PostgreSQL instance and separate test database.
Use a dedicated Redis instance and separate logical DB/index for non-production contexts.
Manage secrets using a secure secret manager.
Ensure TLS termination at ingress/reverse proxy.
Add monitoring/logging and health checks.
Configure CORS and rate limiting according to your deployment requirements.
🤝 Contributing
Branch naming
Feature: feature/<short-description>
Fix: fix/<short-description>
Chore: chore/<short-description>
Commit convention
Recommended: Conventional Commits
feat: add cache invalidation listener
fix: handle notification race condition in e2e
docs: update environment variable table
Pull Request flow
Create a branch from the main development branch.
Implement changes with tests.
Run lint, build, and relevant test commands locally.
Open PR with clear context, screenshots/logs if applicable, and testing evidence.
Request review and address feedback before merge.
About
Scalable Q&A backend built with NestJS, Prisma, PostgreSQL, Redis, and JWT, featuring RBAC, notifications, and attachment management.