Modern React + TypeScript application scaffolded with Vite and styled with Tailwind CSS. It includes a simple page builder/viewer split under src/builder and src/viewer, shared UI components, and a lightweight component registry.
- Build tool: Vite 5
- Language: TypeScript 5
- UI: React 18, Tailwind CSS
- Drag & drop:
@dnd-kit - Icons:
lucide-react - Linting: ESLint (+ TypeScript ESLint)
- Node.js >= 18 (LTS recommended)
- npm >= 9 (bundled with Node LTS)
Verify versions:
node -v
npm -v- Install dependencies:
npm install- Start the development server:
npm run devThe app will start on http://localhost:5173 (Vite default). The dev server supports hot module replacement (HMR).
- Build for production:
npm run buildThis runs tsc for type-checking and outputs the production build to dist/.
- Preview the production build locally:
npm run previewThis serves the dist/ build on a local static server (defaults to http://localhost:4173).
- Lint the codebase:
npm run lint- dev: Start Vite dev server
- build: Type-check and build production assets
- preview: Serve built app locally for QA
- lint: Run ESLint across
.ts/.tsxfiles
c:\Users\user\Desktop\Onaim_Implementation\
index.html
public\
placeholder-*.{png,svg,jpg}
src\
App.tsx
builder\
BuilderApp.tsx
components\
ComponentList.tsx
ConfigList.tsx
SettingsPanel.tsx
TemplateSelector.tsx
components\
registry\
ButtonComponent.tsx
CardComponent.tsx
FormComponent.tsx
GalleryComponent.tsx
HeroComponent.tsx
ImageComponent.tsx
index.ts
NavigationComponent.tsx
ui\
badge.tsx
button.tsx
card.tsx
input.tsx
label.tsx
select.tsx
hooks\
useHistory.ts
index.css
main.tsx
templates\
index.ts
types\
index.ts
utils\
cn.ts
viewer\
ViewerApp.tsx
tailwind.config.js
tsconfig.json
vite.config.ts
Key directories:
src/builder: Components and UI for the builder mode.src/viewer: Read-only viewer application.src/components/registry: Registered, composable building-block components.src/components/ui: Reusable UI primitives (buttons, inputs, etc.).
Commands are the same; from the project root run:
npm install
npm run devIf PowerShell execution policy blocks scripts, start a new terminal as Administrator and run:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedNo environment configuration is required by default. If you later add any, create a .env (and optionally .env.local) at the project root and reference them via import.meta.env (Vite convention). Never commit secrets.
Tailwind is configured via tailwind.config.js and postcss.config.js. Global styles live in src/index.css and are included by src/main.tsx.
- Port already in use (5173/4173):
- Close the other process or specify a different port:
npm run dev -- --port 5174
- Close the other process or specify a different port:
- Type errors during build:
- Run
npm run lintand fix reported issues; ensure Node 18+.
- Run
- Styles not applying:
- Confirm Tailwind classes exist in
contentarray oftailwind.config.jsand thatsrc/index.cssis imported.
- Confirm Tailwind classes exist in
- TypeScript-first, strict typing where appropriate.
- Keep UI primitives in
src/components/uiand domain components insrc/components/registry. - Prefer small, focused components; avoid deep nesting and side-effects in render.