π’ Technical Handbookο
π 1. Welcome & Visionο
Purpose of This Handbookο
Define how we build software.
Ensure consistency, quality, and alignment across all teams.
Serve as onboarding documentation for new engineers.
Engineering Principlesο
We build using clean architecture across all stacks.
We prioritize maintainability over speed.
We automate tests, deployments, and repetitive workflows.
We invest in readability and clarity.
Security is everyoneβs responsibility.
π 2. Tech Stack Overviewο
Frontendο
Next.js (App Router)
TanStack Query for async state
Zustand or Redux Toolkit for client state
TailwindCSS for styling
shadcn/ui for components
Clean Architecture applied with:
presentation layer
domain layer
application layer (services, hooks)
infrastructure layer (API clients)
Backendο
NestJs + TypeScript
Clean Architecture
TypeORM
PostgreSQL
MongoDB (when document DB needed)
Docker & Docker Compose
REST API architecture
Toolingο
GitHub / GitHub Actions
Docker
Postman / Insomnia
Vercel / Railway / DigitalOcean
π 3. Project Structure Guidelinesο
Frontend (Next.js)ο
Folder Structureο
Check the template repository for clean architecture on frontend:
https://github.com/kaeyros-analytics-org/nextjs-starter-template
Rulesο
Keep components small and pure.
No business logic in UI components.
All server communication through application services.
React Server Components for data-fetching when possible.
State Managementο
Use TanStack Query for data-fetching state.
Use Zustand or Redux Toolkit for UI/ephemeral/local state.
Backend (NestJs + Clean Architecture)ο
Folder Structureο
Check the template repository for clean architecture on Backend:
Rulesο
Controllers must not contain business logic.
Use cases contain business rules.
Repositories implement domain contracts.
TypeORM models stay in the infrastructure layer.
DTOs validate all incoming/outgoing data.
π 4. Coding Standardsο
TypeScript Rulesο
Always enable
strict: true.
Naming Conventions on frontendο
Files:
PascalCaseReact components:
PascalCaseVariables:
camelCaseClasses:
PascalCaseFolders:
snake-case
Naming Conventions on backendο
Files:
snake-caseVariables:
camelCaseClasses:
PascalCaseFolders:
snake-case
Error Handlingο
Backend uses standardized Error classes.
Frontend uses
useErrorBoundarywhen needed.Never swallow errors.
π 5. Git Workflowο
Branching Modelο
mainβ productiondevelopβ stagingfeature/<name>β featuresbugfix/<name>β fixeshotfix/<name>β urgent production fixes
Commit Style (Conventional Commits)ο
feat: add user loginfix: correct email validationrefactor: simplify auth servicechore: update dependenciesdocs: update README
Pull Request Rulesο
Small PRs only
Must include description
At least 1 reviewer required
CI must pass before merge
π 6. Architecture Standardsο
Clean Architecture Guidelinesο
Domain contains entities + domain logic only.
Application holds use cases + orchestrates domain.
Infrastructure contains external services (DB, APIs).
Presentation handles user interaction.
Database Policyο
PostgreSQL for relational data.
MongoDB for document/event data.
TypeORM as unified data access layer.
Cachingο
Avoid caching unless necessary.
Use Redis (optional future expansion).
π 7. Security Guidelinesο
API Securityο
JWT Access/Refresh tokens
Rate limiting required on all auth routes
Validate all input using DTOs
Data Protectionο
Never commit
.envfilesUse Hashing for passwords (bcrypt)
Use HTTPS everywhere
π 8. Testing Standardsο
Types of Testsο
Unit tests (Jest)
Integration tests
E2E tests (Playwright or similar)
Expectationsο
Critical use cases must have test coverage
Backend services tested against test containers
π 9. DevOps & CI/CDο
Environmentsο
Local
Staging
Production
CI/CD Rulesο
Lint β Test β Build β Deploy
PR must pass all steps
Docker Standardsο
Every backend project includes a
DockerfileLocal setup uses
docker-composeto spin up DB services
Example docker-compose includes:
postgres
mongo
pgadmin (optional)
api service
π 10. Documentation & Onboardingο
README Templateο
Overview
Folder structure
How to run project locally
API documentation
Environment variable list
New Developer Onboardingο
Install required tools
Clone repos
Run
docker-compose upRequest access to secrets and platforms
π 11. Communication & Team Processesο
Daily standups
Sprint planning every 2 weeks
Retros every sprint
Use Teams for async communication
Use GitHub issues for task tracking
π 12. Quality & Performanceο
UI/UX Qualityο
Use shadcn components before writing custom ones
Ensure responsiveness
Follow design system
Performanceο
Use RSC for heavy data fetching
Use TanStack Query caching wisely
Avoid over-fetching on frontend
Use DB indexes on backend
π 13. Appendixο
Glossary
ADR (Architecture Decision Record) templates
Coding examples
Boilerplate repositories
βοΈ End of Templateο
You can now fill this section-by-section directly in Notion. Add toggles, subpages, or callouts to make the structure more interactive.