How sourcefuse/react-boilerplate-ts-ui works
Project type and purpose
• This is a front-end “boilerplate” React application written in TypeScript, bundled with Vite, pre-configured with Material-UI (MUI) theming, Redux (RTK + RTK Query), form components, routes, providers, storybook for components, and CI/CD & security workflows.
• It also includes an AWS-CDK folder to deploy the built static assets to S3 + CloudFront (Infrastructure-as-Code).
File structure
• Top-level folders:
• src: your React application (Components, Pages, Hooks, Providers, Redux slices, Routes, Layouts)
• public + assets: static files (index.html, manifest, robots.txt, images)
• cdk: AWS-CDK code for provisioning S3, CloudFront, IAM, etc.
• .storybook: Storybook configuration for interactive component docs
• Configuration & build:
• Dockerfile + docker-compose.yml + nginx/: local containerized build/test/deploy environment
• build.sh / configGenerator.js / farm.config.ts: build scripts & runtime environment RC generation
• . github/workflows: CI pipelines for release, Snyk scans, docs updates
• Vite & tsconfig files for bundling & type-checking
README for additional insights
• Confirms use of: Vite dev server, MUI, Redux, Formik-style wrappers, storybook, Docker, Docker-Compose, AWS-CDK deploy to port 80
• Lists environment inputs (CLIENT_ID, AUTH_API_BASE_URL, etc.), implying runtime calls to external Auth & App APIs
a. Main components
• Developer workstation: VS Code + Git ➔ local dev (Vite or Docker Compose + Nginx)
• CI/CD (GitHub Actions): tests, Snyk scan, build, CDK synth/deploy
• Frontend application:
• Presentation Layer (React + MUI, Components, Pages, Layouts, Providers)
• State layer (Redux store, RTK Query, authSlice, configSlice)
• Routing layer (Routes.tsx + layoutRouteConfig)
• Asset hosting & delivery: AWS S3 (static files) + CloudFront distribution
• External services:
• Authentication service (AUTH_API_BASE_URL)
• Application API service (APP_API_BASE_URL)
• Storybook: standalone component explorer (deployed or local)
b. Relationships & interactions
• Browser ➔ CloudFront ➔ S3 (serves index.html + JS/CSS bundles)
• React app in browser ➔ external Auth & App APIs via RTK Query hooks
• Redux store holds auth tokens/config, provided via Providers (useAuth, useConfig)
• CI pipelines push built assets & CDK templates to AWS; CDK deploy updates CloudFront/S3
c. Architectural patterns & design principles
• Component-driven architecture (Atomic/MUI-extended components, Storybook)
• Provider pattern for cross-cutting concerns (ThemeProvider, Auth, Notification, ErrorBoundary)
• Route-based code organization with layout composition (HeaderLayout vs MainLayout)
• Infrastructure-as-Code (AWS CDK) for reproducible deployments
• Containerization (Docker + Nginx) for environment parity
d. Key technologies & libraries
• React, TypeScript, Vite, MUI
• Redux Toolkit + RTK Query
• Storybook for UI development
• AWS CDK (TypeScript) targeting S3 + CloudFront
• Docker, Docker-Compose, Nginx
• GitHub Actions, Snyk, Husky, Prettier, ESLint