How sharath/go-react-boilerplate works
Project type and purpose
• This is a full-stack demo boilerplate combining a React-based SPA in the “client” folder with a Go HTTP server in the root and “backend” folder.
• Purpose: show how to build and serve a React frontend and expose a REST API (e.g., GET /api/v1/users) from a Go backend.
File structure
• Root:
• App.go – main Go HTTP server (serves static assets & mounts API routes).
• backend/Backend.go – API handler implementations.
• Gopkg.toml – Go dependency manifest (uses dep).
• frontend → client/build (symlink to built React assets).
• client/:
• package.json, yarn.lock – defines React app and dependencies.
• public/ – static HTML entrypoint (index.html + manifest).
• src/ – React components, tests, styles, and the SPA entrypoint (index.js → App.js).
• No database folder or config, implying either an in-memory/mock data layer or future extension.
Key insights from README
• Build steps: dep ensure, cd client && yarn build, then go run App.go.
• Server serves on localhost:3000 both static SPA (/) and JSON API (/api/v1/users).
• No external services or DB are wired up in the boilerplate.
Essential elements
• Clear component names: “React SPA,” “Go HTTP Server (App.go),” “API Handlers (backend/Backend.go).”
• Optional future components (e.g., DB) shown as grayed-out placeholders.