A modern, AI-powered web application to help users track their lifestyle-based carbon emissions, visualize progress, and receive personalized eco-friendly suggestions.
-
Google OAuth + Email (NextAuth)
-
JWT-based session handling and CSRF protection
-
Onboarding form for name, age, and location
- Multi-step lifestyle survey:
- Transportation type and distance
- Energy and water usage
- Diet habits (veg/non-veg)
- Food waste level
- Clothing purchases
- Electronics and media usage
- Appliance usage
- Air travel frequency
- Waste management & recycling
- Rotating question sets on repeated visits
- Carbon emission calculated based on input
- Emission score stored in PostgreSQL via Prisma
- Personalized dashboard greeting
- Real-time charts (bar, pie, line) to show:
- Total emission score
- Weekly/monthly change
- Breakdown by category
- Categorize users: Low / Moderate / High impact
- Sustainable carousel tips (refreshing from Gemini AI)
- Gemini API integration for:
- 3–5 personalized tips based on lifestyle input
- Context-aware suggestions with reasoning
- Estimated CO₂ savings per suggestion
- Smart Suggestions panel in dashboard
- Tips stored for reuse in PDF report
- “Download My Report” feature
- Generate PDF containing:
- Profile details
- Lifestyle input summary
- Carbon emission score & breakdown
- Graphs and trends
- AI-generated tips
giki-zero/
├── src/
│ ├── app/ # App Router structure
│ │ ├── dashboard/ # User dashboard
│ │ ├── survey/ # Lifestyle survey form
│ │ ├── api/ # Backend APIs (AI tips, report)
│ │ └── auth/ # Authentication routes
│ ├── components/ # UI Components
│ ├── lib/ # Utility functions (AI, scoring)
│ ├── styles/ # Tailwind & globals
│ └── types/ # TypeScript types
├── prisma/ # DB schema & migrations
└── public/ # Assets and images
- Next.js (App Router) – Full-stack React framework
- TypeScript – Type-safe development
- Tailwind CSS – Utility-first styling
- Chart.js / Recharts – Graphs and charts
- Next.js Server Actions / API Routes
- Prisma ORM with PostgreSQL
- NextAuth.js – Google & Email-based login
- Gemini API – AI suggestion engine
- @react-pdf/renderer or html2pdf.js – PDF reports
- ESLint & Prettier – Code formatting and linting
- Vercel – Hosting and CI/CD
- React Hook Form – Form management
git clone https://github.com/rawadhossain/Giki-Zero.gitCreate a .env file in the root directory and fill in:
# Database
DATABASE_URL="postgresql://your-database-url"
# NextAuth Configuration
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your_secret"
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# Gemini AI
GEMINI_API_KEY=your_gemini_api_key
npm run dev
npm run dev
-
POST /api/survey/submit– Submit lifestyle answers -
GET /api/survey/history– Get previous submissions
-
GET /api/dashboard/stats– User emission data -
POST /api/tips/generate– Get AI-generated tips
GET /api/report/pdf– Generate and download report