This repository is a complete, production-ready scaffold for ROSE GIFTS — a modern, elegant online gift shop built with a vanilla HTML/CSS/JS frontend and a Node.js + Express backend using MySQL.
Features:
Quick start (Windows PowerShell):
cd C:\Users\DELL\Desktop\wapside
npm install
Create .env file based on .env.example and set your DB and email settings.
Create the MySQL database and load schema + seed (adjust mysql command if needed):
mysql -u root -p < sql/schema.sql
mysql -u root -p < sql/seed.sql
Important: The seed inserts an admin user with password_hash set to REPLACE_WITH_BCRYPT_HASH. Create a bcrypt hash for your chosen admin password and update the users table:
Example Node snippet to generate a hash:
node -e "const bcrypt=require('bcrypt');bcrypt.hash('admin123',10).then(h=>console.log(h));"
Then update the DB record:
UPDATE users SET password_hash='paste_hash_here' WHERE email='admin@rosegifts.test';
npm run dev
http://localhost:3000
Admin panel: http://localhost:3000/admin-static/index.htmlProject structure (key files):
server.js — Express entry pointroutes/api.js — API endpointscontrollers/ — controllers for products, cart, orders, auth, adminconfig/db.js — MySQL pool
This repository is a complete, production-ready scaffold for ROSE GIFTS — a modern, elegant online gift shop (Node.js + Express + MySQL backend, TailwindCSS + vanilla JS frontend, Arabic default with English toggle).
Features:
sql/)cd C:\Users\DELL\Desktop\wapside
npm install
.env from .env.example (DB credentials, JWT secret, mail settings).mysql -u root -p < sql/schema.sql
mysql -u root -p < sql/seed.sql
node -e "const bcrypt=require('bcrypt');bcrypt.hash('admin123',10).then(h=>console.log(h));"
npm run dev
npm run tailwind:build
# OR
npm run tailwind:watch
http://localhost:3000server.js — Express entry (serves public/ statics)routes/api.js — API endpointscontrollers/ — products, cart, orders, auth, contact, content, admin endpointsconfig/db.js — MySQL poolpublic/ — rebuilt Tailwind frontendpublic/lang/ — ar.json, en.json translation dictionariessrc/styles/input.css — Tailwind sourcetailwind.config.js / postcss.config.js — build configsql/ — schema, seeds, migrationsTo create a distributable ZIP:
Compress-Archive -Path .\* -DestinationPath ..\rose-gifts.zip -Force
The public/ folder was recreated. Main parts:
index.html — One-page layout (hero, products, testimonials, FAQ, contact, newsletter).assets/js/main.js — Bootstrap, data fetch, cart, i18n toggle.lang/ar.json & lang/en.json — Text keys for translation.assets/css/style.css (build via scripts).Build once:
npm run tailwind:build
Watch mode during development:
npm run tailwind:watch
data-i18n="key" or data-i18n-placeholder on inputs./api/products/api/testimonials/api/faqs/api/settings (keys hero_heading, hero_subheading)/api/newsletter/subscribe { email }/api/cart with { sessionId, productId, qty } then GET /api/cart/:sessionIdmain.js creates a persistent rg_session ID in localStorage used by cart endpoints.
Backend admin endpoints still exist under /api/admin/* (JWT). Rebuild a new SPA or static panel when needed; serve it similarly to public/.
JWT_SECRET & mail credentials before production.Admin credentials (backend only, dev):
admin@rosegifts.testJ5aCoehIAs4A!RgChange both + rotate hash before real deployment.
Suggested enhancements:
site_settings schema (drop fallback variant).Enjoy building with ROSE GIFTS.