A modern full-stack web platform with a React frontend and PHP backend, optimized for Hostinger hosting.
CodeHunts delivers a polished, high-performance website for showcasing services, portfolio, and team — with a secure API for contact forms, project management, and team administration.
Most agency websites are slow, hard to maintain, and require expensive hosting. CodeHunts is different. It's a single, self-contained stack — React for a blazing-fast frontend, PHP for a backend that runs on any shared hosting. No Node servers, no Docker, no vendor lock-in.
"Ship fast. Stay lean. Own your stack."
Built with React 19, TypeScript 5.8, and Vite 7. Full type safety, code splitting, lazy loading, and optimized assets out of the box. Mobile-first responsive design powered by Tailwind CSS 4.
ARIA-compliant components built on Radix UI primitives. Follows WCAG guidelines so your site works for everyone, not just most people.
A clean PHP backend with JWT authentication, PDO database connections, and PHPMailer for email. Contact forms, project CRUD, team management — all ready for Hostinger shared hosting.
API key authentication on protected endpoints, SQL injection protection via prepared statements, CORS configuration, and XSS prevention. Security isn't optional.
Protected admin routes for managing projects, team members, and company info. Login with JWT tokens, role-based access, and a clean UI for content management.
- Framer Motion animations — smooth page transitions and micro-interactions
- Form validation — robust client-side validation with helpful error messages
- SEO optimized — meta tags, structured data, and semantic HTML
- Code quality — ESLint, Prettier, and automated formatting checks
- Image uploads — secure file upload handling for projects and team photos
- Email system — SMTP via Hostinger, SendGrid, Gmail, or native
mail()
- Node.js 18+
- npm 9+ or yarn 1.22+
- PHP 7.4+ (for backend)
- MySQL/MariaDB (for backend)
git clone https://github.com/uxlabspk/codehunts.git
cd codehunts
npm install
cp .env.example .envStart the dev server:
npm run devThe app runs at http://localhost:5173.
- Upload
api/to your Hostingerpublic_html/api/directory - Create a MySQL database and import
api/database/schema.sql - Create an email account in hPanel (e.g.
contact@yourdomain.com) - Configure:
cp api/.env.example api/.envand fill in your credentials - Install PHPMailer:
cd api && composer install - Test: visit
https://yourdomain.com/api/projects/list.php
See QUICK-START.md for the fastest setup or BACKEND-SETUP.md for the complete guide.
React (Vite) SPA with client-side routing, lazy-loaded pages
↓
API Calls Fetch/axios to PHP endpoints
↓
PHP API RESTful handlers with JWT auth, PDO, PHPMailer
↓
MySQL Projects, team, contact submissions, admin users
↓
Email SMTP or native mail() for contact form delivery
Request flow: Frontend hits /api/*.php → auth middleware validates JWT or API key → handler processes with prepared statements → JSON response → frontend updates state.
Admin flow: Login at /admin/login → JWT token stored → protected routes verify token via auth.php middleware → CRUD operations on projects/team/company.
| Layer | Tech |
|---|---|
| UI | React 19 + TypeScript 5.8 — type-safe, component-driven |
| Styling | Tailwind CSS 4 — utility-first, responsive |
| Animation | Framer Motion — page transitions, micro-interactions |
| Routing | React Router 7 — client-side navigation |
| Components | Radix UI — accessible primitives (select, label, nav) |
| Build | Vite 7 — fast bundling, HMR |
| Backend | PHP 7.4+ — REST API with JWT auth |
| Database | MySQL/MariaDB via PDO — secure prepared statements |
PHPMailer 6.8 — SMTP with fallback to mail() |
|
| Hosting | Hostinger — optimized for shared PHP hosting |
codehunts/
├── src/ Frontend source
│ ├── components/
│ │ ├── common/ Header, footer, hero, team cards
│ │ ├── landing/ Landing page sections
│ │ ├── portfolio/ Project cards
│ │ ├── services/ Service overview, features, process
│ │ ├── form/ Demo request form
│ │ └── ui/ Base UI (button, card, input, select)
│ ├── pages/ Route components (landing, about, services, ...)
│ ├── data/ Static data (projects, team)
│ ├── hooks/ Custom hooks (useCountUp)
│ ├── lib/ Utilities (cn, validation, SEO, scroll)
│ ├── config/ Environment config
│ ├── constants/ Navigation, buttons, app constants
│ ├── contexts/ Admin auth context
│ ├── services/ API client (admin-api)
│ └── types/ TypeScript definitions
├── api/ Backend PHP API
│ ├── auth/ login.php, me.php
│ ├── projects/ CRUD endpoints (list, create, update, delete)
│ ├── team/ CRUD endpoints (list, create, update, delete)
│ ├── company/ get.php, update.php, public.php
│ ├── helpers/ auth.php, http.php, jwt.php
│ ├── config/ database.php, env.php
│ ├── uploads/ Image upload handler
│ └── mail.php Email sending
├── public/ Static assets
├── vite.config.ts Vite configuration
├── tsconfig.json TypeScript config
├── eslint.config.js Linting rules
└── package.json Dependencies and scripts
| Variable | Description |
|---|---|
VITE_APP_NAME |
Application name |
VITE_APP_URL |
Your domain URL |
VITE_CONTACT_EMAIL |
Contact email address |
VITE_CONTACT_PHONE |
Contact phone number |
| Variable | Default | Description |
|---|---|---|
DB_HOST |
localhost |
Database host |
DB_NAME |
— | Database name |
DB_USER |
— | Database username |
DB_PASS |
— | Database password |
SMTP_HOST |
smtp.hostinger.com |
SMTP server |
SMTP_PORT |
587 |
SMTP port |
SMTP_USERNAME |
— | Email address |
SMTP_PASSWORD |
— | Email password |
API_SECRET_KEY |
— | Strong key for protected endpoints |
ALLOWED_ORIGINS |
— | Comma-separated CORS domains |
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/api/mail.php |
POST | No | Submit contact form |
/api/projects/list.php |
GET | No | Get all projects |
/api/projects/public.php |
GET | No | Public project listing |
/api/projects/create.php |
POST | Yes | Create project |
/api/projects/update.php |
PUT | Yes | Update project |
/api/projects/delete.php |
DELETE | Yes | Delete project |
/api/team/list.php |
GET | No | Get all team members |
/api/team/public.php |
GET | No | Public team listing |
/api/team/create.php |
POST | Yes | Create team member |
/api/team/update.php |
PUT | Yes | Update team member |
/api/team/delete.php |
DELETE | Yes | Delete team member |
/api/auth/login.php |
POST | No | Admin login |
/api/auth/me.php |
GET | Yes | Get current user |
Protected endpoints require X-API-Key or Authorization: Bearer <JWT> header.
npm run dev # Start Vite dev server
npm run build # Production build
npm run preview # Preview production build
npm run validate # Run all checks (type + lint + format)
npm run type-check # TypeScript type checking
npm run lint # ESLint
npm run lint:fix # Auto-fix lint issues
npm run format # Format with Prettier
npm run format:check # Check formattingAll checks at once:
npm run validatenpm run build
# Upload dist/ contents to Hostinger public_html/# Upload api/ folder to Hostinger public_html/api/
# Follow BACKEND-SETUP.md for database and email setupSee DEPLOYMENT.md for detailed instructions.
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Run validation:
npm run validate - Commit:
git commit -m "feat: your feature" - Push:
git push origin feature/your-feature - Open a Pull Request
Follow Conventional Commits:
feat:— new featurefix:— bug fixdocs:— documentationstyle:— formattingrefactor:— code restructuringtest:— adding testschore:— build/tooling
Copyright © 2024 CodeHunts. All rights reserved.
Need help?
- Setup: QUICK-START.md · BACKEND-SETUP.md
- Email issues: api/EMAIL-TROUBLESHOOTING.md
- Architecture: ARCHITECTURE.md
- Deployment: DEPLOYMENT.md
Built sharp. Shipped fast.