A production-ready full-stack template with working examples. Unlike most starter templates that provide empty files, this one includes actual CRUD operations, database relationships, and form handling patterns.
Version 2.0 | Changelog
- Quick Start
- Using as a Template
- Project Structure
- Available Scripts
- Architecture
- API Reference
- Screenshots
- Troubleshooting
- Contributing
- License
Prerequisites: Node.js 20+, PostgreSQL
# Clone the repository
git clone git@github.com:Avinava/simple-vite-react-express.git my-project
cd my-project
# Install dependencies
npm install
# Run interactive setup
npm run setup
# Start development servers
npm run devOpen http://localhost:3000 to view the application.
The template includes a demo CRM with:
- Contact management with CRUD operations
- Task tracking with status workflows
- Project organization with team assignments
- PostgreSQL database with relationships
# Clone without git history
npx degit Avinava/simple-vite-react-express my-project
cd my-project
# Initialize git
git init
git add .
git commit -m "Initial commit"
# Setup and run
npm install
npm run setup
npm run dev- Update
package.jsonwith your project name and details - Replace
/public/template-logo.pngwith your logo - Update the title in
index.html - Modify
src/client/theme/theme.jsfor your color scheme
| Component | Location | Action |
|---|---|---|
| Database schema | prisma/schema.prisma |
Replace with your models |
| API routes | src/server/routes/v1/ |
Replace with your routes |
| Business logic | src/server/services/ |
Replace with your services |
| Pages | src/client/pages/ |
Replace with your pages |
| Hooks | src/client/hooks/ |
Customize for your data |
| Services | src/client/services/ |
Customize for your API |
src/
├── client/ # Frontend (React + Vite)
│ ├── components/ # Reusable UI components
│ ├── context/ # React contexts
│ ├── hooks/ # Custom hooks (useContacts, useTasks, etc.)
│ ├── pages/ # Route components
│ ├── services/ # API service layer
│ ├── theme/ # Material-UI theme
│ └── __tests__/ # Client tests
│
└── server/ # Backend (Express)
├── config/ # Centralized configuration
├── middleware/ # Security, validation
├── routes/ # API route definitions
├── services/ # Business logic
└── utils/ # Utilities
prisma/ # Database
├── schema.prisma # Schema definition
├── migrations/ # Migration history
└── seed.js # Sample data
scripts/ # Setup utilities
| Command | Description |
|---|---|
npm run dev |
Start client and server concurrently |
npm run client |
Start Vite dev server only |
npm run server |
Start Express with Nodemon |
npm run server:debug |
Start with Node inspector |
npm run setup |
Interactive project setup |
npm run clean |
Clear build artifacts |
| Command | Description |
|---|---|
npm run db:setup |
Run migrations and generate client |
npm run db:migrate |
Run pending migrations |
npm run db:generate |
Regenerate Prisma client |
npm run db:studio |
Open Prisma Studio GUI |
npm run db:reset |
Reset database |
npm run db:seed |
Seed with sample data |
| Command | Description |
|---|---|
npm test |
Run tests in watch mode |
npm run test:run |
Run tests once |
npm run test:coverage |
Generate coverage report |
| Command | Description |
|---|---|
npm run lint |
Check for linting issues |
npm run lint:fix |
Auto-fix linting issues |
npm run format |
Format with Prettier |
npm run format:check |
Check formatting |
| Command | Description |
|---|---|
npm run build |
Build for production |
npm start |
Start production server |
npm run preview |
Preview production build |
- Vite 6 - Build tooling with hot module replacement
- React 19 - UI library with latest features
- Material-UI 6 - Component library with theming
- React Router 7 - Client-side routing
- Formik + Yup - Form handling and validation
- Axios - HTTP client with interceptors
- Express 5 - Web framework
- Prisma 7 - Type-safe ORM with adapter pattern
- PostgreSQL - Database
- Celebrate/Joi - Input validation
- Helmet - Security headers
- Rate Limiting - Request throttling
- ESLint 9 - Linting with flat config
- Prettier - Code formatting
- Vitest - Testing framework
- React Testing Library - Component testing
All endpoints are prefixed with /api/v1/.
GET /contact/list List all contacts
GET /contact/:id Get contact by ID
POST /contact Create contact
PUT /contact/:id Update contact
DELETE /contact/:id Delete contact
GET /task/list List all tasks
GET /task/:id Get task by ID
POST /task Create task
PUT /task/:id Update task
DELETE /task/:id Delete task
GET /project/list List all projects
GET /project/:id Get project by ID
POST /project Create project
PUT /project/:id Update project
DELETE /project/:id Delete project
{
"success": true,
"data": {},
"message": "Success",
"timestamp": "2026-01-18T12:00:00.000Z"
}- Verify PostgreSQL is running:
pg_isready -h localhost -p 5432 - Check
DATABASE_URLin.envfile - Run migrations:
npm run db:setup - Verify database exists:
psql -l
# Kill processes on ports 3000 and 8080
lsof -ti:3000 | xargs kill -9
lsof -ti:8080 | xargs kill -9- Increase file watcher limit (Linux):
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
- Restart the dev server
npm run clean
npm run build- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Run tests:
npm run test:run && npm run lint - Submit a pull request
MIT License - see LICENSE for details.
Built with Antigravity




