How guiller2211/riders works
Project type and purpose
• This is an NX-managed monorepo combining:
– A Remix-based “riders” storefront application (apps/riders)
– A reusable UI design system and toolkit (libs/ui)
– Shared domain types (libs/types)
– Core services & handlers (libs/core)
– A Firebase provider implementation (libs/providers/firebase)
• The README calls it “Rider’s Realm UI Toolkit,” an open-source React component & utility library, integrated into a demo Remix app.
High-level file structure & architectural patterns
• Top-level “apps” directory
– apps/riders: a full Remix project
· app/routes: URL-driven React pages and nested routes
· app/server: CSRF, Firebase session handling
· app/service: data-access services (cart, product, user, etc.)
· app/ui: page-level compositions and an API endpoint (MercadoPago)
· public: static assets
· server: shipping targets (Express for local, Netlify for deployment)
• Top-level “libs” directory
– libs/types: domain-level TypeScript types/enums
– libs/core: framework-agnostic services (config, localization, session handlers, request decorators)
– libs/providers/firebase: plugs in Firebase APIs as a slice/provider for state management
– libs/ui: the design system (46 atomic + composite components, hooks, utilities, context providers, theming)
• Monorepo orchestration by NX
– Shared tsconfig, build scripts (Vite configs per library, Remix config), testing (Vitest), linting, formatting, and deployment tooling.
Key insights from README
• It’s both a UI toolkit and a demo integration (“riders” Remix app).
• Uses React + TypeScript, built with NX, tested with Vitest, deployed via Netlify, with optional Express server target.
• The UI library is framework-agnostic (can be consumed by any React app) and separated into its own build pipeline (nx build ui → dist/ui).
a. Main Components
1. NX Monorepo Core (workspace, Nx CLI, shared tooling)
2. “riders” Remix Application
– UI Layer (app/routes + app/ui)
– Service Layer (app/service)
– Server Layer (app/server + server/*.ts)
– Static Assets (public/)
3. UI Toolkit Library (libs/ui)
4. Shared Domain Types (libs/types)
5. Core Services & Handlers (libs/core)
6. Firebase Provider (libs/providers/firebase)
7. External Services
– Firebase Auth/Firestore
– MercadoPago (API)
– Netlify/Express hosting
b. Relationships & Data Flows
– riders app → imports UI components from libs/ui
– riders app → uses data services in app/service, which call into libs/providers/firebase (or a local datasource)
– service layer → maps domain types from libs/types
– libs/ui → consumes types from libs/types for prop typings
– libs/providers/firebase → depends on Firebase SDK and maps raw JSON to domain models via libs/types
– libs/core → provides underlying cross-cutting services (configuration, session handling) used by both app/server and libs/providers
– Hosting layer (Netlify/Express) serves the SSR entrypoints of riders
c. Architectural Patterns & Principles
– Monorepo modularization (apps vs. libs)
– Layered architecture: Presentation → Application Services → Domain Types → Infrastructure
– Dependency inversion: high-level modules (app & UI) depend on abstractions (libs/core, libs/types), not on concrete Firebase SDK
– Reusability: UI component library separated from business logic
– SSR with Remix, with client hydration for interactive UI
d. Technologies & Frameworks
– React + Remix for the storefront
– TypeScript across all modules
– NX for workspace management
– Vite for building libs and apps
– Vitest for unit/integration tests
– Firebase SDK for data persistence/auth
– Netlify & Express for deployment targets