How jangirdnick/perpx works
PERPX is a research-and-collaboration chat platform. A user signs in, starts a personal or space chat, and sends a message; the API handles real-time chat and AI research responses, while the client displays streamed messages and maintains chat history. Users can also manage spaces, upload files for image attachments or document RAG, and manage their account. The README documents AI providers and integrations; some connections to those integrations are therefore documented rather than verified from sampled implementation. The API service layer and storage adapters are shown separately.
Main entry points: auth.service.ts Auth service · page.tsx Web experience · useChat.ts Chat state and stream · useSpaceChat.ts Space chat state
Components 25
Web client
- Web experience
apps/web/src/app/(dashboard)/page.tsx - Auth flows
apps/web/src/modules/auth/hooks/useAuth.ts - Chat state and stream
apps/web/src/modules/chat/hooks/useChat.ts - Space chat state
apps/web/src/modules/chat/hooks/useSpaceChat.ts - Shared API types
packages/shared/types/api.type.ts
Identity and profiles
- Auth endpoints
apps/api/src/auth/auth.controller.ts - Auth service
apps/api/src/auth/auth.service.ts - JWT auth guard
apps/api/src/auth/guards/auth.guard.ts - User profiles
apps/api/src/user/user.service.ts - Verification email
apps/api/src/email/email.service.ts
Chat and AI
- Chat endpoints
apps/api/src/chat/chat.controller.ts - Chat service
apps/api/src/chat/chat.service.ts - Realtime gateway
apps/api/src/chat/chat/chat.gateway.ts - AI research service
apps/api/src/api/api.service.ts - Message history
apps/api/src/message/message.service.ts
Spaces and files
- Space management
apps/api/src/space/space.service.ts - File uploads
apps/api/src/upload/upload.service.ts
Data and integrations
- PostgreSQL
apps/api/src/prisma/prisma.service.ts - Redis cache
apps/api/src/redis/redis.service.ts - Vector retrieval
apps/api/src/vector/vector.service.ts - AI model providers
- Web search
- AWS S3
- Resend
Other components
- User
Connections 29
- User → Web experience: uses
- Web experience → Auth flows: signs in
- Web experience → Chat state and stream: starts chat
- Web experience → Space chat state: uses spaces
- Auth flows → Auth endpoints: HTTP requests
- Chat state and stream → Chat endpoints: HTTP requests
- Space chat state → Chat endpoints: HTTP requests
- Chat state and stream → Realtime gateway: WebSocket events
- Space chat state → Realtime gateway: WebSocket events
- Auth endpoints → Auth service: delegates
apps/api/src/auth/auth.controller.ts - Auth service → User profiles: uses
apps/api/src/auth/auth.service.ts - Auth service → Verification email: sends verification
apps/api/src/auth/auth.service.ts - Auth service → PostgreSQL: reads and writes
apps/api/src/auth/auth.service.ts - Auth service → Resend: sends email
- Chat endpoints → JWT auth guard: guards routes
apps/api/src/chat/chat.controller.ts - Chat endpoints → Chat service: delegates
apps/api/src/chat/chat.controller.ts - Chat service → PostgreSQL: persists chats
apps/api/src/chat/chat.service.ts - Realtime gateway → AI research service: dispatches prompts
- Realtime gateway → Message history: persists messages
- AI research service → AI model providers: generates responses
- AI research service → Web search: augments research
- AI research service → Vector retrieval: retrieves documents
- Vector retrieval → AI model providers: embeddings
- Chat state and stream → Shared API types: uses response types
apps/web/src/modules/chat/hooks/useChat.ts - Space chat state → Shared API types: uses response types
apps/web/src/modules/chat/hooks/useSpaceChat.ts - Space management → PostgreSQL: stores spaces
- File uploads → AWS S3: uploads files
- JWT auth guard → Redis cache: reads and caches users
apps/api/src/auth/guards/auth.guard.ts - JWT auth guard → PostgreSQL: loads user
apps/api/src/auth/guards/auth.guard.ts