How xbosanskyj1/angular-ai-in-depth works
This is a full-stack Angular AI chat application with a small Express API. Users sign up or sign in, enter an authenticated chat, start or continue conversations, and revisit conversation history. The graph includes the documented OpenAI integration and the data layer; route-handler internals were not sampled, so uncertain calls from those handlers are omitted.
Main entry points: server.ts Express server · auth.service.ts Auth service · app.routes.ts App routes · conversation.service.ts Conversation service
Components 29
Angular application
- App shell
src/app/app.ts - App routes
src/app/app.routes.ts - Home screen
src/app/home/home.ts - Conversation service
src/app/home/conversation.service.ts - Conversation thread
src/app/home/conversation-thread/conversation-thread.ts - Chat history UI
src/app/home/chat-history/chat-history.ts - History service
src/app/home/chat-history.service.ts - Side navigation
src/app/home/side-nav/side-nav.ts
Authentication
- Sign-in screen
src/app/auth/sign-in/sign-in.ts - Sign-up screen
src/app/auth/sign-up/sign-up.ts - Auth service
src/app/shared/auth/auth.service.ts - Auth guard
src/app/shared/auth/auth.guard.ts - Auth interceptor
src/app/shared/auth/auth.interceptor.ts - Profile service
src/app/shared/auth/user-profile.service.ts
API and conversations
- Express server
server/server.ts - Auth endpoints
server/routes/sign-in.ts - Sign-up endpoint
server/routes/sign-up.ts - Start conversation
server/routes/start-conversation.ts - Continue conversation
server/routes/continue-conversation.ts - History endpoints
server/routes/get-conversations-history.ts - Conversation detail
server/routes/get-chat-conversation.ts - Auth middleware
server/middleware/auth.middleware.ts - Conversation data
server/db-data.ts - AI prompts
server/prompts.ts - AI client
server/ai-client.ts
Shared UI support
- User messages
src/app/shared/user-messages/user-messages.service.ts - Loading state
src/app/shared/loading-indicator/global-loading.service.ts
Other components
- User
- OpenAI API
Connections 30
- User → App routes: navigates
- App routes → Sign-in screen: loads
- App routes → Sign-up screen: loads
- App routes → Home screen: loads guarded
- Sign-in screen → Auth service: submits credentials
- Sign-up screen → Auth service: submits credentials
- Auth service → Auth endpoints: POST sign-in
- Auth service → Sign-up endpoint: POST sign-up
- Auth service → Profile service: reloads profile
- Auth guard → Profile service: checks profile
- Home screen → Conversation service: starts or continues
- Conversation thread → Conversation service: sends message
- Home screen → History service: loads history
- Chat history UI → History service: requests conversations
- Side navigation → Chat history UI: opens history
- History service → History endpoints: GET history
- History service → Conversation detail: GET conversation
- Conversation service → Start conversation: POST start
- Conversation service → Continue conversation: POST continue
- Express server → Auth endpoints: dispatches
- Express server → Sign-up endpoint: dispatches
- Express server → Auth middleware: protects chat routes
- Express server → Start conversation: dispatches
- Express server → Continue conversation: dispatches
- Express server → History endpoints: dispatches
- Express server → Conversation detail: dispatches
- Auth interceptor → Express server: adds auth header
- App shell → User messages: renders notifications
- App shell → Loading state: renders loading
- AI client → OpenAI API: sends chat request