A modernized version of the HTMX todo application, now powered by Vite for fast development and modern tooling.
- ⚡ Vite - Lightning fast development server
- 🎯 HTMX - Dynamic HTML without complex JavaScript frameworks
- 🗄️ SQLite - Lightweight database for persistence
- 🎨 Pico CSS - Beautiful, minimal styling
- 🔄 Hot Module Replacement - Instant updates during development
try-htmx/
├── index.html # Main HTML entry point
├── vite.config.js # Vite configuration
├── package.json # Dependencies and scripts
├── src/
│ ├── main.js # Client-side JavaScript
│ └── style.css # Custom styles
└── server/
├── index.js # Express backend server
└── database.js # SQLite database setup
- Node.js (v16 or higher)
- npm
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
npm run dev- Start Vite development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run server- Run Express server only (for debugging)
- Vite serves the frontend on port 3000
- Express backend runs on port 3001
- HTMX handles dynamic updates without page refreshes
- SQLite persists todo data locally
POST /api/add- Add a new todoGET /api/todos- Get all todosDELETE /api/todos/:id- Delete a todo
- ✅ ES6 modules throughout
- ✅ Modern JavaScript syntax
- ✅ Vite's fast HMR
- ✅ Better project structure
- ✅ CORS handling for development
- ✅ Modern build pipeline
- ✅ TypeScript-ready (can be added easily)
The app uses Vite's proxy feature to forward /api/* requests to the Express server, allowing seamless development with both frontend and backend running simultaneously.