I've explored the Modelence application codebase. Here's a detailed breakdown of what's available:
/user-app/
├── src/
│ ├── client/ # React frontend
│ │ ├── assets/ # Images/logos (favicon.svg, modelence.svg)
│ │ ├── components/
│ │ │ ├── ui/ # Reusable UI components (shadcn-style)
│ │ │ │ ├── Button.tsx
│ │ │ │ ├── Input.tsx
│ │ │ │ ├── Label.tsx
│ │ │ │ └── Card.tsx
│ │ │ ├── LoadingSpinner.tsx # Custom loading component
│ │ │ └── Page.tsx # Page wrapper with header
│ │ ├── pages/ # Route pages
│ │ │ ├── HomePage.tsx
│ │ │ ├── LoginPage.tsx
│ │ │ ├── SignupPage.tsx
│ │ │ ├── ExamplePage.tsx
│ │ │ ├── PrivateExamplePage.tsx
│ │ │ ├── LogoutPage.tsx
│ │ │ ├── TermsPage.tsx
│ │ │ └── NotFoundPage.tsx
│ │ ├── lib/
│ │ │ └── utils.ts # Utility functions (cn helper)
│ │ ├── router.tsx # React Router configuration
│ │ ├── index.tsx # App entry point
│ │ ├── types.d.ts
│ │ └── index.css
│ │
│ └── server/ # Node.js backend
│ ├── app.ts # Server entry point
│ └── example/
│ ├── index.ts # Module definition with queries/mutations
│ ├── db.ts # Database schemas
│ └── cron.ts # Scheduled jobs
│
├── Configuration Files
│ ├── tsconfig.json # TypeScript config with @/* path alias
│ ├── tailwind.config.js # Tailwind CSS setup
│ ├── vite.config.ts # Vite bundler config
│ ├── postcss.config.js
│ └── modelence.config.ts # Modelence framework config
│
└── package.json # Dependencies & scripts
All components are custom implementations located in /user-app/src/client/components/ui/:
- Variants: default, destructive, outline, secondary, ghost, link
- Sizes: default, sm, lg, icon
- Features: Forward ref, fully styled with Tailwind, hover/active states
- Props:
ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
- Features: Forward ref, styled with Tailwind
- Supports: All standard HTML input attributes
- Styling: Border, focus ring, dark mode, placeholder colors
- Features: Semantic label element with peer-disabled states
- Props:
LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement>
- Subcomponents:
Card- Main containerCardHeader- Header section with paddingCardTitle- Title text stylingCardDescription- Description text stylingCardContent- Content wrapperCardFooter- Footer section
All components use the cn() utility function for class merging.
File: /user-app/src/client/lib/utils.ts
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}- Uses
clsxfor conditional classes - Uses
tailwind-mergeto prevent class conflicts - Perfect for merging component classes with custom overrides
The app already has two working form examples you can reference:
- Email and password fields
FormDataAPI for form submission- Card-based layout with headers and footers
- Validation and error handling
- Links to signup
- Email, password, confirm password
- Checkbox for terms acceptance
- Success state handling
- Client-side password validation
- Toast error notifications
useCallbackhook for form submission- State management for success state
- React Query (TanStack) integration
- React Router DOM
- React Hot Toast for notifications
- Suspense boundaries with loading state
- Global error handler- Public Routes: Home, Example, Terms, Logout, 404
- Guest Routes: Login, Signup (redirects to home if authenticated)
- Private Routes: PrivateExamplePage (redirects to login if not authenticated)
- Route Protection:
GuestRoutecomponent for auth-only pagesPrivateRoutecomponent for protected pages- Redirect with
_redirectquery param to return after login
- Header with logo, user info, logout button
- Responsive layout with max-width
- Body section with optional loading state
- Built-in navigation
File: /user-app/src/server/example/index.ts
Example shows Module pattern with:
new Module('example', {
configSchema: { /* configuration */ },
stores: [ /* database stores */ ],
queries: {
getItem: async (args, { user }) => { /* query logic */ },
getItems: async (args, { user }) => { /* query logic */ }
},
mutations: {
createItem: async (args, { user }) => { /* mutation logic */ },
updateItem: async (args, { user }) => { /* mutation logic */ }
},
cronJobs: {
dailyTest: dailyTestCron
}
})export const dbExampleItems = new Store('exampleItems', {
schema: {
title: schema.string(),
createdAt: schema.date(),
userId: schema.userId(),
},
indexes: []
});From package.json:
{
"@modelence/react-query": "^1.0.2", // Modelence + React Query integration
"@tanstack/react-query": "^5.90.12", // Server state management
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.0", // Client routing
"react-hot-toast": "^2.4.1", // Toast notifications
"zod": "^4.1.13", // Schema validation
"tailwindcss": "^3.4.1", // Styling
"clsx": "^2.1.1", // Class utilities
"tailwind-merge": "^3.4.0" // Class merging
}Scripts (from package.json):
npm run dev # Development server
npm run build # Production build
npm start # Start production server
npm test # Run tests (not configured)Vite Configuration:
- Root:
src/client - Path alias:
@/→./src/ - Dev server:
0.0.0.0:5173(allows external access) - React plugin enabled
- Tailwind CSS: Configured with
src/client/**/*.{js,jsx,ts,tsx}content paths - PostCSS: Enabled with autoprefixer
- Color Scheme: Gray, black, white primary colors; blue, red accents
You can reuse:
- Form Structure: FormData API like in LoginPage/SignupPage
- Validation: Zod on backend, client-side checks in form
- UI Components: Button, Input, Label, Card for form container
- Page Layout: Use Page wrapper component
- Toast Notifications:
react-hot-toastfor feedback - State Management: React Query for server state
- Hooks:
useCallback,useState,useMutation,useQuery - Styling: Use
cn()utility to combine classes
This is a full-stack Modelence framework application with:
- Clean component structure ready for a todo list feature
- All necessary UI building blocks already available
- Form handling patterns established
- Database and backend module patterns ready to follow
- Authentication system in place
- TypeScript support throughout
- No external shadcn/ui dependency needed - custom components are already implemented