A Next.js portfolio website with AI chat functionality and community comments section.
- AI Chat: Chat with an AI version of Nischal powered by OpenAI (requires authentication)
- Firebase Authentication: Google Sign-In integration
- Comments Section: Users can comment on the homepage and like each other's comments
- Portfolio Pages: About, Svenklas, Philosophy & Vision, Media, and Contact pages
- Next.js 15 with App Router
- TypeScript
- Tailwind CSS
- Firebase (Authentication & Firestore)
- OpenAI API
- Vercel (deployment)
-
Install dependencies:
npm install
-
Environment variables:
- The
.env.localfile already contains your OpenAI API key - Firebase config is in
lib/firebase.ts
- The
-
Run development server:
npm run dev
-
Open your browser: Navigate to http://localhost:3000
-
Login to Vercel:
npx vercel login
-
Deploy:
npx vercel
Follow the prompts:
- Link to existing project? No
- Project name: nischal-app (or your choice)
- Directory: ./
- Override settings? No
-
Deploy to production:
npx vercel --prod
- Go to your project dashboard on vercel.com
- Navigate to Settings → Environment Variables
- Add the following variable:
- Name:
OPENAI_API_KEY - Value:
your-openai-api-key-here - Select all environments (Production, Preview, Development)
- Name:
- Redeploy after adding the environment variable
- Go to Firebase Console
- Select your project:
nischalapp-71d67 - Navigate to Authentication → Sign-in method
- Enable Google sign-in provider
- Add your Vercel domain as an authorized domain:
- Click on Authorized domains tab
- Add your Vercel domain (e.g.,
nischal-app.vercel.app)
- In Firebase Console, navigate to Firestore Database
- If not created, click Create database
- Start in production mode
- Choose a location closest to your users (e.g.,
asia-south1for India)
- Navigate to Rules tab
- Replace the rules with the content from
firestore.rulesfile in this project - Click Publish
- Visit your Vercel URL
- Test Google Sign-In
- Try adding a comment on the homepage
- Test the AI chat at
/chat
.
├── app/
│ ├── api/
│ │ └── chat/
│ │ └── route.ts # OpenAI API route
│ ├── about/
│ ├── chat/ # AI chat page
│ ├── contact/
│ ├── media/
│ ├── philosophy/
│ ├── svenklas/
│ ├── layout.tsx
│ ├── page.tsx # Homepage
│ └── globals.css
├── components/
│ ├── AuthButton.tsx # Sign in/out button
│ ├── Comments.tsx # Comments section
│ └── ContentLayout.tsx # Layout for content pages
├── lib/
│ ├── AuthContext.tsx # Authentication context
│ └── firebase.ts # Firebase configuration
├── firestore.rules # Firestore security rules
├── .env.local # Environment variables
└── package.json
- OpenAI API key is stored as an environment variable (never in client code)
- Firestore rules enforce authentication for writes
- Users can only delete their own comments
- Users can only like/unlike (not modify like counts directly)
- Comment length is limited to 500 characters
For issues or questions, please contact through the Connect page.