Clarix is a full-stack AI agency website built with a React frontend and an Express + MongoDB backend. It includes a modern marketing site, dedicated Cases/Blog pages, hidden admin unlock flow, contact capture, newsletter support, and rich animated UI sections.
- Frontend: React (CRA), Framer Motion, Tailwind CSS utilities
- Backend: Node.js, Express, MongoDB (Mongoose)
- Security/Middleware: Helmet, CORS, Rate Limiting
- Email: Nodemailer routes (contact/welcome/drip)
client/: Frontend appserver/: Backend API serverFEATURES_IMPLEMENTED.md: Feature notes
- Main app flow is implemented in
client/src/App.jsx. - React bootstrap now lives in
client/src/index.jsx. client/src/index.jsis a compatibility entry that importsindex.jsx.
- Multi-section animated homepage
- Dedicated pages:
/about/contact/cases/blog
- Hidden admin unlock:
- Click the logo 5 times quickly to unlock
/admin
- Click the logo 5 times quickly to unlock
- Contact-first CTA routing:
- “Get Started / Book a Call” CTAs route users to contact form
- Process timeline with scroll-driven line animation
- Services section with themed colors and motion
Mounted in server/server.js:
/api/auth/api/tools/api/cases/api/insights/api/stats/api/settings/api/contact/api/newsletter/api/email/api/health
Create a .env inside server/ with:
PORT=5000MONGODB_URI=mongodb://localhost:27017/clarixJWT_SECRET=use_a_long_random_secret_at_least_16_charsEMAIL_USER=your_email_addressEMAIL_PASS=your_email_app_passwordCORS_ORIGIN=http://localhost:3000(or your deployed frontend URL)
You can copy from:
server/.env.example
For frontend deployment, optionally create client/.env:
REACT_APP_API_BASE_URL=https://your-backend-domain.com
Use empty value in local development so CRA proxy handles /api/* requests.
From repository root:
npm --prefix server install
npm --prefix client installBackend:
npm run dev:serverIf port 5000 is already in use, stop the existing process or set a different PORT value in server/.env.
Frontend:
npm run start:clientApp URLs:
- Frontend: http://localhost:3000
- Backend: http://localhost:5000
npm --prefix client run buildThe Cases and Blog pages are now backend-driven with frontend fallback defaults.
- Cases API:
GET /api/cases - Insights API:
GET /api/insights - Health check:
GET /api/health
If API data is unavailable, UI continues to render using local fallback content.
Run these from repository root:
npm --prefix server run seed:contentReset and reseed all starter Cases/Insights:
npm --prefix server run seed:content:reset- Deploy backend (Render/Railway/Fly) and set all
server/.envvariables. - Deploy frontend (Vercel/Netlify) and configure API proxy/base URL.
- Verify:
/api/healthreturnsstatus: ok- Contact form submit works end-to-end
- Cases and Blog pages load API content
- Add your live URLs in this README.
- Run Lighthouse and keep Performance/Accessibility best-practice scores high.
Use these settings when deploying to Vercel:
- Import this repository in Vercel.
- Set Root Directory to
client. - Build settings:
- Build Command:
npm run build - Output Directory:
build
- Add environment variable in Vercel Project Settings:
REACT_APP_API_BASE_URL=https://your-backend-domain.com
- Redeploy after saving env variables.
This repo now includes client/vercel.json so React SPA routes (/about, /cases, /blog, etc.) resolve correctly on refresh/direct URL.
Important backend requirement:
- Set
CORS_ORIGINinserver/.envto your Vercel frontend URL. - Example:
CORS_ORIGIN=https://your-project.vercel.app
- Built and shipped a full-stack React + Express + MongoDB web app.
- Implemented API-backed content architecture for cases and blog posts with fallback resilience.
- Added security middleware (Helmet, rate limiting) and authentication protections.
- Designed and optimized advanced motion UI interactions across multiple routes.
npm run start-> starts clientnpm run start:client-> starts clientnpm run start:server-> starts servernpm run dev:server-> starts server with nodemon
- CTA buttons route to
/contactand scroll to#contact-form - Contact form captures:
- Name
- Service Needed
- WhatsApp Number (optional)
- Project Details
- If the app says port already in use, existing terminal processes are already running.
- Keep animations balanced with readability; avoid reducing contrast for form inputs and actions.
- If adding new pages, keep navigation state handling in
App.jsxconsistent.
- MongoDB connection errors:
- Verify
MONGODB_URI - Ensure MongoDB service is running
- Verify
- Email sending errors:
- Check
EMAIL_USERandEMAIL_PASS - Use app password for Gmail
- Check
- Frontend not updating:
- Hard refresh browser (
Ctrl+F5)
- Hard refresh browser (
Internal project for Clarix website development.