Table of Contents
- The Challenge
- Architecture & Solution
- Tech Stack
- Key Engineering Decisions
- Frontend Components
- AI Integration
- Data Visualization
- Interactive Features
- Deployment
- Roadmap
The Challenge
Aasha Foundation is a non-profit organization dedicated to community upliftment through education, sustainable development, and livelihood initiatives in North-East India, particularly focusing on the Bodoland region. The organization needed a modern, engaging web presence that could effectively communicate their mission while facilitating donations and volunteer sign-ups.
The previous website was static and lacked the interactive capabilities needed to showcase the foundation's significant impact metrics (3,500+ volunteers, 250+ projects, 12,000+ lives impacted). The challenge was creating a visually compelling platform that could engage visitors, provide instant answers through AI assistance, and create meaningful conversion pathways for donations and volunteer registration.
The requirement: Build a modern, high-performance NGO website with AI-powered chatbot for instant visitor engagement, comprehensive impact visualization through charts and statistics, interactive calculators for donation impact, and premium animations for visual engagement.
Architecture & Solution
The platform is a single-page application built with Next.js App Router, featuring a component-based architecture:
Page Structure
/
├── Hero
├── About
├── Services
├── Why Choose Us
├── Stats
├── Initiatives
├── Justice & Sustainability
├── Steps to Action
├── Focused Actions
├── Exclusive Course
├── Testimonials
├── Volunteer Impact
├── Blog
└── Final CTATech Stack
| Layer | Technology | Version |
|---|---|---|
| Framework | Next.js | 15.x |
| UI Library | React | 19.x |
| Language | TypeScript | 5.x |
| Styling | Tailwind CSS | 4.x |
| Animation | Motion (Framer) | 12.x |
| Charts | Recharts | 3.x |
| Icons | Lucide React | 0.553+ |
| AI | Google Gemini | 1.17.x |
| Forms | React Hook Form + Zod | — |
| State | React hooks | — |
| Build | Next.js Compiler | — |
Key Engineering Decisions
1. Motion Animation Integration
Premium animations powered by Motion (Framer) for smooth, engaging user interactions:
// components/MagneticButton.tsx
'use client';
import React, { useRef, useState } from 'react';
import { motion } from 'motion/react';
export function MagneticButton({ children, className }: MagneticButtonProps) {
const ref = useRef<HTMLButtonElement>(null);
const [position, setPosition] = useState({ x: 0, y: 0 });
const handleMouse = (e: React.MouseEvent<HTMLButtonElement>) => {
const { clientX, clientY } = e;
const { left, top, width, height } = ref.current!.getBoundingClientRect();
const middleX = clientX - (left + width / 2);
const middleY = clientY - (top + height / 2);
setPosition({ x: middleX * 0.4, y: middleY * 0.4 });
};
const reset = () => setPosition({ x: 0, y: 0 });
return (
<motion.button
ref={ref}
onMouseMove={handleMouse}
onMouseLeave={reset}
animate={{ x: position.x, y: position.y }}
transition={{ type: 'spring', stiffness: 150, damping: 15, mass: 0.1 }}
className={className}
>
{children}
</motion.button>
);
}2. Scroll-Based Parallax Effects
Parallax scrolling implemented with Motion's useScroll and useTransform hooks:
// app/page.tsx
const { scrollYProgress } = useScroll();
const scaleImage = useTransform(scrollYProgress, [0, 0.2], [1, 1.1]);
const y1 = useTransform(scrollYProgress, [0, 1], [0, -150]);
const y2 = useTransform(scrollYProgress, [0, 1], [0, 150]);
// Applied to background elements for depth
<motion.div style={{ y: y1 }} className="floating-element-1" />
<motion.div style={{ y: y2, scale: scaleImage }} className="floating-element-2" />3. AI Chatbot with Gemini Integration
Interactive AI chatbot using Google Gemini API with custom system instructions:
// components/AIChatBot.tsx
const SYSTEM_INSTRUCTION = `
You are the "Aasha Impact Assistant", a friendly and professional AI representative...
Key Information about Aasha:
- Mission: Empowering communities through education, sustainable development...
- Vision: A self-reliant, sustainable and dignified society.
- Impact: 3,500+ active volunteers, 250+ projects completed, 12,000+ lives impacted.
- Programs: Skilling Bodoland Initiative, Resilient Futures, O1 Weaves...
- Focus: Women empowerment, healthcare, education for all...
`;
async function handleSendMessage() {
if (!ai || !input.trim()) return;
setMessages(prev => [...prev, { role: 'user', text: input }]);
setIsLoading(true);
const response = await ai.models.generateContent({
model: 'gemini-2.0-flash',
contents: [{ role: 'user', parts: [{ text: input }] }],
config: {
systemInstruction: SYSTEM_INSTRUCTION,
},
});
setMessages(prev => [...prev, { role: 'bot', text: response.text }]);
setIsLoading(false);
}4. Impact Visualization with Recharts
Comprehensive impact data visualization using Recharts:
// components/ImpactCharts.tsx
export function ImpactCharts() {
const pieData = [
{ name: 'Education', value: 35, fill: '#c49a3b' },
{ name: 'Healthcare', value: 25, fill: '#a67c2e' },
{ name: 'Livelihood', value: 20, fill: '#d4a94b' },
{ name: 'Environment', value: 15, fill: '#8b6914' },
{ name: 'Disaster Relief', value: 5, fill: '#6b5210' },
];
return (
<ResponsiveContainer width="100%" height={300}>
<PieChart>
<Pie
data={pieData}
cx="50%"
cy="50%"
innerRadius={60}
outerRadius={100}
paddingAngle={5}
dataKey="value"
>
{pieData.map((entry, index) => (
<Cell key={`cell-${index}`} fill={entry.fill} />
))}
</Pie>
<Tooltip />
</PieChart>
</ResponsiveContainer>
);
}5. Interactive Impact Calculator
Engaging donation impact calculator showing real-time impact visualization:
// components/ImpactCalculator.tsx
export function ImpactCalculator() {
const [donationAmount, setDonationAmount] = useState(500);
const impactMetrics = {
mealsProvided: Math.floor(donationAmount / 30),
booksProvided: Math.floor(donationAmount / 150),
medicalKits: Math.floor(donationAmount / 200),
saplingsPlanted: Math.floor(donationAmount / 25),
};
return (
<div className="calculator-container">
<input
type="range"
min="100"
max="10000"
value={donationAmount}
onChange={(e) => setDonationAmount(Number(e.target.value))}
/>
<div className="impact-display">
<span>{impactMetrics.mealsProvided} meals</span>
<span>{impactMetrics.booksProvided} books</span>
<span>{impactMetrics.saplingsPlanted} saplings</span>
</div>
</div>
);
}Frontend Components
Section Components (18 Total)
| Component | Features |
|---|---|
Hero | Parallax background, animated CTA, scale transform on scroll |
About | Mission/vision, history timeline |
Services | 7 service categories with icons |
WhyChooseUs | Floating decorative elements, parallax |
Stats | Animated counters for key metrics |
Initiatives | Project cards with hover effects |
JusticeSustainability | Environmental focus section |
StepsToAction | Guide to getting involved |
FocusedActions | Call-to-action sections |
ExclusiveCourse | Educational program promotion |
Testimonials | Client quotes with carousel |
VolunteerImpact | Volunteer statistics |
Blog | Recent articles grid |
FinalCTA | Donation prompt section |
Utility Components
| Component | Purpose |
|---|---|
Navbar | Responsive navigation with mobile menu |
Footer | Contact info, social links |
MagneticButton | Physics-based magnetic hover effect |
AnimatedCounter | Number counting animation |
ScrollProgress | Reading progress indicator |
CustomCursor | Branded cursor follower |
AIChatBot | Gemini-powered assistant |
GalleryCarousel | Image gallery with navigation |
HistoryTimeline | Organizational history |
ImpactCharts | Data visualization |
ImpactCalculator | Donation impact calculator |
DonateButton | Prominent donation CTA |
AI Integration
Aasha Impact Assistant
The AI chatbot is powered by Google Gemini API with custom system instructions:
Capabilities:
- Answer questions about mission and vision
- Explain programs and initiatives
- Provide impact statistics
- Guide users to donate or volunteer
- Handle multilingual queries (Bodo, Assamese, Hindi)
- Direct to appropriate sections
System Instructions Include:
- Organization history and mission
- Key programs (Skilling Bodoland, Resilient Futures, O1 Weaves, etc.)
- Impact metrics (3,500+ volunteers, 250+ projects, 12,000+ lives)
- Donation and volunteer information
- Language preferences
Accessibility Features:
- Focus trap for keyboard navigation
- ESC key to close
- Smooth open/close animations
- Auto-scroll to new messages
Data Visualization
Impact Charts Components
- Pie Chart - Program distribution across categories
- Bar Chart - Annual project completion trends
- Line Chart - Growth trajectory over years
- Area Chart - Cumulative impact over time
Metrics Displayed
| Metric | Value |
|---|---|
| Active Volunteers | 3,500+ |
| Projects Completed | 250+ |
| Lives Impacted | 12,000+ |
| Programs Running | 7+ |
| Districts Covered | 15+ |
Interactive Features
Animated Counters
Number counters with smooth animation for key statistics:
// components/AnimatedCounter.tsx
export function AnimatedCounter({ end, suffix = '' }: CounterProps) {
const [count, setCount] = useState(0);
useEffect(() => {
const duration = 2000;
const steps = 60;
const increment = end / steps;
const stepDuration = duration / steps;
let current = 0;
const timer = setInterval(() => {
current += increment;
if (current >= end) {
setCount(end);
clearInterval(timer);
} else {
setCount(Math.floor(current));
}
}, stepDuration);
return () => clearInterval(timer);
}, [end]);
return <span>{count.toLocaleString()}{suffix}</span>;
}Custom Cursor
Branded cursor follower for enhanced user experience:
// components/CustomCursor.tsx
export function CustomCursor() {
const { scrollYProgress } = useScroll();
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
useEffect(() => {
const updateMousePosition = (e: MouseEvent) => {
setMousePosition({ x: e.clientX, y: e.clientY });
};
window.addEventListener('mousemove', updateMousePosition);
return () => window.removeEventListener('mousemove', updateMousePosition);
}, []);
return (
<motion.div
className="custom-cursor"
animate={{ x: mousePosition.x, y: mousePosition.y }}
transition={{ type: 'spring', stiffness: 500, damping: 28 }}
/>
);
}Deployment
Development
# Install dependencies
npm install
# Set environment variables
# Create .env.local with GEMINI_API_KEY
# Run development server
npm run devProduction Build
# Build for production
npm run build
# Start production server
npm startEnvironment Variables
| Variable | Required | Description |
|---|---|---|
GEMINI_API_KEY | Yes | Google Gemini API key for AI chatbot |
Roadmap
- Phase 1 — Core Platform (Complete) - Next.js 15, Tailwind CSS 4
- Phase 2 — UI Components (Complete) - 18 section components
- Phase 3 — AI Integration (Complete) - Gemini-powered chatbot
- Phase 4 — Data Visualization (Complete) - Impact charts and metrics
- Phase 5 — Interactive Features (Complete) - Calculator, animations
- Phase 6 — Backend Integration (In Progress) - Donation processing
- Phase 7 — Admin Dashboard (Planned) - Content management
- Phase 8 — Volunteer Portal (Planned) - Registration and tracking
- Phase 9 — Multi-language Support (Planned) - Bodo, Assamese, Hindi
Conclusion
The Aasha Foundation NGO platform delivers a modern, engaging web presence that effectively communicates the organization's mission while providing clear pathways for donations and volunteer sign-ups. The AI-powered chatbot provides instant visitor engagement, while comprehensive impact visualization helps donors understand the tangible results of their contributions.
The premium animations and interactive features create an engaging user experience that sets this NGO website apart from traditional static presentations. The mobile-responsive design ensures accessibility across all devices, while the component-based architecture enables easy maintainability and future expansion.
Architecture Feedback
Spotted a potential optimization or antipattern? Let me know.