How grylls20/summitron works
Project type and purpose
• Summitron is a decoupled full-stack web application.
• Purpose: Accept a URL for an online article, call an AI-powered summarization service, and return a concise summary to the user.
File structure
• Top-level directories:
• frontend/ – static site (HTML, CSS, JS)
• src/main/java/com/example/summitron/ – Spring Boot backend source
• Dockerfile, pom.xml and Maven wrapper files – build & containerization
• netlify.toml – Netlify configuration for frontend hosting
• Key backend components:
• SummitronController.java – REST endpoint
• SummarizationService.java – business logic calling Together AI API
• WebConfig.java – CORS or static‐resource configuration
• Deployment files:
• Dockerfile for backend container
• netlify.toml for frontend hosting
• application.properties for runtime configuration (port, API key via env var)
Extract architectural insights from the README
• Frontend: a static single-page site deployed to Netlify
• Backend: Spring Boot REST API containerized in Docker and deployed to Google Cloud Run
• External dependency: Together AI (Llama 3) via HTTP API
• Communication: Frontend uses Fetch API to invoke the backend’s /summarize endpoint asynchronously
Main components and interactions
a. Components
1. User Browser (UI)
2. Netlify-hosted Frontend (HTML/CSS/JS)
3. Spring Boot API (Google Cloud Run container)
4. Together AI External Service (Llama 3 model)
5. Configuration/Secrets store (Netlify env vars, Cloud Run env vars)
b. Interactions
• User enters a URL → Frontend JS calls fetch('https://<cloud-run>/summarize')
• Backend receives REST request → SummitronController forwards to SummarizationService
• SummarizationService calls Together AI API with the user’s URL & API key
• Together AI returns summary → Backend wraps it in JSON → Frontend displays it
c. Architectural patterns and principles
• Decoupled frontend & backend (independent development & scaling)
• Single responsibility: Controller vs Service classes
• Containerization for portability (Docker + Cloud Run)
• Static hosting CDN (Netlify) for global distribution
d. Key technologies & frameworks
• Frontend: HTML5, CSS3, vanilla JavaScript (Fetch API)
• Backend: Java 11, Spring Boot, Maven
• Container: Docker
• Deployment: Netlify (frontend), Google Cloud Run (backend)
• AI Integration: Together AI REST API
Detail and clarity
• Call out where Docker & Maven fit in (e.g., “Built with Maven → packaged into Docker image”)
• Build/deploy pipeline: GitHub → Netlify for frontend, GitHub → Cloud Build → Cloud Run for backend