Ctrl+K smart search across all pagesPersonal-portfolio/
โโโ client/ # React + Vite frontend
โโโ server/ # Express + MongoDB backend
git clone https://github.com/DhruvJDev/Personal-portfolio.git
cd Personal-portfolio
cd server
npm install
cp .env.example .env # fill in your values
npm run dev
server/.envPORT=5000
NODE_ENV=development
MONGODB_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/portfolio
FRONTEND_URL=http://localhost:5173
ADMIN_API_KEY=your_strong_random_secret_here
cd client
npm install
cp .env.example .env # fill in your values
npm run dev
client/.envVITE_GITHUB_USERNAME=your_github_username
VITE_API_URL=http://localhost:5000
VITE_TRACKER_API_URL=http://localhost:5000/api/v1
| Method | Route | Auth | Description |
|---|---|---|---|
POST |
/api/v1/contact |
โ | Submit contact form |
GET |
/api/v1/contact |
Admin key | Get all messages |
POST |
/api/v1/visitors/track |
โ | Track page visit |
POST |
/api/v1/visitors/heartbeat |
โ | Keep session alive |
GET |
/api/v1/visitors |
Admin key | Get all visitor data |
GET |
/api/v1/health |
โ | Server health check |
Admin routes require the header:
X-Admin-Key: your_admin_api_key
Deploy server first, then client.
Project 1 โ Server
| Setting | Value |
|---|---|
| Root Directory | server |
| Framework | Other |
| Build Command | npm install |
| Output Directory | (leave blank) |
PORT=5000
NODE_ENV=production
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/portfolio
FRONTEND_URL=http://localhost:5173
ADMIN_API_KEY=generate_a_strong_random_string_here
Project 2 โ Client
| Setting | Value |
|---|---|
| Root Directory | client |
| Framework | Vite |
| Build Command | npm run build |
| Output Directory | dist |
VITE_GITHUB_USERNAME=your_github_username
VITE_API_URL=http://localhost:5000
VITE_TRACKER_API_URL=http://localhost:5000/api/v1