How git-baboo/easy-review works
Project type and purpose
• This is a Next.js-based full-stack (mostly frontend) application called “Easy Review” that helps beginner engineers write and post review comments on GitHub pull requests.
• It uses React/TypeScript for the UI, Recoil for state management, Next.js for routing and SSR, and integrates directly with the GitHub API and Firebase Authentication.
File structure
• Top-level files and directories:
• Dockerfile, docker-compose.yml, Makefile (deployment & containerization)
• next.config.js, tsconfig.json, package.json (build & config)
• public/ (static assets, favicons)
• src/pages/ (Next.js page-based routing)
• src/components/ (UI components)
• src/hooks/ (custom React hooks: useApi, useAuth)
• src/store/ (Recoil atoms/keys)
• src/utils/firebase.ts (Firebase Auth client)
• src/utils/markdown (custom markdown renderer themes)
• There is no monolithic backend code or database schema—data flows directly to external services.
README
• Confirms core features:
• Simplified UI for beginners
• Review template system
• Automatic posting of comments to GitHub via API
• No internal DB or custom backend—uses Firebase Auth and GitHub REST/GraphQL.
a. User’s Browser (Client)
• Renders Next.js pages and React components.
• Holds Recoil state, invokes useAuth and useApi hooks.
• Hosts static assets from public/.
b. Next.js Server (SSR/SSG & Hosting)
• Serves React pages at routes under src/pages/…
• Builds and bundles the app.
• May perform server-side fetches (if SSR is used) to GitHub API using stored tokens.
c. Firebase Authentication (External)
• Handles user sign-in (e.g., Google OAuth).
• Returns JWT/ID token to client for authorizing GitHub API requests (or session cookies).
d. GitHub API (External)
• REST or GraphQL endpoints for listing pull requests, posting review comments.
• Client (or Next.js server) sends authenticated requests here.
e. Container/Deployment Layer
• Docker image running Node/Next.js
• docker-compose for local dev or multi-container setup (e.g., local emulators)
Relationships and data flows
• The Browser → Next.js Server: Request pages; download JS bundle & CSS.
• Browser ↔ Firebase Auth: Login flow; receive auth token.
• Browser (or Next.js server) → GitHub API:
• GET PR lists, GET PR details.
• POST review comments via templates.
• Next.js Server → public/ (serves static assets)
• Docker orchestration wraps the Next.js service (and any local emulators if configured).
Architectural patterns & design principles
• Component-based UI (src/components)
• Page-based routing (src/pages)
• Global state via Recoil (src/store)
• Custom hooks for separation of concerns (useAuth, useApi)
• Theming via CSS and modular markdown theme components