How maiquochuy/restaurant_review_mobile_app works
Project type and purpose
• This is a full-stack mobile application:
• Frontend: React Native mobile app for iOS and Android
• Backend: Node.js/Express REST API
• Purpose: Allow end users to discover restaurants, write/read reviews, redeem vouchers; enable restaurant owners to manage menus/vouchers; provide an admin dashboard.
File structure
• Top-level directories:
• Restaurant_Review_App → all mobile code & config
• Restaurant_Review_App_BE → backend API code & config
• Frontend structure highlights:
• src/screens, src/components, src/navigators → UI and navigation
• src/contexts → global state via React Context API
• android/ & ios/ → native project files, Gradle, Xcode configs
• Backend structure highlights:
• routes/ → HTTP endpoints
• controllers/ → business logic
• models/ → Mongoose data schemas
• middleware/ → auth, error handling, file upload
• utils/, helpers/, config/ → external integrations & environment
README for additional insights
• Technology stack: React Native, React Navigation, TailwindCSS, Axios, Node.js/Express, MongoDB/Mongoose, JWT, Multer + Cloudinary, Nodemailer, Helmet, CORS.
• Key features and flows: authentication, restaurant discovery, reviews, notifications, maps, voucher system, admin functions.
Main components & interactions
a. Components
• Mobile App (React Native)
– UI layer: Screens & reusable Components
– Navigation layer: Stack, Tab, Drawer
– State Management: Context Providers
– HTTP Client: Axios
• API Server (Node.js / Express)
– Route Handlers → Controllers → Models
– Middleware for Auth (JWT), Errors, File Upload
• Database
– MongoDB (hosted locally or Atlas)
• External Services
– Cloudinary for image storage
– Email SMTP (Nodemailer)
– Map Services: Mapbox / Google Places
– Push Notifications / Real-time (if any)
b. Relationships & Data Flows
1. User interacts with Mobile UI → triggers Axios HTTP request
2. Requests go through Express routes → auth middleware → controllers
3. Controllers read/write data via Mongoose models to MongoDB
4. For uploads: Multer streams to Cloudinary → stored URLs back in DB
5. For emails: Nodemailer connects to SMTP
6. /Places API calls from mobile or backend to external map services
c. Architectural patterns / principles
• MVC-style on backend (Routes → Controllers → Models)
• Component-based & Context-driven on frontend
• Separation of concerns: UI vs. navigation vs. data fetching vs. state
• Secure layers: JWT auth, password hashing, CORS, Helmet
d. Key technologies to annotate
• React Navigation (Stack/Tab/Drawer)
• Native modules (Android / iOS directories)
• TailwindCSS via NativeWind
• Express.js, Mongoose
• Multer + Cloudinary
• JWT / bcrypt
• Nodemailer (SMTP)
• Mapbox / Google Places API