https://github.com/shishirshekhar/balajimachinetools
The Balaji Machine Tools Website Development project envisions the creation of an innovative, responsive, and user-centric website for Balaji Machine Tools.
https://github.com/shishirshekhar/balajimachinetools
html-css-javascript json reactjs tailwindcss
Last synced: 3 months ago
JSON representation
The Balaji Machine Tools Website Development project envisions the creation of an innovative, responsive, and user-centric website for Balaji Machine Tools.
- Host: GitHub
- URL: https://github.com/shishirshekhar/balajimachinetools
- Owner: ShishirShekhar
- Created: 2023-11-14T09:08:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-25T11:52:36.000Z (5 months ago)
- Last Synced: 2026-01-26T01:59:36.780Z (5 months ago)
- Topics: html-css-javascript, json, reactjs, tailwindcss
- Language: JavaScript
- Homepage: https://balajimachines.net
- Size: 7.12 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Balaji Machine Tools
Full-stack product catalog for Balaji Machine Tools built with React + Vite on the client and Node.js/Express + SQLite on the server.
## Stack
- Client: React, Vite, Tailwind (see `client/`)
- Server: Express, SQLite (better-sqlite3), helmet/cors/compression/rate limiting
- Data: seeded from `client/src/lib/data/products.json` into SQLite on first boot
## Quick Start
```bash
# install deps
npm install
cd server && npm install
cd ../client && npm install
# start server (http://localhost:5000)
cd ../server && npm start
# start client (http://localhost:5173)
cd ../client && npm run dev
```
## Environment
Create `server/.env` (optional overrides):
```
PORT=5000
ADMIN_TOKEN=super-secret
ALLOWED_ORIGINS=http://localhost:5173
RATE_LIMIT_MAX=300
```
Client uses `VITE_API_URL` to point at the server API (default `http://localhost:5000/api`).
## API (summary)
- `GET /api/health` — health check
- `GET /api/products` — list products; query `category`
- `GET /api/products/search?q=` — search
- `GET /api/products/categories` — distinct categories
- `GET /api/products/:id` — product detail
- Admin (requires `x-admin-token` if `ADMIN_TOKEN` is set):
- `POST /api/admin/products`
- `PUT /api/admin/products/:id`
- `DELETE /api/admin/products/:id`
## Notes
- SQLite file stored at `server/data/app.db`; auto-seeded from client data on first run.
- Admin mutations persist to SQLite; restart-safe.
- Client has a fallback to local JSON if `USE_API` is disabled in `productService`.