How viddie/goldberries-frontend works
1. What this repo is
- This is the React frontend for goldberries.net, a database/archive for Celeste modded map challenge completions.
- It is a single-page application that renders views, forms, dashboards, and viewers on top of a separate backend API.
2. Top-level architecture
- The code is organized around route-level pages in src/pages, shared UI components in src/components, cross-cutting hooks/providers in src/hooks, and API/data helpers in src/util.
- src/index.js and src/App.js are the entry points that wire the app shell, routing, providers, and global styling.
3. Frontend-to-backend boundary
- The main data boundary is src/util/api.js plus src/hooks/useApi.jsx, which centralize HTTP access to the backend.
- Most feature pages consume server-provided data for challenges, submissions, campaigns, players, stats, and moderation/admin actions.
- The frontend does not appear to own the core data model; it is primarily a presentation and interaction layer over the API.
4. Route-level feature areas
- src/pages splits the app into major domains: Challenges, Campaigns, Maps, Submissions, Players, Accounts, Search, Stats, Suggestions, Reports, Rules, FAQ, Legal, and Auth/Login.
- There is also a significant admin/moderation area under src/pages/manage for accounts, submissions queue, posts, logs, server settings, file uploads, and traffic analytics.
- This suggests the app serves both general users and privileged staff workflows.
5. Core domain subsystems
- The repository has dedicated component groups for:
- submissions: submission creation, multi/single submission flows, verification-related UI
- likes/wishlist: community preference and wishlist interactions
- recent submissions: activity feed views
- stats_page: aggregated analytics dashboards
- suggestions_page: proposal creation and review flows
- These are not generic widgets; they reflect the main product workflows around community moderation and tracking challenge completions.
6. Map and level visualization
- A major subsystem is src/components/map_data and src/components/map_image, which handle map-related visualization and inspection.
- The map viewer has a more specialized internal structure with controls, sidebar, entity rendering, and many entity-specific renderers, indicating a custom visualization pipeline rather than a simple image display.
- This likely consumes structured map data from the backend and transforms it into interactive map views and campaign galleries.
7. Shared UI and domain primitives
- src/components/basic contains generic UI primitives such as links, buttons, containers, tooltips, loading/error states, and copy/share actions.
- src/components/goldberries contains reusable domain-specific atoms like player chips, campaign icons, challenge selectors, difficulty badges, verification status chips, and submission embeds.
- These components form the shared vocabulary used across pages and forms.
8. Forms and editor workflows
- src/components/forms contains structured data-entry flows for domain objects such as accounts, badges, campaigns, challenges, maps, posts, and submissions.
- These are paired with interactive widgets like string-list editors, selects, toggles, and filters, which suggests the frontend is used for creating and editing backend records, not only browsing them.
- Some forms support bulk or derived creation flows, such as creating campaigns from GameBanana or creating full challenges.
9. Cross-cutting state and app services
- src/hooks provides reusable app services:
- AuthProvider for authentication/session state
- AppSettingsProvider for user preferences
- useModal, useKeyboardShortcut, and overflow helpers for UI behavior
- src/components/ErrorBoundary.jsx and global notice/banner components provide shared error handling and messaging across the SPA.
10. Internationalization and static assets
- Localization is built into the app via src/i18n/config.js and translation files in public/locales/*.
- public also holds static assets such as icons, emotes, badges, stamps, rules markdown, and the site manifest.
- This means some content is served as static frontend resources, while other content is fetched dynamically from the backend.
11. Documentation and API discovery
- public/swagger/swagger.json and src/pages/ApiDoc.jsx indicate the frontend includes an API documentation surface.
- public/md/rules.md and pages like Rules/FAQ/LegalNotice suggest content that is partly static and partly app-rendered, but still delivered through the frontend shell.
12. Operational/runtime context
- The app is run with npm start as a local React dev server, with the backend and database expected to be running separately.
- .env and .env.production imply environment-based configuration for API endpoints and runtime settings.
- GitHub Actions in .github/workflows/ci.yml provides automated CI for this frontend repository.
13. Important architecture takeaway
- For diagramming, treat this repo as a presentation/client layer with several feature modules sharing one backend API.
- The main structural axes are:
- route pages
- reusable UI/domain components
- API/auth/settings hooks
- static i18n/assets
- specialized map visualization
- admin/moderation workflows
Main entry points: App.js App · api.js API client · Challenge.jsx Challenge · AuthProvider.jsx App hooks
Components 27
App shell
Entry points, routing, and global providers.
Pages
Route-level screens and workflows.
- Home · Front page and app entry navigation.
src/pages/Index.jsx - Challenge · Challenge detail and associated community activity.
src/pages/Challenge.jsx - Campaign · Campaign overview and related maps/challenges.
src/pages/Campaign.jsx - Map Viewer · Interactive map inspection and rendering page.
src/pages/MapViewer.jsx - Submission · Submission detail and verification workflow.
src/pages/Submission.jsx - Submit · Submission creation flow.
src/pages/Submit.jsx - Player · Player profile and linked completions.
src/pages/Player.jsx - Search · Search and filtering across repository data.
src/pages/Search.jsx - Stats · Aggregated statistics and charts.
src/pages/Stats.jsx - Suggestions · Suggestion creation and review flows.
src/pages/Suggestions.jsx - Admin · Privileged management and moderation workflows.
src/pages/manage/Actions.jsx
Components
Shared UI, domain widgets, and feature modules.
- Basic UI · Generic layout, buttons, links, feedback, and utility widgets.
src/components/basic/index.js - Domain UI · Reusable goldberries-specific chips, selects, embeds, and icons.
src/components/goldberries/index.js - Forms · Structured create/edit forms for core domain objects.
src/components/forms/Submission.jsx - Submission UI · Single and multi-submission interaction components.
src/components/submit/index.js - Map Data · Interactive map data viewer, controls, and renderers.
src/components/map_data/MapDataViewer.jsx - Map Images · Campaign and map image rendering and gallery views.
src/components/map_image/index.js - Stats UI · Tabbed charts and statistics displays.
src/components/stats_page/Stats.jsx - Suggestions UI · Suggestion modals and forms for challenge/features proposals.
src/components/suggestions_page/SuggestionsList.jsx
Services
API access, hooks, and cross-cutting app state.
- App hooks · Authentication, settings, API, and UI behavior hooks/providers.
src/hooks/AuthProvider.jsx - API client · Central backend request layer.
src/util/api.js
Static assets
Localization, public content, and documentation assets.
- i18n · Translation setup and locale loading.
src/i18n/config.js - Locales · Compiled translation files for supported languages.
public/locales/en/translation.json - API docs · Published Swagger spec surfaced by the frontend.
public/swagger/swagger.json - Rules md · Markdown rules content served with the app.
public/md/rules.md
Connections 31
- index → App: mounts · Bootstraps the SPA and renders the application shell.
- App → Home: routes · App shell routes users to the home page.
- App → Challenge: routes · App shell routes to challenge detail pages.
- App → Campaign: routes · App shell routes to campaign pages.
- App → Map Viewer: routes · App shell routes to the map viewer.
- App → Submission: routes · App shell routes to submission views.
- App → Submit: routes · App shell routes to submission creation.
- App → Player: routes · App shell routes to player profiles.
- App → Search: routes · App shell routes to search.
- App → Stats: routes · App shell routes to statistics dashboards.
- App → Suggestions: routes · App shell routes to suggestions workflows.
- App → Admin: routes · App shell routes privileged admin flows.
- App → App hooks: uses · App shell depends on global providers and hooks.
- App → API client: reads config · App shell and pages use the backend API boundary.
- Challenge → Domain UI: renders · Challenge pages use domain-specific badges, chips, and selects.
- Submit → Forms: uses · Submission creation relies on structured form components.
- Submission → Submission UI: uses · Submission detail pages use submission workflow widgets.
- Map Viewer → Map Data: uses · Map viewer pages rely on the interactive visualization subsystem.
- Campaign → Map Images: uses · Campaign pages use map image and gallery components.
- Stats → Stats UI: uses · Stats pages render the analytics widgets.
- Suggestions → Suggestions UI: uses · Suggestions pages rely on proposal UI components.
- Admin → Forms: uses · Admin workflows reuse the core edit forms.
- Map Data → API client: fetches · Viewer loads structured map data from the backend.
- Map Images → API client: fetches · Image/gallery views load campaign and map assets through the API boundary.
- Forms → API client: submits · Forms create and edit backend records.
- Submission UI → API client: submits · Submission workflows persist data through the API.
- App hooks → API client: wraps · Custom hooks centralize authenticated HTTP access.
- App hooks → i18n: supports · Providers and app state cooperate with localized UI.
- i18n → Locales: loads · i18n config loads translation assets from public locales.
- Home → Rules md: links · Front-end content surfaces static rules documentation.
- Challenge → API docs: references · API documentation is exposed alongside app workflows.