A full-stack portfolio website built with Next.js (frontend) and Node.js/Express (backend), featuring image uploads to Cloudinary and admin authentication.
- Responsive Design: Modern, mobile-friendly portfolio layout
- Admin Panel: Secure admin interface for content management
- Image Management: Cloudinary integration for image storage and optimization
- Dynamic Content: Real-time content updates across all sections
- Authentication: JWT-based admin authentication
- Database: MongoDB for data persistence
- Next.js 14 - React framework for production
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Clerk - Authentication and user management
- shadcn/ui - Modern UI components
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- JWT - JSON Web Tokens for authentication
- Cloudinary - Cloud-based image management
portfolio-app/
├── backend/ # Express.js API server
│ ├── controllers/ # Route controllers
│ ├── models/ # MongoDB schemas
│ ├── routes/ # API route definitions
│ ├── middleware/ # Custom middleware
│ └── uploads/ # File upload directory (legacy)
├── frontend/ # Next.js application
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ ├── lib/ # Utility functions and API client
│ └── public/ # Static assets
└── README.md # Project documentation
- Node.js 18+
- MongoDB database
- Cloudinary account
- Clerk account (for authentication)
-
Clone the repository
git clone <repository-url> cd portfolio-app
-
Backend Setup
cd backend npm install -
Frontend Setup
cd ../frontend npm install
PORT=5000
MONGO_URI=mongodb://localhost:27017/portfolio
JWT_SECRET=your-jwt-secret-keyNEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_ADMIN_TOKEN=your-admin-jwt-token
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your-clerk-publishable-key
CLERK_SECRET_KEY=your-clerk-secret-key
ADMIN_USER_IDS=user_123456789
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret- Start MongoDB locally or use a cloud service like MongoDB Atlas
- Update the
MONGO_URIin backend/.env with your connection string
-
Start the backend server
cd backend npm start -
Start the frontend development server
cd frontend npm run dev -
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Admin Panel: http://localhost:3000/admin
Retrieve complete portfolio data including all sections.
Response:
{
"Landingdata": {
"section": "LandingPage",
"data": {
"greeting": "Hello",
"role": "Developer",
"description": "Full-stack developer",
"profilePicture": "https://cloudinary.com/image.jpg"
}
},
"ProjectsData": {
"section": "ProjectsPage",
"data": [...]
},
"AboutMeData": {...},
"FooterData": {...}
}Save complete portfolio data (admin only).
Headers:
Authorization: Bearer <admin-token>
Content-Type: application/json
Request Body:
{
"landing": {
"greeting": "Hello",
"role": "Developer",
"description": "Full-stack developer",
"profilePicture": "https://cloudinary.com/image.jpg"
},
"projects": [...],
"about": {...},
"footer": {...}
}GET /api/landing- Get landing page dataGET /api/projects- Get projects dataGET /api/about- Get about section dataGET /api/footer- Get footer dataGET /api/contact- Get contact information
Images are uploaded to Cloudinary cloud storage:
- Select image file in the admin panel
- Image is uploaded to Cloudinary via
uploadImage()function - Secure URL is stored in the database
- Images are served directly from Cloudinary CDN
- Uses JWT tokens for API authentication
- Admin panel protected by Clerk authentication
- Only authorized users can modify portfolio content
Admin tokens are generated using the tokenGenerator.js script in the backend.
cd backend
npm run build
npm run startcd frontend
npm run build
npm run startEnsure all environment variables are set in your deployment platform:
- Vercel: Project settings > Environment Variables
- Heroku: Config Vars
- AWS/DigitalOcean: Environment configuration
Backend:
npm start- Start production servernpm run dev- Start development server with nodemon
Frontend:
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
- TypeScript for type safety
- ESLint for code linting
- Prettier for code formatting (recommended)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email [your-email@example.com] or create an issue in the repository.