Overview
The Core Monorepo is TailStack’s flagship template, providing a complete ERN Stack (Express, React, Node.js) in a unified, production-ready architecture. It’s designed for full-stack applications where frontend and backend are tightly integrated and deployed together.This template is located at
packages/core/ in the TailStack repository.Architecture Components
Frontend
Vite + React + TailwindModern client application with:
- React 19 with latest features
- Vite 6 for lightning-fast HMR
- Tailwind CSS 4 (new engine)
- Shadcn UI component library
- React Router 7 for routing
Backend
Express + TypeScript + ClusteringScalable server foundation:
- Express 5 web framework
- Full TypeScript type safety
- Multi-core Node clustering
- CORS and security configured
- RESTful API architecture
Automation
Cross-Platform ScriptsDevelopment utilities:
- Smart clean (parallel purge)
- Smart install (load-aware)
- Both PowerShell and Bash
- Located in
scripts/directory
AI Skills
Agent-Powered DevelopmentThree pre-configured skills:
- Vercel React Best Practices
- Node.js Backend Patterns
- Tailwind v4 + shadcn/ui
Directory Structure
Here’s the complete structure of the Core monorepo:Frontend Architecture
Technology Stack
The frontend is built with modern React best practices:- Core Libraries
- Components
- Weather Demo
package.json (frontend)
Backend Architecture
Node Clustering
The backend uses Node.js clustering to maximize performance across CPU cores:source/Server/src/cluster/index.ts
Performance Impact: Clustering allows the server to handle concurrent requests across all CPU cores, dramatically improving throughput for compute-intensive operations.
Server Entry Point
The server initialization insource/Server/src/server.ts:
Dependencies
package.json (Server)
Development Workflow
Concurrent Development
The rootpackage.json includes a unified dev script:
pnpm dev from the root starts both frontend and backend simultaneously:
- Frontend:
http://localhost:5173(Vite dev server) - Backend:
http://localhost:5000(Express API)
Hot Module Replacement
- Frontend
- Backend
Vite provides instant HMR for React components:
- Sub-100ms updates
- Preserves component state
- No full page reload needed
- Works with Tailwind CSS changes
Agent Skills Integration
The Core template includes three agent skills across multiple AI platforms:Vercel React
Location:
.agent/skills/vercel-react-best-practices/- 57 performance rules
- 8 optimization categories
- React 19 best practices
- Next.js patterns
Node.js Patterns
Location:
.agent/skills/nodejs-backend-patterns/- Scalable architectures
- Security best practices
- Error handling patterns
- Production deployment
Tailwind + shadcn
Location:
.agent/skills/tailwind-v4-shadcn/- Tailwind v4 syntax
- shadcn/ui components
- Dark mode setup
- Migration guides
Supported AI Agents
Skills are duplicated across agent directories for compatibility:.agent/- Gemini and generic agents.claude/- Claude Desktop and API.cursor/- Cursor IDE.opencode/- OpenCode CLI.agents/- Trae and custom agents
Automation Scripts
Located inscripts/ directory:
- Smart Clean
- Smart Install
Lightning-Fast Cleanup
Files:clean.ps1 (PowerShell) / clean.sh (Bash)Features:- Parallel deletion across all
node_modules - Kills locking processes (Node.js, VS Code)
- Removes
pnpm-lock.yamlfiles - 3-retry verification loop
- Cross-platform compatibility
Security Features
Gitleaks
Automatic secret detection on every commit via Husky hooks
- Scans staged files for secrets
- Blocks commits with leaked credentials
- Configured via
.gitleaks.toml
Commitlint
Enforces Conventional Commits format
feat:,fix:,docs:, etc.- Automated changelog generation
- Semantic versioning support
CORS
Backend CORS configured for frontend origin
- Environment-based origins
- Credential support
- Pre-flight handling
Environment Variables
Secure configuration via
.env files.env.exampletemplates- Never committed to Git
- Dotenv for loading
Production Deployment
Build Process
- Frontend
- Backend
source/frontend/dist/:- Optimized bundle with tree-shaking
- Minified JavaScript and CSS
- Hashed filenames for caching
- Ready for static hosting (Vercel, Netlify, S3)
Deployment Strategies
Monolithic
Deploy frontend and backend together
- Single Docker container
- Express serves React build
- Simplified deployment
- Single domain/certificate
Separated
Deploy frontend and backend independently
- Frontend: Vercel/Netlify
- Backend: Heroku/Railway/AWS
- CDN for static assets
- Better scalability
Next Steps
Project Structure
Explore detailed directory organization
Getting Started
Set up your first TailStack project
React Template
Compare with frontend-only architecture
Node Template
Compare with backend-only architecture