···11-# Architecture Overview
22-33-This project follows a three-layer architecture with clear separation of concerns and strong typing across boundaries.
44-55-## Layers
66-77-1. GraphQL (API Layer)
88- - Location: `apps/server/src/modules/**`
99- - Implements resolvers and GraphQL object types (classes)
1010- - GraphQL classes expose `fromDomain()` static factories to convert domain entities to API types
1111- - No database access; no business logic
1212-1313-2. Domain (Core Model Layer)
1414- - Location: `apps/server/src/modules/**/*.entity.ts`
1515- - Plain classes representing core business entities
1616- - Encapsulate business rules where appropriate
1717- - No framework-specific decorators except GraphQL field metadata on API classes
1818-1919-3. Persistence (Prisma Layer)
2020- - Location: Prisma client via `PrismaService`
2121- - No domain logic; pure data access
2222-2323-## Mapping Pattern
2424-2525-- Each entity has a dedicated Mapper service implementing `BaseMapper<PrismaModel, DomainEntity>`
2626-- Mappers are `@Injectable()` Nest providers
2727-- Services inject mappers and use them to convert from Prisma models to domain entities
2828-- GraphQL classes convert domain entities via `fromDomain()` when returning data
2929-3030-Example flow: Resolver -> Service -> Prisma -> Mapper.toDomain -> Domain -> GraphQLType.fromDomain
3131-3232-## Conventions
3333-3434-- Services accept and return domain entities (never Prisma models)
3535-- Mappers live alongside their entity modules, e.g. `organization.mapper.ts`, `vacancy.mapper.ts`
3636-- Modules must register mapper providers and export them if shared
3737-- Prefer constructor-based instantiation; avoid non-null assertions
3838-- Use bracket notation for `process.env["VAR"]` and `prisma["model"]`
3939-- Linting and formatting are enforced via Biome with `$schema` validation
4040-4141-## Current Mapper Implementations
4242-4343-- Auth: `user.mapper.ts` (already injectable)
4444-- Organization: `organization.mapper.ts` (injectable and used by `organization.service.ts`)
4545-- Organization Roles: `organization-role.mapper.ts` (injectable and used by `organization-role.service.ts`)
4646-- Vacancies: `vacancy.mapper.ts` (injectable and used by `vacancy.service.ts`)
4747-- Job Experience submodules (company/level/role/skill) include injectable mappers
4848-4949-## Docker & Tooling
5050-5151-- Node 22 for all images (client, server, compose client service)
5252-- Biome 2.2.6 with `$schema` and `files.includes` exclusions for `node_modules`, `dist`, `build`
5353-5454-## Testing
5555-5656-- E2E tests under `apps/server/test` exercise GraphQL endpoints against a test app
5757-- Tests expect services to return proper domain entities; GraphQL types handle API shaping
-68
CHANGELOG.md
···11-# Changelog
22-33-All notable changes to this project will be documented in this file.
44-55-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66-and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77-88-## [Unreleased]
99-1010-### Added
1111-- Initial project setup with NestJS backend and React frontend
1212-- Docker containerization with docker-compose
1313-- GraphQL API with Apollo Server
1414-- Authentication system with JWT tokens
1515-- Database schema with Prisma ORM
1616-- User management and organization features
1717-- Job experience tracking system
1818-- Company, role, level, and skill management
1919-- Toast notification system
2020-- Error boundary components
2121-- TypeScript configuration with strict settings
2222-- Biome linting and formatting configuration
2323-2424-### Changed
2525-- Improved configuration management using `getOrThrow()` instead of manual error throwing
2626-- Enhanced type safety by prohibiting non-null assertion operators (`!`)
2727-- Updated entity instantiation patterns to use constructor-based initialization
2828-- Improved error handling patterns throughout the codebase
2929-3030-### Fixed
3131-- Configuration validation issues
3232-- Type safety improvements
3333-- Build process optimization
3434-3535-### Security
3636-- Implemented secure JWT authentication
3737-- Added proper environment variable validation
3838-- Enhanced input validation with Zod schemas
3939-4040-## [0.1.0] - 2025-01-19
4141-4242-### Added
4343-- Initial project structure
4444-- Basic authentication flow
4545-- Core database entities
4646-- GraphQL schema definition
4747-- Docker development environment
4848-4949----
5050-5151-## Development Guidelines
5252-5353-### Commit Convention
5454-This project uses [Conventional Commits](https://www.conventionalcommits.org/) format:
5555-5656-- `feat:` A new feature
5757-- `fix:` A bug fix
5858-- `docs:` Documentation only changes
5959-- `style:` Changes that do not affect the meaning of the code
6060-- `refactor:` A code change that neither fixes a bug nor adds a feature
6161-- `perf:` A code change that improves performance
6262-- `test:` Adding missing tests or correcting existing tests
6363-- `chore:` Changes to the build process or auxiliary tools
6464-6565-### Versioning
6666-- **MAJOR** version when you make incompatible API changes
6767-- **MINOR** version when you add functionality in a backwards compatible manner
6868-- **PATCH** version when you make backwards compatible bug fixes
-209
ROADMAP.md
···11-# Roadmap
22-33-This document outlines the planned features and improvements for the CV Generator project. Items are organized by topic and prioritized for development.
44-55-## 🏢 B2C CV Builder Functionality
66-77-### Core Features
88-- [ ] **CV Templates & Design System**
99- - [ ] Create responsive CV templates
1010- - [ ] Implement design customization options
1111- - [ ] Add theme selection (professional, creative, minimal)
1212- - [ ] Support for multiple CV formats (chronological, functional, hybrid)
1313-1414-- [ ] **Content Management**
1515- - [ ] Rich text editor for CV sections
1616- - [ ] Drag-and-drop section reordering
1717- - [ ] Real-time preview functionality
1818- - [ ] Auto-save functionality
1919- - [ ] Version history and rollback
2020-2121-- [ ] **Export & Sharing**
2222- - [ ] PDF export with high-quality rendering
2323- - [ ] Multiple file format support (PDF, DOCX, HTML)
2424- - [ ] Shareable CV links
2525- - [ ] QR code generation for CV sharing
2626- - [ ] Social media integration
2727-2828-### Advanced Features
2929-- [ ] **AI-Powered Enhancements**
3030- - [ ] AI content suggestions and improvements
3131- - [ ] Keyword optimization for ATS systems
3232- - [ ] Skills gap analysis
3333- - [ ] Industry-specific recommendations
3434-3535-- [ ] **Analytics & Insights**
3636- - [ ] CV view tracking and analytics
3737- - [ ] Performance metrics dashboard
3838- - [ ] ATS compatibility scoring
3939- - [ ] Improvement suggestions
4040-4141-### User Experience
4242-- [ ] **Onboarding & Tutorials**
4343- - [ ] Interactive CV creation wizard
4444- - [ ] Step-by-step guidance system
4545- - [ ] Sample CV library
4646- - [ ] Video tutorials and help center
4747-4848-- [ ] **Mobile Experience**
4949- - [ ] Mobile-responsive design
5050- - [ ] Progressive Web App (PWA) features
5151- - [ ] Offline editing capabilities
5252- - [ ] Mobile-optimized export options
5353-5454----
5555-5656-## 🏢 B2B Solution for Managing Groups of Employees
5757-5858-### Organization Management
5959-- [ ] **Multi-tenant Architecture**
6060- - [ ] Organization hierarchy management
6161- - [ ] Role-based access control (RBAC)
6262- - [ ] Department and team structures
6363- - [ ] Custom organization branding
6464-6565-- [ ] **Employee Management**
6666- - [ ] Bulk employee import/export
6767- - [ ] Employee profile management
6868- - [ ] Skills inventory and tracking
6969- - [ ] Performance review integration
7070- - [ ] Employee directory with search and filtering
7171-7272-### HR Analytics & Reporting
7373-- [ ] **Workforce Analytics**
7474- - [ ] Skills gap analysis across organization
7575- - [ ] Employee development tracking
7676- - [ ] Career progression insights
7777- - [ ] Diversity and inclusion metrics
7878- - [ ] Retention and turnover analysis
7979-8080-- [ ] **Reporting Dashboard**
8181- - [ ] Custom report builder
8282- - [ ] Scheduled report delivery
8383- - [ ] Executive summary dashboards
8484- - [ ] Compliance reporting
8585- - [ ] Export capabilities (PDF, Excel, CSV)
8686-8787-### Integration & Automation
8888-- [ ] **HR System Integrations**
8989- - [ ] ATS (Applicant Tracking System) integration
9090- - [ ] HRIS (Human Resource Information System) sync
9191- - [ ] Learning Management System (LMS) integration
9292- - [ ] Performance management system integration
9393- - [ ] Single Sign-On (SSO) support
9494-9595-- [ ] **Workflow Automation**
9696- - [ ] Automated CV updates and reminders
9797- - [ ] Approval workflows for CV changes
9898- - [ ] Notification system for managers
9999- - [ ] Bulk operations and batch processing
100100- - [ ] API for custom integrations
101101-102102-### Compliance & Security
103103-- [ ] **Data Privacy & Security**
104104- - [ ] GDPR compliance features
105105- - [ ] Data encryption at rest and in transit
106106- - [ ] Audit logging and trail
107107- - [ ] Data retention policies
108108- - [ ] Backup and disaster recovery
109109-110110-- [ ] **Access Control**
111111- - [ ] Granular permission system
112112- - [ ] Multi-factor authentication (MFA)
113113- - [ ] Session management and timeout
114114- - [ ] IP whitelisting and restrictions
115115- - [ ] Admin console for system management
116116-117117----
118118-119119-## 📈 Advertising & Monetization Options
120120-121121-### Freemium Model
122122-- [ ] **Free Tier Features**
123123- - [ ] Basic CV templates (3-5 options)
124124- - [ ] Standard export formats (PDF only)
125125- - [ ] Limited customization options
126126- - [ ] Basic analytics and insights
127127- - [ ] Community support
128128-129129-- [ ] **Premium Tier Features**
130130- - [ ] Unlimited template access
131131- - [ ] Advanced customization tools
132132- - [ ] Multiple export formats (PDF, DOCX, HTML)
133133- - [ ] AI-powered content suggestions
134134- - [ ] Advanced analytics and ATS optimization
135135- - [ ] Priority customer support
136136-137137-### Enterprise Solutions
138138-- [ ] **B2B Subscription Tiers**
139139- - [ ] Small business package (up to 50 employees)
140140- - [ ] Medium enterprise package (up to 500 employees)
141141- - [ ] Large enterprise package (unlimited employees)
142142- - [ ] Custom enterprise solutions with dedicated support
143143-144144-### Revenue Streams
145145-- [ ] **Direct Monetization**
146146- - [ ] Subscription-based pricing models
147147- - [ ] Pay-per-use CV generation
148148- - [ ] Premium template marketplace
149149- - [ ] White-label solutions for partners
150150-151151-- [ ] **Partnership & Integration Revenue**
152152- - [ ] Job board partnerships and referrals
153153- - [ ] Recruitment agency integrations
154154- - [ ] HR software marketplace listings
155155- - [ ] Affiliate marketing programs
156156-157157-### Marketing & Growth
158158-- [ ] **User Acquisition**
159159- - [ ] SEO optimization for CV-related keywords
160160- - [ ] Content marketing strategy (CV tips, career advice)
161161- - [ ] Social media presence and engagement
162162- - [ ] Influencer partnerships and collaborations
163163- - [ ] Referral program implementation
164164-165165-- [ ] **Retention & Engagement**
166166- - [ ] Email marketing campaigns
167167- - [ ] In-app notifications and tips
168168- - [ ] Gamification elements (achievements, progress tracking)
169169- - [ ] Community features and forums
170170- - [ ] Regular feature updates and improvements
171171-172172----
173173-174174-## 🛠 Technical Infrastructure
175175-176176-### Platform & Scalability
177177-- [ ] **Performance Optimization**
178178- - [ ] Database query optimization
179179- - [ ] Caching strategies (Redis implementation)
180180- - [ ] CDN integration for static assets
181181- - [ ] Load balancing and auto-scaling
182182- - [ ] Performance monitoring and alerting
183183-184184-- [ ] **DevOps & Deployment**
185185- - [ ] CI/CD pipeline optimization
186186- - [ ] Automated testing (unit, integration, e2e)
187187- - [ ] Infrastructure as Code (IaC)
188188- - [ ] Blue-green deployment strategy
189189- - [ ] Monitoring and logging solutions
190190-191191-### Security & Compliance
192192-- [ ] **Security Enhancements**
193193- - [ ] Penetration testing and security audits
194194- - [ ] Vulnerability scanning and management
195195- - [ ] Security headers and CSP implementation
196196- - [ ] Rate limiting and DDoS protection
197197- - [ ] Security incident response plan
198198-199199-### Data & Analytics
200200-- [ ] **Data Infrastructure**
201201- - [ ] Data warehouse implementation
202202- - [ ] ETL processes for analytics
203203- - [ ] Real-time analytics pipeline
204204- - [ ] Data visualization tools
205205- - [ ] Machine learning model deployment
206206-207207----
208208-209209-*This roadmap is a living document and will be updated regularly based on user feedback, market research, and business priorities.*
···11-export { default as CloseIcon } from "./CloseIcon";
22-export { default as DeleteIcon } from "./DeleteIcon";
33-export { default as DocumentIcon } from "./DocumentIcon";
44-export { default as EditIcon } from "./EditIcon";
55-export { default as ErrorIcon } from "./ErrorIcon";
66-export { default as LinkIcon } from "./LinkIcon";
77-export { default as LoadingIcon } from "./LoadingIcon";
88-export { default as ToastIcon } from "./ToastIcon";
99-export { default as UploadIcon } from "./UploadIcon";
+2
apps/client/src/constants/auth.ts
···11export const AUTH_TOKEN_KEY = "auth_token" as const;
22+export const AUTH_REFRESH_TOKEN_KEY = "auth_refresh_token" as const;
33+export const AUTH_TOKEN_EXPIRY_KEY = "auth_token_expiry" as const;
24export const AUTH_USER_QUERY_KEY = ["auth", "user"] as const;
-4
apps/client/src/features/app/queries/app.graphql
···11-query Hello {
22- hello
33-}
44-51query Health {
62 health {
73 status
···11-query MeWithOrganizations {
22- me {
33- id
44- email
55- name
66- createdAt
77- organizations {
88- id
99- name
1010- description
1111- createdAt
1212- updatedAt
1313- users {
1414- id
1515- joinedAt
1616- role {
1717- id
1818- name
1919- description
2020- color
2121- }
2222- user {
2323- id
2424- name
2525- email
2626- createdAt
2727- experience {
2828- id
2929- startDate
3030- endDate
3131- description
3232- company {
3333- id
3434- name
3535- website
3636- }
3737- role {
3838- id
3939- name
4040- }
4141- level {
4242- id
4343- name
4444- }
4545- skills {
4646- id
4747- name
4848- }
4949- }
5050- }
5151- }
5252- }
5353- }
5454-}
···11-// UI Components
22-export { default as Button } from "./Button";
33-export { default as Checkbox } from "./Checkbox";
44-export { default as IconButton } from "./IconButton";
55-export { Select } from "./Select";
66-export { StatusBadge } from "./StatusBadge";
77-export * from "./Table";
88-export { default as Textarea } from "./Textarea";
99-export { default as TextInput } from "./TextInput";
-7
apps/client/src/utils/auth.ts
···11-import type { AuthResponse } from "@/types/auth";
22-33-export function handleAuthSuccess(user: AuthResponse["user"]) {
44- // Token storage is now handled by TokenProvider
55- // Apollo Client will handle caching automatically
66- console.log("User authenticated:", user);
77-}