An educational SPA built with Vue 3 + Vite, featuring local product CRUD.
- Browse the product list
- Open product details by id
- Add a product
- Edit a product
- Delete a product
- Toast notifications
- Product image validation:
- If the URL does not end with an image extension, a default image is used
- If the image URL fails to load, the UI falls back to the default image
- Vue 3
- Vue Router
- Vite
- Tailwind CSS
- Axios
- json-server
- vue-toastification
Local database file:
src/products.json
json-server exposes this endpoint:
http://localhost:5000/products
The frontend uses the Vite proxy route:
/api/products
npm installRun 2 processes in separate terminals.
- Local API (json-server):
npm run server- Vite dev server:
npm run devAfter that, the app will be available at the Vite URL (usually http://localhost:3000).
npm run dev- start frontend (Vite)npm run server- start json-server on port 5000npm run build- production buildnpm run preview- preview production buildnpm run format- format source files
src/components- UI componentssrc/views- app pagessrc/router- routingsrc/assets- styles and imagessrc/products.json- local product data
- If you see a proxy error like
ECONNREFUSED,npm run serveris not running. - If you see
EADDRINUSE: 5000, port 5000 is already occupied by another json-server process. - This project is intended for local use as an educational example with a file-based database.