How johnngethe/airbnb_clone_v4 works
This repository is an AirBnB-style clone prototype spanning a command interpreter, a Flask REST API, and a dynamic listing page, backed by shared domain models and selectable persistence. The principal web workflow is request → route handler → storage/model data → rendered page or JSON response. The README documents console create/read/update/delete operations; sampled console code confirms those operations use the shared storage interface. API route modules and several frontend capabilities are represented from the tree and README, but their source was not sampled, so uncertain internal wiring is omitted.
Main entry points: models/__init__.py Storage selector · views/__init__.py API blueprint · 0-hbnb.py Listings page · console.py Command console
Components 20
User interfaces
- Command console
console.py - Listings page
web_dynamic/0-hbnb.py - Browser scripts
web_dynamic/static/scripts
REST API
- Flask API app
api/v1/app.py - API blueprint
api/v1/views/__init__.py - Place routes
api/v1/views/places.py - Place amenities
api/v1/views/places_amenities.py - Review routes
api/v1/views/places_reviews.py - User routes
api/v1/views/users.py - State and city routes
api/v1/views - Amenity routes
api/v1/views/amenities.py
Domain and storage
- Base model
models/base_model.py - Domain entities
models - Storage selector
models/__init__.py
Persistence
- JSON storage
models/engine/file_storage.py - SQL storage
models/engine/db_storage.py - JSON file
- MySQL database
Other components
- User
- Browser visitor
Connections 25
- User → Command console: enters commands
- Command console → Storage selector: runs CRUD
- Browser visitor → Listings page: requests listings
- Listings page → Storage selector: loads listing data
- Listings page → Browser visitor: renders page
- Browser visitor → Browser scripts: uses interactions
- User → Flask API app: sends requests
- Flask API app → API blueprint: registers blueprint
- API blueprint → Place routes: dispatches
- API blueprint → Place amenities: dispatches
- API blueprint → Review routes: dispatches
- API blueprint → User routes: dispatches
- API blueprint → State and city routes: dispatches
- API blueprint → Amenity routes: dispatches
- Place routes → Storage selector: queries or mutates
- Place amenities → Storage selector: queries or mutates
- Review routes → Storage selector: queries or mutates
- User routes → Storage selector: queries or mutates
- State and city routes → Storage selector: queries or mutates
- Amenity routes → Storage selector: queries or mutates
- Storage selector → JSON storage: selects backend
- Storage selector → SQL storage: selects backend
- JSON storage → JSON file: reads and writes
- SQL storage → MySQL database: queries and commits
- Domain entities → Base model: inherits behavior