How khoalaotu40-creator/cogo_uii works
CoGo_uii implements phone-based login and registration, OTP verification, profile creation, and student-status verification. The browser app routes users through those states, while an Express API handles OTP/profile operations and student-verification requests; Supabase supplies authentication and persistence. The source index confirms several component dependencies, but the README provides no additional product capabilities, and the student-verification server implementation was not excerpted, so its internal behavior is not expanded here.
Main entry points: routes.tsx Auth routing · api.ts API client · server.ts Express server · AuthContext.tsx Auth context
Components 17
Browser application
- React entry
src/main.tsx - App shell
src/app/App.tsx - Auth routing
src/app/routes.tsx - Auth layout
src/user/auth/AuthLayout.tsx - Auth context
src/app/context/AuthContext.tsx
Phone authentication
- Login form
src/user/auth/Login.tsx - Registration form
src/user/auth/Register.tsx - OTP verification
src/user/auth/OtpVerification.tsx - Student verification
src/user/auth/StudentVerification.tsx
API services
- API client
src/shared/lib/api.ts - Express server
server/server.ts - Auth endpoints
server/api/auth.ts - Verification endpoint
server/api/student_verifications.ts
Supabase services
- Admin client
server/db/index.ts - Browser client
src/shared/lib/supabase.ts
Other components
- User
- Supabase
Connections 27
- User → React entry: uses
src/main.tsx - React entry → App shell: renders
src/main.tsx - App shell → Auth context: provides
src/app/App.tsx - App shell → Auth routing: renders
src/app/App.tsx - Auth routing → Auth layout: renders
src/app/routes.tsx - Auth routing → Login form: routes to
src/app/routes.tsx - Auth routing → Registration form: routes to
src/app/routes.tsx - Auth routing → OTP verification: routes to
src/app/routes.tsx - Auth routing → Student verification: routes to
src/app/routes.tsx - Auth routing → Auth context: reads state
src/app/routes.tsx - Auth context → Browser client: tracks session
src/app/context/AuthContext.tsx - Auth context → API client: loads profile
src/app/context/AuthContext.tsx - Login form → API client: requests OTP
src/user/auth/Login.tsx - Registration form → API client: requests OTP
src/user/auth/Register.tsx - OTP verification → API client: verifies OTP
src/user/auth/OtpVerification.tsx - OTP verification → Browser client: sets session
src/user/auth/OtpVerification.tsx - OTP verification → Auth context: refreshes profile
src/user/auth/OtpVerification.tsx - Student verification → API client: loads universities
src/user/auth/StudentVerification.tsx - Student verification → Express server: submits verification
src/user/auth/StudentVerification.tsx - API client → Express server: sends API requests
src/shared/lib/api.ts - Express server → Auth endpoints: mounts routes
server/server.ts - Express server → Verification endpoint: mounts routes
server/server.ts - Express server → Admin client: queries universities
server/server.ts - Auth endpoints → Admin client: queries auth data
server/api/auth.ts - Verification endpoint → Admin client: uses database
server/api/student_verifications.ts - Admin client → Supabase: connects to
server/db/index.ts - Browser client → Supabase: authenticates with
src/shared/lib/supabase.ts