This project is a React + TypeScript client application bootstrapped with Vite for lightning-fast development.
It's live on https://yourmonthly.app/ and feel free to use Demo account if you don't wish to register yourself :)
email: demo@example.com
password: password123
- Node.js v24.11.1 (as specified in
package.json) - npm v9+ or yarn v1.22+
-
Install dependencies
yarn install # Install all apps dependencies -
Set up environment variables
Create a
.env.developmentfile in the project root:VITE_API_URL=http://localhost:3001/api
And a
.env.productionif you have a production backend URL:VITE_API_URL=<PROD_URL>/api
All environment variables exposed to client code must be prefixed with
VITE_. -
Run in development mode
yarn dev:web
Vite will start a dev server on
http://localhost:3000(default) with hot module replacement. -
Preview production build
yarn build:web yarn preview
The
buildcommand outputs optimized assets to thebuild/directory, andpreviewserves them locally.
yarn dev:web— start Vite dev server for web clientyarn build:web— create production build for web clientyarn build— create production build for all appsyarn preview— preview production build locallyyarn codegen— generate GraphQL types/hooksyarn test:web— run unit tests with Vitest for web clientyarn test— run tests for all appsyarn test:coverage— run tests with coverage report
The Vite config is in vite.config.ts. Key points:
- React plugin via
@vitejs/plugin-react - Path alias:
@/→src/ - Server port: 3000
- Build output:
build/
-
Type checking via Vite’s built-in TS support
-
Path aliases mirrored in
tsconfig.json:
This project uses the Barrel Export Patter (otherwise knows as Facade Pattern)n for UI components to create a consistent abstraction layer over Material-UI. And if we want to switch from Material-UI to another library, we only change ONE file instead of hundreds!
- Wrap external library components in
src/components/ui/ - Use path aliases (
@/) for clean imports - Enable easy customization and library migration
// src/components/ui/Avatar.tsx
import { Avatar as MuiAvatar, AvatarProps } from "@mui/material";
export const Avatar: React.FC<AvatarProps> = (props) => (
<MuiAvatar {...props} />
);// Usage in components
import { Avatar } from "@/components/ui/Avatar";
// Instead of direct Material-UI import:
// import { Avatar } from "@mui/material";- Consistent API: Single interface for all UI components
- Easy Migration: Change library by updating wrapper files only
- Custom Defaults: Add styling/behavior without changing imports
- Design System: Enforce consistent theming across the app
- Tests are written with Vitest and React Testing Library.
- Use
src/setupTests.tsfor global mocks and matchers.
(If applicable, add ESLint and Prettier notes here.)
- Fork the repo, create a feature branch, and open a pull request.
- Ensure all tests pass and follow existing code style.
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["src/*"] } } }