
System Component Overview
- React: The frontend application accessed by the user, which sends HTTP requests and receives responses in JSON format.
- Nginx: Acts as a reverse proxy, forwarding requests from React to the backend (FastAPI) and returning the response to the frontend.
- FastAPI: The backend API server that processes requests, fetches necessary data from the S3 storage or external services, and returns content to Nginx.
- S3: Amazon S3 (Simple Storage Service) is used to store content and configuration data fetched by the system for use in API responses and other backend tasks.
- Chat-GPT4o: A service or engine responsible for fetching configuration and initiating AI model generation through AWS Lambda.
- Lambda: A serverless computing service that runs the AI model (likely GPT-based) through Gemini, generates data, and stores it in a vector database like Milvus.
- Milvus: A vector database where AI-generated data and similar search results are stored, supporting efficient queries and retrieval based on semantic similarity.
Sequence Flow Explanation
- Request from React to Nginx:
- The user interacts with the React frontend, which sends an HTTP request (GET or POST) to the Nginx server.
- Nginx as a Reverse Proxy to FastAPI:
- Nginx forwards the request to the FastAPI backend, functioning as a reverse proxy. FastAPI handles the business logic based on the incoming request.
- FastAPI Fetching Data from Milvus:
- FastAPI processes the request and queries the Milvus vector database to fetch the required data, such as vectors or similar search results, based on semantic similarity.
- Storing Generated Data in Milvus:
- Lambda functions handle the AI-generated data and store it in Milvus for future semantic search and retrieval. This process is not in real-time.
- Request for Recent Articles or Similar Search Results:
- FastAPI or a related service sends a query to Milvus, requesting recent articles or content based on similarity. Milvus responds with the relevant data.
- Returning the Response:
- FastAPI processes the retrieved content from Milvus, prepares a response, and sends it to Nginx.
- 200 OK Response:
- Nginx forwards the JSON response back to the React frontend, completing the request cycle. The frontend updates the UI with the received data.