A modern full-stack TypeScript application built with tRPC for type-safe API communication between frontend and backend.
- Frontend: React 19 + Vite + TypeScript
- Backend: Node.js + tRPC + Express
- UI Components: AWS Cloudscape Design System
- Styling: Tailwind CSS v4
- API: tRPC for end-to-end type safety
- Testing: Vitest
- Build System: Nx + Rollup
- Package Management: NPM Workspaces
custom-website/
├── packages/
│ ├── api/ # Backend API server with tRPC
│ │ ├── src/
│ │ │ ├── procedures/ # tRPC routers
│ │ │ ├── helpers/ # tRPC setup
│ │ │ └── external-types.ts # Exported types
│ │ └── scripts/
│ │ └── run-dev-server.ts # Development server
│ └── ui/ # Frontend React application
│ └── src/
│ ├── components/
│ ├── helpers/ # tRPC client setup
│ └── root.tsx # App entry point
├── package.json # Root workspace configuration
└── nx.json # Nx configuration
- Node.js >= 22
- NPM >= 9
# Install all dependencies
npm install# Start both frontend and backend development servers
npm run tasks start
# Or start individually:
npm run start -w @wiresense/api # Backend on http://localhost:8080
npm run start -w @wiresense/ui # Frontend on http://localhost:3000# Build all packages
npm run build
# Build specific package
npm run build -w @wiresense/api
npm run build -w @wiresense/ui# Run linting
npm run lint
# Run type checking
npm run type-check
# Run tests
npm run test
# Fix formatting
npm run fixThe backend uses tRPC for type-safe API development. The main router is defined in packages/api/src/procedures/root-router.ts and exports the rootRouter type through external-types.ts.
Example endpoints:
/api/health- Health check endpoint/api/greeting- Example query with input validation
The frontend is built with React and Vite, using tRPC client for type-safe API calls. The tRPC client is configured in packages/ui/src/helpers/trpc.ts and connects to the backend at /api.
This project leverages tRPC for end-to-end type safety between frontend and backend. The backend exports its router type, which the frontend imports to ensure all API calls are fully typed.