How mwaraic/my-web-feed works
Main Components
• Frontend (React):
• Located in the “frontend” folder.
• Developed using React with various pages (e.g., googleNews, reddit, twitter) and components (e.g., dashboard, login, signup).
• Includes assets like images and styles.
• Uses routing and Firebase for authentication (client-side integration in “frontend/src/firebase”).
• Backend (Node.js/Express):
• Located in the “backend” folder.
• Contains API endpoints for different content sources:
• /news (Google News integration)
• /reddit (Reddit integration)
• /tweets (Twitter integration)
• /preferences (for managing user preferences)
• Organized under “backend/src/apis” with dedicated subdirectories for each content source.
• Contains a server entry point (“backend/src/server.js”).
• Manages external service integrations using client libraries for Firebase, MongoDB, and Twitter (see “backend/src/client/…”).
• External Services & Integrations:
• Authentication: Firebase for secure user authentication.
• Database: MongoDB for storing user preferences and possibly content-related data.
• Social/Content APIs: External API calls to Google News, Reddit, and Twitter.
• Docker Components:
• Dockerfiles provided for both backend (node container) and frontend (react container).
• Docker Compose setup in both folders (along with a top-level Makefile for “make start”) which helps orchestrate containers.
• Documentation:
Relationships and Data Flow
• Users interact with the Frontend (React app) via a web browser.
• The Frontend sends user requests (e.g., logins, setting preferences, fetching feeds) to the Backend API.
• The Backend handles these requests:
• It authenticates users (using Firebase integration).
• It retrieves and aggregates content from external services (Google News, Reddit, and Twitter) using dedicated API endpoints.
• It interfaces with MongoDB to store and retrieve user preferences.
• Docker is used to containerize and manage both the frontend and backend services. The docker-compose files indicate a dependency where both containers need to be started together.
Architectural Patterns and Design Principles
• Separation of concerns: Clear division between the frontend (presentation) and the backend (business logic and API integrations).
• Modular API design: Each feed (news, reddit, tweets) has its own dedicated subdirectory/API module under the backend.
• Use of containerization: Enhances isolated environments for easier deployment and scaling.
• External integration: Clearly defined interfaces with third-party services (social media APIs and Firebase).