Skip to content

EcoLafaek Public Dashboard ​

EcoLafaek Logo

AWS AI Agent Hackathon

A comprehensive public web dashboard showcasing Amazon Bedrock AgentCore autonomous AI agent capabilities for waste management in Timor-Leste. This dashboard demonstrates real-time AI chat with multi-round tool calling, semantic vector search, and interactive data visualization.

πŸ€– AI Agent Integration: ​

  • AgentCore AI Chat: Natural language interface with autonomous tool execution
  • Multi-Round Tool Calling: Agent chains SQL queries β†’ Chart generation β†’ Map creation
  • Vector Search: Amazon Titan Embed powered semantic similarity search
  • Real-time Analytics: Interactive data visualization and reporting

For detailed AI agent architecture, see Backend README and Architecture Diagram.

🌟 Key Features ​

  • πŸ€– AI Chat Helper: Interact with AgentCore autonomous agent for data insights and chart generation
  • πŸ” Vector Search: Semantic search powered by Amazon Titan Embed (1024-dimensional embeddings)
  • πŸ—ΊοΈ Interactive Maps: Geospatial visualization of waste reports and hotspots
  • πŸ“Š Real-time Analytics: Monitor waste management metrics with customizable date ranges
  • πŸ“ˆ Data Visualization: Charts, graphs, and trends powered by AgentCore Code Interpreter
  • πŸ† Community Leaderboard: Recognize top contributors

πŸ–₯️ Live Demo ​

Visit: https://www.ecolafaek.com

πŸ—οΈ Technical Stack ​

Frontend ​

  • Framework: Next.js 15 (React 18)
  • Language: TypeScript 5.0+
  • Styling: Tailwind CSS 3.0+
  • Maps: Leaflet.js
  • Charts: Chart.js, Tremor Charts

Backend Integration ​

  • API: Next.js API Routes (Serverless)
  • AI Agent: Amazon Bedrock AgentCore (via FastAPI backend proxy)
  • Vector Search: Amazon Titan Embed + SQL database
  • Authentication: API Key-based
  • Deployment: Vercel Edge Functions

AI Services (via Backend) ​

  • Amazon Bedrock Nova-Pro: Multi-modal reasoning and tool orchestration
  • Amazon Bedrock AgentCore: Autonomous code execution and browser automation
  • Amazon Titan Embed: Vector embeddings for semantic search

πŸ“ Project Structure ​

ecolafaek_public_dashboard/
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ index.js                      # Dashboard homepage
β”‚   β”œβ”€β”€ agentcore-chat.js             # AI Agent chat interface
β”‚   β”œβ”€β”€ vector-search.js              # Semantic search page
β”‚   β”œβ”€β”€ reports.js                    # Reports listing
β”‚   β”œβ”€β”€ map.js                        # Interactive map view
β”‚   └── api/
β”‚       β”œβ”€β”€ chat.js                   # Proxy to FastAPI AgentCore chat
β”‚       β”œβ”€β”€ contact.js                # Contact form handler
β”‚       └── proxy-image.js            # Image proxy for CORS
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Dashboard/                    # Dashboard widgets
β”‚   β”œβ”€β”€ Maps/                         # Map components
β”‚   β”œβ”€β”€ Charts/                       # Chart components
β”‚   └── Layout/                       # Layout components
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ db.js                         # Database connection
β”‚   β”œβ”€β”€ bedrock.js                    # Amazon Bedrock client
β”‚   └── utils.js                      # Helper functions
└── public/
    └── scs/                          # Screenshots

πŸš€ Getting Started ​

Prerequisites ​

  • Node.js 18+ and npm
  • Access to backend API (www.ecolafaek.xyz)

Installation ​

  1. Clone the repository:
bash
git clone https://github.com/ajitonelsonn/EcoLafaek.git
cd EcoLafaek/ecolafaek_public_dahboard
  1. Install dependencies:
bash
npm install
  1. Create .env.local file:
env
# Backend API
NEXT_PUBLIC_API_URL=https://www.ecolafaek.xyz

# Database (for direct queries from Next.js API routes)
DB_HOST=your-database-host
DB_PORT=4000
DB_USER=your-db-user
DB_PASSWORD=your-db-password
DB_NAME=your-db-name

# AWS Bedrock (for vector search API route)
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
AWS_REGION=us-east-1

# Google reCAPTCHA (for chat protection)
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=your-site-key
RECAPTCHA_SECRET_KEY=your-secret-key
  1. Run development server:
bash
npm run dev

Open http://localhost:3000

Build for Production ​

bash
npm run build
npm start

πŸ”‘ Key Pages ​

1. AgentCore AI Chat (/agentcore-chat) ​

  • Natural language queries to autonomous AI agent
  • Multi-round tool calling (SQL β†’ Charts β†’ Maps β†’ Web Scraping)
  • Real-time chart/map generation via AgentCore Code Interpreter
  • PDF export of conversation history
  • reCAPTCHA protection

Example Queries:

  • "Show me waste trends over the last month"
  • "Create a map of high-severity hotspots"
  • "Generate a pie chart of waste types"
  • Semantic similarity search using Amazon Titan Embed embeddings
  • Find similar waste reports based on image/text content
  • Cosine similarity matching

3. Reports (/reports) ​

  • Browse all waste reports with filtering
  • Direct database queries from Next.js API routes
  • Pagination and search

4. Interactive Map (/map) ​

  • Geospatial visualization
  • Hotspot clustering
  • Real-time updates

πŸ“Š API Routes ​

EndpointPurposeIntegration
/api/chatProxy AgentCore chat to backendFastAPI + Bedrock AgentCore
/api/contactContact form submissionsEmail service
/api/proxy-imageCORS-safe image proxyS3 images

πŸ”’ Security Features ​

  • reCAPTCHA v2: Bot protection for AI chat
  • Rate Limiting: 30 requests/minute per IP
  • API Key Authentication: Secure backend communication
  • CORS Configuration: Restricted origins
  • Session Management: 5-minute chat token validity

🚒 Deployment (Vercel) ​

This dashboard is deployed on Vercel with automatic deployments from Git:

bash
# Automatic deployment on push to main branch
git push origin main

Live URL: https://www.ecolafaek.com

Environment Variables (Vercel) ​

Configure all .env.local variables in Vercel dashboard under Project Settings β†’ Environment Variables.

πŸ“– For Judges ​

Testing the Dashboard: ​

  1. Visit: https://www.ecolafaek.com
  2. Try AI Chat: Navigate to "Agent Chat" and ask questions like:
    • "Show waste type distribution chart"
    • "Create a map of hotspots"
    • "How many reports were submitted this month?"
  3. Vector Search: Try semantic search for similar waste reports
  4. Explore Maps: Interactive geospatial visualization

Key Features to Review: ​

βœ… Autonomous AI agent with multi-round tool calling βœ… Real-time chart generation via AgentCore Code Interpreter βœ… Semantic vector search with Amazon Titan Embed βœ… Clean, responsive UI with real production data


πŸ“ž Additional Documentation ​


Built with ❀️ for Timor-Leste | AWS AI Agent Global Hackathon

Powered by Amazon Bedrock AgentCore

Built with ❀️ for Timor-Leste | AWS AI Agent Global Hackathon