High-Level Architecture
Relevant source files
The following files were used as context for generating this wiki page:
The Bridge AI platform is a full-stack application designed to facilitate networking, information gathering, and business growth through AI-powered assistants and content aggregation. The architecture follows a classic Client-Server model, utilizing a React-based frontend and a Node.js/Express backend integrated with advanced Large Language Models (LLMs) and external APIs for real-time data retrieval.
The system is structured to provide users with a seamless interface for interacting with an AI networking assistant, browsing curated professional articles, and exploring "Products of the Month." The backend serves as an orchestration layer, managing requests to AI models (like Groq/Llama3 and OpenAI) and third-party services like NewsAPI to deliver processed, summarized, and actionable insights to the user.
Sources: frontend/front/src/App.jsx, BACKEND/package.json, BACKEND/src/controllers/chatbot.controller.js
System Overview
The application architecture is divided into three primary layers: the Presentation Layer (Frontend), the Application Layer (Backend), and the External Services Layer (AI and Data APIs).
The diagram above illustrates the high-level request flow from the user interface through the backend to various external intelligence and data providers.
Sources: frontend/front/src/App.jsx, BACKEND/src/routes/articles.routes.js, BACKEND/src/controllers/chatbot.controller.js
Frontend Architecture
The frontend is built using React and Vite, utilizing React Router DOM for client-side navigation. It manages state for user interactions, specifically within the chatbot and article search modules.
Component Routing
The application defines several routes to separate concerns such as authentication, profile management, and core features:
/dashboard: The landing point after login./chatbotpage: The main interaction hub for the AI assistant./articles: Interface for searching and reading AI-summarized news./products: A showcase of featured products.
Sources: frontend/front/src/App.jsx:11-30, frontend/front/package.json:14-19
Chatbot Logic
The chatbot component manages a local state of messages and handles asynchronous communication with the backend. It implements a "typing" effect for AI responses to improve user experience.
Sources: frontend/front/src/chatbot/chatbot.jsx:174-210
Backend Architecture
The backend is a Node.js application using the Express framework. It is configured to handle Cross-Origin Resource Sharing (CORS) and process JSON payloads.
Key Technologies
| Category | Library/Service | Purpose |
|---|---|---|
| Framework | Express | Handling HTTP requests and routing |
| AI Orchestration | LangChain | Managing prompts and AI model interactions |
| Models | Groq (Llama3), OpenAI (GPT-4) | Text generation and summarization |
| Database | Mongoose (MongoDB) | Data persistence for users and products |
| Authentication | JSON Web Token / Bcrypt | Secure user access and password hashing |
| Sources: BACKEND/package.json:20-41 |
Data Flow: AI Chatbot
When a user sends a query, the backend utilizes LangChain to structure a prompt for the Llama3 model. It also includes logic to extract professional names and generate social media links (LinkedIn/Twitter) dynamically.
Feature Modules
1. Article Summarization System
This module fetches news articles based on user queries via the NewsAPI and summarizes them using OpenAI's GPT-4.
- Endpoint:
GET /api/v1/articles - Logic: Fetches top 5 articles, extracts descriptions or content, and passes them to
getSummary().
Sources: BACKEND/src/routes/articles.routes.js:33-70
2. Networking Assistant
The Networking Assistant is designed to help users find professionals and suggest engagement strategies. It uses a specific system instruction to bias the AI toward professional networking tasks.
- System Instruction: "You are an AI networking assistant. Find professionals, summarize expertise, generate outreach messages, and suggest engagement strategies."
Sources: BACKEND/src/controllers/chatbot.controller.js:98-101
3. Product Showcase
The Products module retrieves data regarding "Products of the Month," including descriptions and vote counts, and displays them in a horizontal scrolling list.
Sources: frontend/front/src/Products/Productspage.jsx:106-115, frontend/front/src/Products/Products.css:18-24
Conclusion
The Bridge AI architecture leverages a modular approach where specific functionalities (AI chat, article summaries, product listings) are encapsulated into distinct frontend components and backend routes. By utilizing LangChain and multiple AI providers, the system provides high-value intelligence while maintaining a responsive, React-based user interface.
Sources: frontend/front/src/App.jsx, BACKEND/src/controllers/chatbot.controller.js