How my-crazy-lab/remixrun-boilerplate works
Project type and purpose
• This is a full-stack, enterprise back-office (internal admin) application built on Remix.
• It provides user management, role-based access control (RBAC), action history, i18n, email reset, file upload, charts, and other UI components.
• Backend logic (authentication, session, mail, prom-client, data modeling) lives in the app/services folder; frontend UI uses React, Tailwind, Shadcn, charts, and custom hooks.
File structure
Top-level:
• @/components – Shared UI library (base chart primitives, btaskee design system, shadcn/ui).
• app – Core Remix source:
– entry.client.tsx, entry.server.tsx – Remix client/server entry points.
– routes – File-based routing for pages and nested routes.
– services – Server endpoints and data-access (authentication, mail, RBAC, MongoDB models, external API proxies, S3).
– context, hooks, hoc, utils, constants, types – State management, helpers, shared types.
– app/__tests__ – Unit tests for services and routes.
• public – Static assets (locales JSON for i18n).
• docker-compose.yml, Dockerfile – Containerization.
• Configs – ESLint, Prettier, Jest, GitLab CI, Tailwind, Remix.
README
• Confirms TypeScript, Remix, i18n, RBAC, Jest tests, Docker support.
• Outlines code structure: @ for UI, app for source, public for static, test & build for output/docs.
• Lists features: Authentication, Role-based access control, Action history, Internationalization.
Main components and their relationships
a. Components:
• Frontend / Client (browser): React + Remix app hydration – UI components, charts, forms.
• Remix Server (Node): SSR, routing, data loaders, action handlers.
• Services layer:
– Auth & session management (Remix Auth).
– Mail server (SMTP).
– Data models with MongoDB (users, roles, groups, permissions, isoCode, actionHistory).
– External API proxies (th, vn, id).
– S3 file storage.
– Prometheus metrics client.
• Database: MongoDB cluster.
• External services: SMTP mail provider, AWS S3, geolocation APIs (via proxy).
• DevOps: Docker, GitLab CI/CD.
b. Interactions:
• Browser → Remix Server via HTTP(S) requests (page navigation, form posts, JS API calls).
• Remix Server → Services layer (internal functions calling MongoDB, SMTP, S3, external APIs).
• Services layer ↔ MongoDB.
• Services layer → External APIs/S3/SMTP.
• Prometheus client instrumented inside server for metrics scraping.
• Remix Server → Browser – SSR HTML + hydration.
c. Architectural patterns / principles:
• File-based routing (Remix).
• Separation of concerns: UI vs. server logic vs. data access.
• SSR + CSR hybrid for performance and SEO.
• Centralized services layer for business logic.
• RBAC implemented in services + routes with guards.
• Monorepo-style UI library under @/components.
d. Key technologies:
• Remix (SSR + routing).
• React 18 + Shadcn UI + Tailwind CSS.
• TypeScript.
• Zustand (global state), React Hook Form, Lodash, Moment.js, TanStack Table.
• MongoDB, Mongoose-style model files.
• Jest + Testing Library for 100% coverage.
• Docker + Docker-Compose + GitLab CI/CD.
Details
• UI library (@/components) feeding into page routes.
• I18n JSON files under static assets.
• Unit tests and CI pipeline as side annotation if desired for completeness.