How prashantkhandelwal/popcorn works
Project Type and Purpose
• Popcorn is a full-stack, C#/.NET-based GraphQL API with a minimal static web UI for movie data.
• It ingests and hosts a movie database sourced from themoviedb.org, exposing data through a GraphQL schema.
File Structure Analysis
• Top-level code:
• Program.cs, Popcorn.csproj, Popcorn.sln — entry point and solution.
• /Models — domain entities (Movie, Person, Keywords, Credits).
• /Queries — GraphQL query definitions and extension methods.
• /Repositories — repository interfaces and implementations (data-access pattern).
• /Web — static assets (index.html, CSS, images) served alongside the API.
• /Database — archived movie database zip parts (for backup/restore).
• Deployment:
• /Deployment/Azure — Terraform files provisioning App Service or VM, Azure SQL Database, networking rules.
• .github/workflows — GitHub Actions CI/CD pipelines.
• Config:
• appsettings.json / appsettings.Production.json — environment-specific configuration.
• Properties/launchSettings.json — local dev launch profiles.
README Insights
• Describes Popcorn as a GraphQL interface, with live demo on Azure Web App.
• Points to docs on dev setup, backup/restore, and all GraphQL queries.
Main Components
a. Client Layer
• Web Browser (static SPA served from Web folder).
• GraphQL clients such as GraphQL Playground or Postman.
b. API Layer
• .NET Core GraphQL Server (Program.cs → GraphQL middleware).
• Query Handlers (/Queries), Repositories (/Repositories), Models (/Models).
c. Data Layer
• Azure SQL Database (holds the movie data).
• Backup artifacts (/Database zip parts).
d. Infrastructure Layer
• Azure Resources provisioned via Terraform:
– App Service or Azure VM hosting the API and static UI
– Azure SQL Database
– Networking (NSG, firewall rules)
• Terraform modules (/Deployment/Azure/*.tf).
e. CI/CD Pipeline
• GitHub Actions workflows triggering build and Terraform apply.
• GitHub repo as source code management.
Relationships and Data Flows
• Server: GraphQL Resolver → Repository → Azure SQL → data → upward back to client.
• CI/CD: Git Push → GitHub Actions → Build & Test → Terraform → deploy to Azure.
• Backup/Restore: Admin runs DB restore from .zip parts → Azure SQL.
Architectural Patterns and Principles
• Layered architecture (Presentation → GraphQL API → Data Access).
• Repository pattern for data access abstraction.
• Infrastructure as Code (Terraform) for repeatable deployments.
• Configuration per environment (appsettings.json).
• Static assets served alongside dynamic API.
Final Checklist
• All major components identified above.
• Labels for technologies (e.g., “Azure SQL Database”, “Terraform”).
• Container/group outlines for “Azure Infrastructure” and “Local Dev”.