How tilacl/readcycle works
Project Type and Purpose
• ReadCycle is a hybrid mobile and web marketplace for used books.
• It’s built using Ionic Angular for the frontend with Capacitor for native Android (and potentially iOS) support.
• Firebase is used for data storage and user authentication, and there are integrations with external APIs (WhatsApp API for direct communications and PayPal API for optional donations).
File Structure
• There are clear separations between mobile-native code (the “android” directory) and the Angular frontend code (the “src” folder).
• The Angular project is set up with multiple pages/components (login, profile, publication, details, favorites, etc.) and a service layer (in the “src/services” directory) which encapsulates business logic such as authentication, image uploading, geocoding, and publication management.
• Configuration and build files (e.g., capacitor.config.ts, angular.json, firebase.json, package.json) are present to support different parts of the deployment and development process.
• The directories and naming conventions (e.g., “tabs”, “login”, “publicar”, “detalles-publicacion”) indicate an MVC (or MVVM) style where UI components are supported by services that manage data and business rules.
a. Main Components:
• Frontend (Ionic Angular application):
• Contains UI components/pages (login, home/inicio, publication, detail views, etc.)
• Uses Angular modules and routing (see app-routing.module.ts and tabs-routing.module.ts)
• Includes assets and styling (global.scss, theme files)
• Service Layer:
• Angular Services (auth, image-upload, geocoding, publication, usuario) that encapsulate business logic and integrate with external systems.
• Native Layer via Capacitor:
• “android” folder shows native Android configuration and code integration.
• This layer enables native functionalities (push notifications, file access, etc.) and provides the bridge between the web code and mobile platform (via Capacitor).
• Backend / External Integrations:
• Firebase: used for data storage, authentication, and real-time updates.
• Third-Party APIs:
▪ WhatsApp API for direct messaging interactions.
▪ PayPal API for donation processing and managing certain transactions.
b. Relationships and Interactions:
• The Ionic Angular frontend communicates with the service layer to perform business operations (e.g., user authentication, image upload).
• These services in turn interact with Firebase for storage and authentication.
• When required, the service layer also makes API calls to external services such as WhatsApp and PayPal.
• Capacitor acts as a connector between the web-based code and the native device functionalities (notably visible in the “android” folder for native integration).
c. Architectural Patterns/Design Principles:
• Separation of concerns: UI components are kept distinct from business logic services.
• Modular design: Angular modules are structured by feature (e.g., login, profile, publication) which aids in maintenance and scalability.
• Hybrid mobile approach: Using Capacitor ensures that the same core web code can run both as a progressive web app and as a native mobile app.
• Integration with Backend as a Service (Firebase) offloads many backend concerns to a managed service.
d. Technologies and Frameworks:
• Ionic Angular (for UI and frontend development)
• Angular (framework for application structure and routing)
• Capacitor (for native device feature integration)
• Firebase (for authentication, database, and possibly file storage)
• External APIs (WhatsApp and PayPal)