A modern, full-stack portfolio web application built with Vite (React + TypeScript) for the frontend and Express for the backend, designed for seamless deployment on Vercel.
- ⚡️ Fast, modern React frontend (Vite, TypeScript, TailwindCSS)
- 🔒 Secure, robust Express backend (API, email, CORS, etc.)
- 📧 Contact form with email sending (Resend API)
- 🌐 SEO, analytics, and beautiful UI
- ☁️ One-click deploy to Vercel
git clone <your-repo-url>
cd myportfolionpm install
cd server && npm installCreate a .env file in both myportfolio/ and myportfolio/server/ as needed. Example for backend:
NODE_ENV=development
PORT=3001
EMAIL_FROM=your@email.com
EMAIL_TO=your@email.com
RESEND_API_KEY=your_resend_api_key
CORS_ORIGINS=http://localhost:3000,http://localhost:8080,http://localhost:5173,https://yourdomain.com- Frontend:
npm run dev
- Backend:
cd server npm run dev - Or run both:
npm run dev:all
The app will be available at http://localhost:5173 (frontend) and http://localhost:3001 (backend).
npm run build
cd server && npm run build- Frontend output:
myportfolio/dist/ - Backend output:
myportfolio/server/dist/
- Push your code to GitHub/GitLab.
- Connect your repo to Vercel (https://vercel.com/import).
- Vercel will auto-detect the build and output settings from
vercel.json:- Build command:
npm run vercel-build - Output directory:
dist - API routes:
/api/*handled by Express backend
- Build command:
- Set environment variables in the Vercel dashboard (same as
.env). - Deploy!
myportfolio/
├── src/ # Frontend source code (React, TS)
├── public/ # Static assets
├── dist/ # Frontend build output
├── server/ # Backend (Express, API, email)
│ ├── src/
│ └── dist/
├── .env # Frontend env vars (optional)
├── package.json # Frontend config/scripts
├── vercel.json # Vercel deployment config
└── README.md
NODE_ENV-developmentorproductionPORT- Backend port (default: 3001)EMAIL_FROM- Sender email for contact formEMAIL_TO- Recipient email for contact formRESEND_API_KEY- API key for Resend email serviceCORS_ORIGINS- Comma-separated list of allowed origins
- Blank page or JS MIME errors?
- Make sure
dist/is NOT ignored in.vercelignore. - Ensure
vercel.jsonhasoutputDirectory: "dist". - Check Vercel build logs for errors.
- Make sure
- CORS errors?
- Ensure
CORS_ORIGINSis set correctly in your backend.env. - Restart the backend after changing
.env.
- Ensure
- Email not sending?
- Check
RESEND_API_KEYand email addresses in.env.
- Check
- Fork the repo
- Create a new branch (
git checkout -b feature/your-feature) - Commit your changes
- Push and open a pull request
MIT