How ozescu/parkingappres works
Project type and purpose
• Full-stack mobile application (“Smart Parking”) for reserving parking spots.
• Frontend: React Native (Expo) targeting Android & iOS.
• Backend:
– Primary REST API in Express (Node.js) for CRUD (listing spots, booking, cancelling).
– Secondary micro-service in Flask (Python) exposing /api/predict for ML-based occupancy predictions.
• Storage: persistent database (e.g., MongoDB/PostgreSQL) behind Express (not shown in code but implied).
• ML model: parking.pkl loaded by Flask micro-service.
File structure
• Top-level:
– android/, ios/: native project scaffolding generated by Expo/React Native.
– expo/: Expo runtime metadata.
– backend/: contains both server.js (Express) and app.py (Flask).
– screens/: React Native view components (.js files).
– assets/: static images/fonts.
– App.js / index.js: RN entry points.
– config.js: client-side endpoints/configs.
• Backend details:
– server.js: Express entry point; routes/controllers/models under its folder.
– app.py + preprocess.py + model/parking.pkl: Python service.
• No direct DB folder, but Express controllers/models likely connect to a database.
Key README insights
• Tech stack described above.
• Lists API endpoints for both services.
• Clarifies authentication & notification duties may go to Flask as well.
Main components & their relationships
a. Mobile Client
– React Native layers:
• JavaScript app (App.js, screens/*)
• Expo runtime
• Native Android & iOS hosts
b. Network/Internet
c. Backend-express (Node.js)
– Exposes REST endpoints:
• GET /api/parking/spots
• POST /api/parking/reserve
• DELETE /api/parking/free
– Interacts with persistent Database
d. Backend-flask (Python)
– Exposes ML endpoint: POST /api/predict
– Loads parking.pkl, runs preprocess.py
e. Database (MongoDB / PostgreSQL)
– Stores users, reservations, parking-spot metadata
f. (Optional) External services
– Authentication provider, push notifications, map APIs
Relationships:
• RN client ⟷ Express API ⟷ Database
• RN client ⟷ Flask service ⟷ ML model
• (Express or RN) ⟷ external services
Architectural patterns & design principles
• Mobile app/client-server architecture
• Microservices style in backend: separate REST API and ML service
• Separation of concerns: UI, business logic (Node), ML logic (Python)
• Potential MVC or similar in Express (routes/controllers/models)