Travl.com is a scalable Express and Handlebars travel guide for Indian destinations. The app has been moved away from one hard-coded page per place into shared routes, data services, reusable templates, and backend APIs.
The current build includes a protected destination library, reusable destination detail pages, admin content editing, backend-driven currency conversion, a small site assistant, contact and feedback submissions, legacy route redirects, and responsive UI updates for the home, destination, search, and library screens.
- Replaced hard-coded destination templates with a shared destination data model, seed data, services, and reusable Handlebars views.
- Added
/moreas a reliable paginated destination library withgridandaltlayouts. Grid pages now fill from the available destination data instead of a fixed six-card page. - Fixed the
/more?layout=grid&page=1server error caused by passinglayoutas a render variable to express-handlebars. - Added protected destination browsing. Visitors are redirected to login before
opening
/moreor/destinations/:slug. - Added auth, admin dashboards, destination create/edit/delete screens, submission cleanup, and admin approval routes.
- Added backend APIs for search, currency rates, and the AI guide.
- Restored image-scroll/parallax behavior with transform-based JavaScript instead
of
background-attachment: fixed, heavy filters, or backdrop blur. - Updated UI assets for the feedback and AI side buttons, search hover/focus states, destination cards, destination detail panels, maps, and alternate destination rows.
- Added Node tests that cover routes, redirects, auth-gated pages, pagination, currency, search, and assistant responses.
- Added GitHub Actions CI and Vercel serverless routing.
src/app.jsconfigures Express, Handlebars, sessions, static assets, routes, and error handling.src/server.jsstarts the local server. Vercel importssrc/app.jsdirectly.src/routesmaps public pages, auth, admin, and API endpoints.src/controllerscontains request handlers and render context composition.src/servicescontains destination lookup, site content, submissions, currency-rate, and assistant logic.src/modelscontains MongoDB models for users, destinations, site content, currency-rate cache, and submissions.src/datacontains fallback seed content so local pages can render without MongoDB.templatescontains layouts, partials, and reusable views.public/assetscontains the active CSS and browser JavaScript.test/app.test.jsverifies the main server behavior with Node's test runner.
Create .env from .env.example.
cp .env.example .envRequired for production:
MDBKEY: MongoDB Atlas connection string.MONGODB_URIis also accepted.SESSION_SECRET: long random value for signed sessions.
Optional:
EXCHANGE_RATES_API_KEY: exchangeratesapi.io key. Without it, the converter uses safe fallback rates.ADMIN_EMAILandADMIN_PASSWORD: optional seed-time admin account.PORT: local server port. Defaults to3000.FORMSPREE_CONTACT_URLandFORMSPREE_FEEDBACK_URL: reserved for external form integrations.
Use Node.js 22.x. The repo includes .nvmrc, and Vercel reads the same runtime
from package.json.
nvm use
npm install
npm run devVisit http://localhost:3000.
Common pages:
/: home page./loginand/register: account access./more?layout=grid&page=1: paginated destination library./more?layout=alt&page=1: alternate destination library layout./destinations/taj-mahal: reusable destination detail page./currency: backend-driven currency converter./admin: admin dashboard for approved admins.
See USAGE.md for route, admin, content, and deployment usage.
The app can render from fallback data, but production content should be seeded into MongoDB:
npm run seedThe seed loads the destination library and homepage copy into MongoDB. If
ADMIN_EMAIL and ADMIN_PASSWORD are set, it also creates or promotes that
account as an admin.
New destinations should be added through /admin/destinations/new when MongoDB
is connected. For fallback-only development, add entries to
src/data/destinations.js with a unique slug, images, summary, location,
facts, foods, myths, gallery, and optional legacyPaths.
npm test
npm run auditThe GitHub workflow runs install, tests, and audit checks on pushes and pull requests.
Vercel is the source of truth. Configure MDBKEY, SESSION_SECRET,
ADMIN_EMAIL, ADMIN_PASSWORD, and optionally EXCHANGE_RATES_API_KEY in
Vercel project settings.
vercel.json routes all requests to src/app.js through @vercel/node.