How l-quincy01/student-hub-app works
Project type and purpose
• This is a full-stack mobile marketplace application called Student Hub.
• Frontend: a React Native (Expo) client for iOS/Android.
• Backend: a Go HTTP API using the Fiber framework.
• Data persistence: MongoDB (self-hosted or via Docker Compose).
• Authentication: Firebase Auth (OAuth2 & phone/SMS).
File structure
• Top-level folders:
• api/ – Go source code, config, DB adapters, controllers, services, repositories, middleware.
• client/ – React Native code: App.js, navigation (TabNavigation), screens, hooks, assets, Tailwind config.
• .expo/ – Expo Metro bundler internals (supports local development).
• docker-compose.yml under api/ defines MongoDB service.
• Go API follows a layered (controller → service → repository → DB) architecture.
• React Native client uses Expo, React Navigation (tab navigation), custom hooks, and Firebase SDK.
Pull additional insights from the README
• README confirms tech stack: React Native + JavaScript on the client, Go + Fiber on the API, MongoDB, Firebase Auth.
a. Main components
• Mobile App (Expo/React Native)
• Expo Metro Bundler (dev toolchain)
• Go API Server (Fiber)
• Firebase Auth (external OAuth2 provider)
• MongoDB database
• (Optional) Docker Compose orchestrator for local MongoDB
b. Relationships & interactions
1. Mobile App → Firebase Auth: sign-in/sign-up (OAuth2 or phone)
2. Firebase Auth → Mobile App: ID token or OTP flow
3. Mobile App → Go API: attach Firebase token, request business endpoints (products, users, orders)
4. Go API → Firebase Auth: validate token & fetch user identity
5. Go API → MongoDB: CRUD operations for users, products, orders, documents
6. Go API → Mobile App: respond with JSON payloads
c. Architectural patterns & principles
• Mobile: component-based UI, unidirectional data flow via hooks and React Navigation.
• API: layered “clean-onion” style – controllers handle HTTP, services contain business logic, repositories abstract DB, middleware handles auth.
• Separation of concerns: authentication (Firebase) vs business data (MongoDB) vs presentation (mobile screens).
d. Key technologies
• Mobile: React Native, Expo, React Navigation, Tailwind CSS (via tailwind.config.js), TypeScript settings.
• API: Go, Fiber framework, MongoDB driver, Firebase Admin SDK, environment/config management (env_config.go, secrets_config.go).