DEV Community

Scott Shoemaker
Scott Shoemaker

Posted on

Sprint 5: Breaking Local Constraints and Moving MedReachAI to the Cloud

The Problem: The Local Development Bottleneck
Up until this week, the MedReachAI application was strictly confined to local development environments. While this is fine for initial prototyping, it created a massive bottleneck for team collaboration. My project partner, Collin, was building the React frontend, while I was constructing the Python FastAPI backend. The immediate problem was connectivity and accessibility: the live Firebase frontend could not communicate with a backend running on localhost. Furthermore, simulating real-world latency, handling Cross-Origin Resource Sharing (CORS) security policies, and conducting end-to-end QA testing is impossible when an application isn't truly "live." We needed a scalable, cloud-hosted infrastructure that allowed independent, continuous deployment.

The Solution: Serverless Containerization
To solve this, Sprint 5 was entirely dedicated to cloud infrastructure migration. Instead of dealing with the overhead of heavy local container software, I opted for a lightweight, automated pipeline using Google Cloud Build and Cloud Run.

Here is how we resolved the infrastructure roadblocks:

Backend Containerization: I wrote a custom Dockerfile to package the FastAPI application, its dependencies (including heavier libraries like spaCy and pandas), and the server execution logic into a single, reproducible image.

Automated CI/CD Pipeline: By linking our GitHub repository directly to Google Cloud Build, any code pushed to the backend-dev branch now automatically triggers a cloud-side compilation. This offloads the hardware requirements from my local machine directly to Google's servers.

Serverless Deployment: Cloud Run takes that built container and hosts it on a public HTTPS endpoint. By allocating 1 GiB of memory, we ensured the Python environment has the resources it needs without risking Out-Of-Memory (OOM) crashes on startup.

_API Routing: _Finally, to bypass CORS limitations, we updated our firebase.json rewrite rules. Now, when the React frontend calls an API endpoint, Firebase securely proxies that request directly to the live Cloud Run instance.

The Result: A Fully Hosted Capstone
This architecture fundamentally changed our workflow. The backend API is now officially live on the web and fully integrated. We no longer have to spin up local terminals or worry about environment discrepancies.

Looking Ahead to QA
With the infrastructure hardened, the remainder of Sprint 5 is focused on optimizing database performance and aggressive stress testing.

Our upcoming backlog includes:

_Batched Writes & Indexing: _Optimizing bulk flag resolutions and implementing custom Firestore indexing to accelerate query speeds on the new cloud architecture.

Resilience Engineering: Designing asynchronous exponential backoff and retry logic to prevent data loss during network hiccups.

Stress Testing: Using tools like Locust and JMeter to evaluate concurrency limits, alongside rigorous vulnerability testing against malicious payloads and CSV injections.

The foundation is built; now it is time to see how much stress it can handle.

Top comments (0)