How suran2022/porten works
Porten is a cross-platform community and messaging product for transgender users. Users authenticate, connect with friends or groups, exchange text and media in real time, and can also record emotion diaries, explore knowledge and support resources, share music, and manage profiles. The React client presents these workflows and keeps chat state; its API layer communicates with FastAPI, whose domain services operate on MySQL-backed models. WebSocket delivery supports live messaging. README-listed capabilities are included, but detailed wiring for several unsampled feature modules is not inferred.
Main entry points: main.py FastAPI application · database.py Database sessions · HomePage.tsx Community workspace · api.ts API client
Components 34
Web client
- Application routes
frontend/src/App.tsx - Login and registration
frontend/src/pages/LoginPage.tsx - Community workspace
frontend/src/pages/HomePage.tsx - Chat interface
frontend/src/components/home/ChatPage.tsx - Profile and settings
frontend/src/components/profile/ProfilePage.tsx - Knowledge and sharing
frontend/src/components/knowledge/KnowledgeView.tsx - Resource center
frontend/src/components/resource/ResourceView.tsx - Emotion diary
frontend/src/components/home/EmotionDiaryPage.tsx - Music sharing
frontend/src/components/music/MusicView.tsx - Authentication state
frontend/src/store/authStore.ts - Chat state
frontend/src/store/chatStore.ts - Message state
frontend/src/store/messageStore.ts - API client
frontend/src/lib/api.ts - Local message cache
frontend/src/lib/localMessageStore.ts
API and identity
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routers/auth.py - Account services
backend/app/services/user_service.py - WebSocket endpoint
backend/app/routers/websocket.py
Community services
- Contacts and requests
backend/app/routers/contacts.py - Group services
backend/app/services/group_service.py - Conversation services
backend/app/services/conversation_service.py - Message services
backend/app/services/message_service.py - Global search
backend/app/services/search_service.py
Wellbeing and resources
- Diary services
backend/app/services/emotion_diary_service.py - Assistant articles
backend/app/services/assistant_article_service.py - Notifications
backend/app/services/notification_service.py - System messages
backend/app/services/system_message_service.py - Email delivery
backend/app/services/email_service.py
Persistence and delivery
- Database sessions
backend/app/database.py - Domain models
backend/app/models - MySQL database
- Connection manager
backend/app/services/websocket_manager.py
Other components
- Community member
- SMTP service
Connections 48
- Community member → Application routes: opens
- Application routes → Login and registration: routes unauthenticated
- Application routes → Community workspace: protects route
- Login and registration → API client: submits auth
- Community workspace → Chat interface: hosts chat
- Community workspace → Profile and settings: hosts profile
- Community workspace → Knowledge and sharing: hosts knowledge
- Community workspace → Resource center: hosts resources
- Community workspace → Emotion diary: hosts diary
- Community workspace → Music sharing: hosts music
- Chat interface → Chat state: uses state
- Chat interface → Message state: uses state
- Profile and settings → API client: requests data
- Knowledge and sharing → API client: requests data
- Resource center → API client: requests data
- Emotion diary → API client: requests data
- Music sharing → API client: shares links
- Message state → Local message cache: caches messages
- API client → FastAPI application: HTTP requests
- Authentication state → API client: authenticates requests
- FastAPI application → Authentication routes: dispatches auth
- FastAPI application → Contacts and requests: dispatches contacts
- FastAPI application → Group services: dispatches group routes
- FastAPI application → Conversation services: dispatches conversation routes
- FastAPI application → Message services: dispatches message routes
- FastAPI application → Global search: dispatches search routes
- FastAPI application → Diary services: dispatches diary routes
- FastAPI application → Assistant articles: dispatches assistant routes
- FastAPI application → Notifications: dispatches notification routes
- FastAPI application → System messages: dispatches system routes
- FastAPI application → WebSocket endpoint: registers websocket
- Authentication routes → Account services: calls
- Authentication routes → Email delivery: sends codes
- Email delivery → SMTP service: sends mail
- Group services → Conversation services: creates conversations
- Group services → Message services: broadcasts system messages
- Message services → Connection manager: pushes messages
- WebSocket endpoint → Connection manager: manages connections
- Connection manager → Community member: delivers live events
- Database sessions → MySQL database: opens sessions
- Authentication routes → Database sessions: uses session
- Group services → Database sessions: uses session
- Conversation services → Database sessions: uses session
- Message services → Database sessions: uses session
- Global search → Database sessions: queries
- Diary services → Database sessions: uses session
- Assistant articles → Database sessions: uses session
- Notifications → Database sessions: uses session