How luizeduarddev/book_store works
Project type and purpose
• This is a full-stack mobile application (“Book Store Project”) combining:
• A Django-based REST backend (Python, Django, Django REST Framework)
• A React Native frontend (TypeScript, Expo) for Android/iOS
• Integration with an external recommendation service (“Gemini”)
File structure
• Top level:
• Pipfile / Pipfile.lock → Python dependencies
• Projeto_Final/ → Django project (asgi.py, wsgi.py, settings.py, urls.py)
• manage.py → Django CLI entry point
• db.sqlite3 → Relational database
• media/ → Uploaded book-cover images
• playground/ → Django “app” containing models, views, URLs, utils, migrations
• client/ → React Native mobile app (App.tsx, android/, ios/, src/, babel.config.js, metro.config.js)
• Backend pattern: MVC (models.py, views.py, urls.py) plus a utils package
• Frontend pattern: Component-based navigation (LoginPage, admin_side, cliente_side, utils/PedidosNavigator.tsx)
• Config & deployment:
• Django settings handle DB, media, CORS, REST
• Expo for React Native bundling (app.json, package.json, tsconfig.json)
• ngrok for local exposure of backend to mobile device
README for additional insights
• Purpose: allow users to browse, purchase, and manage books; admin side for inventory
• Gemini integration: recommendation & availability queries via an external API
• Runtime instructions: run Django server, run Expo, expose server via ngrok
a. Main components
1. Mobile App (Expo React Native)
2. API Gateway / Backend Server (Django + DRF)
3. Database (SQLite)
4. Media Storage (local file system under /media)
5. External Service (Gemini for recommendations)
6. Admin Interface (Django admin or mobile admin section)
b. Relationships & interactions
• Mobile App ⇄ Backend API: REST calls over HTTP/HTTPS
• Backend ⇄ Database: ORM queries to SQLite
• Backend ⇄ Media Storage: Read/write cover images
• Backend ⇄ Gemini: HTTP requests to external recommendation API
c. Architectural patterns & design principles
• Client–Server separation
• MVC on backend, component-based UI on frontend
• Layered architecture:
– Presentation Layer (mobile components)
– Application Layer (Django views/serializers, playground/utils)
– Data Layer (models + SQLite + media files)
• Single codebase for mobile (shared TS code, navigation)
d. Key technologies & libraries
• Python, Django, Django REST Framework
• SQLite (or pluggable to Postgres)
• React Native + Expo
• TypeScript, Babel, Metro bundler
• ngrok for tunneling