How caonguyen-tran/e-commerce works
Main Components
• Frontend (Mobile Client):
• Located in ecommerce/ECommerceNative with subdirectories for Android, iOS, Expo configuration, and components (Home, Products, User).
• Built with React Native (using Expo and standard React Native tooling).
• Backend (Server):
• Comprised of the Django application found in ecommerce/eCommerceApp and ecommerce/eCommerceProject.
• Includes Django core components (views, models, serializers, migrations, URL routing) and a manage.py file.
• Database:
• Represented by db.sqlite3, serving as the datastore for the Django backend.
• Additional Supporting Elements:
• Configuration files, such as package.json for Node/React Native dependencies and requirement.txt for Python dependencies.
• Build and deployment settings (Android and iOS project configurations, Gradle files, Xcode projects).
Interactions and Relationships
• The mobile client (React Native) interacts with the Django backend via API calls.
• The API endpoints (defined likely via eCommerceApp/urls.py and views.py) allow the frontend to perform operations such as user login, product fetching, and ordering.
• The Django backend communicates with the SQLite database (db.sqlite3) to store and retrieve e-commerce data.
Architectural Patterns and Design Principles
• Separation of Concerns:
• Mobile client (presentation layer) is kept separate from the backend logic (business logic).
• The Django backend follows common MVC/MVT (Model-View-Template) patterns.
• Modular Design:
• Components and screens in the React Native app are organized into distinct directories.
• Django has separate apps (e.g., eCommerceApp) for handling business logic.
• Connectivity via API:
Relevant Technologies and Frameworks
• React Native (with Expo) for the frontend.
• Django for the backend.
• SQLite for the database.
• Gradle (Android) and Xcode (iOS) for native build environments.
• Node modules (Node.js) for managing frontend dependencies.
• Additional libraries that might be visible in package.json and requirement.txt.
• Optionally, include a “Configuration & Build” section that shows how environment setup files (Gradle, Xcode, package.json) relate to the corresponding components.
• Separation: clearly separate the concerns between the frontend (presentational layer) and backend (logic/data layer).
• The React Native mobile app (with its submodules and Expo configurations).
• The Django backend handling business logic and RESTful APIs.
• The SQLite database supporting the backend.
• The integration paths among these components.