How dushyant4342/bedrockembeddings-pdf-faiss works
Main Components
• Client/User: The end user’s browser that interacts with the Streamlit web app.
• Docker Host (EC2 Instance): The physical or virtual machine running Docker. This is where the Docker image is built and deployed.
• Docker Container: Encapsulates the Streamlit web app (app.py) along with its dependencies (requirements.txt) and the operating environment defined by the Dockerfile.
• Mounted Data Volume: The “data” folder on the host (EC2 folder) that is mounted to /app/data inside the container. This is important for storing and persisting the uploaded/resume PDFs.
• (Future/Optional) External Components such as:
• AWS Load Balancer: For handling high traffic.
• Nginx & HTTPS Termination: For securing the application with SSL certificates (as mentioned in the README).
• ECS for autoscaling: If the deployment moves from EC2 to an orchestrated container service.
Relationships & Interactions
• The client’s HTTP requests are directed (currently) to the Docker container’s Streamlit server running on port 8501.
• The container is built from the Dockerfile and runs app.py, which comprises the core application logic.
• The data folder on the host is mounted into the container, ensuring that PDF files (like DushyantResume.pdf) persist beyond container restarts.
• The README instructions refer to using environment variables for AWS credentials, so if the application interacts with AWS services (e.g., for storage or processing), include an “External AWS Services” component.
Architectural Patterns in Use
• Containerization: Clearly isolate the application logic and environment from the host.
• Volume Mounting: Distinguishes between ephemeral container storage and persistent storage on EC2.
Relevant Technologies & Frameworks
• Streamlit: The web application framework used within app.py.
• Docker: For containerizing the application environment.
• AWS and EC2: The cloud platform where the container is deployed.
• Nginx & Certbot: For next-step HTTPS setup, as described in the README.
• (Optionally) AWS ECS & Load Balancer: For scaling and load management per the future plans.
• Don’t oversimplify. Break down the system into all its elemental parts—even if some, like future load balancer or ECS, are planned improvements.
• Relationships explicitly to provide a high-level view (client → EC2/Docker → internal app, with supporting AWS connectivity if applicable).
A Sample Layout Might Look Like:
[Client Browser]
│ (HTTP Request over port 8501)
▼
[EC2 Host running Docker]
│
├──> [Docker Container]
│ │
│ ├──> [Streamlit App (app.py)]
│ └──> [Internal Dependencies from requirements.txt]
│
└──> [Mounted Data Volume: /app/data (mapped from host’s /data folder)]
(Optional Side Components)
├──> [AWS Load Balancer] (for high traffic)
├──> [Nginx] (for HTTPS termination and domain handling)
└──> [AWS ECS] (for autoscaling)