An open API service indexing awesome lists of open source software.

https://github.com/hk-dev13/envoyou-page-react

Environmental Data Verification API-Landing-page
https://github.com/hk-dev13/envoyou-page-react

api css html5 javascript landingpage permit react reactjs tailwindcss tailwindcss-v4 vitejs website

Last synced: 2 months ago
JSON representation

Environmental Data Verification API-Landing-page

Awesome Lists containing this project

README

          

# ๐Ÿš€ Envoyou - Global Environmental Data API Landing Page

A modern, high-performance React landing page for the Envoyou environmental data verification API, built with Vite and optimized for production with **full FastAPI backend integration**.

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![React](https://img.shields.io/badge/React-19-blue.svg)
![Vite](https://img.shields.io/badge/Vite-Latest-green.svg)
![Tailwind](https://img.shields.io/badge/Tailwind-v4-blue.svg)

## Features

### **Core Features**
- **Modern React 19** with Vite for lightning-fast development
- **Tailwind CSS v4** for beautiful, responsive design
- **AOS (Animate On Scroll)** for smooth scroll animations
- **Chart.js Integration** for data visualizations
- **React Router** for seamless navigation
- **๐Ÿ”„ Full Backend Integration** - Connected to FastAPI backend with real data
- **๐Ÿ”‘ Demo API Key System** - Instant access to real environmental data
- **๐Ÿ“Š Real-time API Testing** - Built-in API tester with connection monitoring

### โšก **Performance Optimizations**
- **Lazy Loading** - Components load only when needed
- **Code Splitting** - Optimized bundle chunks for better caching
- **Error Boundaries** - Graceful error handling with user-friendly UI
- **Optimized Build** - Production-ready with source maps

### ๐Ÿ” **SEO & Accessibility**
- **Structured Data (JSON-LD)** for rich search results
- **Open Graph & Twitter Cards** for social sharing
- **ARIA Labels & Keyboard Navigation** for accessibility
- **Canonical URLs** and meta tags for SEO
- **DNS Prefetching** for faster resource loading

### ๐Ÿ“Š **Analytics Ready**
- **Google Analytics 4** integration
- **Custom Event Tracking** setup
- **Performance Monitoring** configuration

### ๐ŸŒ **Backend Integration Features**
- **๐Ÿ” CEVS Score Lookup** - Real company environmental scores
- **๐Ÿ“ˆ Emissions Data** - EPA power plant data with filtering
- **๐ŸŒ Global ISO Certifications** - ISO 14001 environmental certifications
- **๐ŸŽฏ Demo API Keys** - Instant access without registration
- **๐Ÿ“ก Connection Status** - Real-time backend monitoring
- **๐Ÿ”ง API Testing Tools** - Built-in endpoint testing interface

## ๐Ÿš€ Getting Started

### Prerequisites
- Node.js 18+
- npm or yarn

### Installation

1. **Clone the repository**
```bash
git clone https://github.com/hk-dev13/ENVOYou-page.git
cd envoyou-page-react
```

2. **Install dependencies**
```bash
npm install
```

3. **Set up environment variables**
```bash
cp .env.example .env
# Edit .env with your actual values
```

4. **Start FastAPI Backend** (Required for full functionality)
```bash
# Make sure FastAPI backend is running on http://localhost:8000
# Backend should have the demo API key endpoint: /admin/request-demo-key
```

5. **Start development server**
```bash
npm run dev
```

6. **Open your browser**
```
http://localhost:5173
```

7. **Get Demo API Key**
- Click the floating API status button (bottom-right)
- Use "Get Demo API Key" to access real data
- Test all endpoints with real environmental data

## ๐Ÿ“ Project Structure

```
src/
โ”œโ”€โ”€ components/
โ”‚ โ”œโ”€โ”€ ErrorBoundary.jsx # Error handling component
โ”‚ โ”œโ”€โ”€ Header.jsx # Navigation header
โ”‚ โ”œโ”€โ”€ Footer.jsx # Site footer
โ”‚ โ”œโ”€โ”€ HeroSection.jsx # Hero/landing section
โ”‚ โ”œโ”€โ”€ FeaturesSection.jsx # Features showcase
โ”‚ โ”œโ”€โ”€ PricingSection.jsx # Pricing plans
โ”‚ โ”œโ”€โ”€ CodeExampleSection.jsx # API examples
โ”‚ โ”œโ”€โ”€ VisualizationsSection.jsx # Data charts
โ”‚ โ”œโ”€โ”€ CevsLookupSection.jsx # CEVS lookup tool (connected to backend)
โ”‚ โ”œโ”€โ”€ APITester.jsx # Real-time API testing interface
โ”‚ โ”œโ”€โ”€ DemoKeyManager.jsx # Demo API key management
โ”‚ โ”œโ”€โ”€ ScrollToTop.jsx # Auto scroll-to-top on navigation
โ”‚ โ””โ”€โ”€ BackToTop.jsx # Back to top button
โ”œโ”€โ”€ pages/
โ”‚ โ”œโ”€โ”€ HomePage.jsx # Main landing page
โ”‚ โ”œโ”€โ”€ DocumentationPage.jsx # API documentation
โ”‚ โ”œโ”€โ”€ AboutPage.jsx # About us page
โ”‚ โ”œโ”€โ”€ ContactPage.jsx # Contact page
โ”‚ โ””โ”€โ”€ FreeAPIKeyPage.jsx # API key registration
โ”œโ”€โ”€ services/
โ”‚ โ””โ”€โ”€ apiService.js # Backend API integration service
โ”œโ”€โ”€ App.jsx # Main app component
โ””โ”€โ”€ main.jsx # App entry point
```

## ๏ฟฝ Backend Integration

### Features
- **๐Ÿ”„ Real-time Data**: Connected to FastAPI backend with live environmental data
- **๐ŸŽฏ Demo API Keys**: Get instant access without registration
- **๐Ÿ“Š Connection Monitor**: Real-time backend status indicator
- **๐Ÿงช API Testing**: Built-in testing interface for all endpoints

### API Endpoints Available
- **Health Check**: `/health` - No authentication required
- **CEVS Data**: `/global/cevs/{company_name}` - Company environmental scores
- **Emissions**: `/global/emissions` - EPA power plant emissions data
- **ISO Certifications**: `/global/iso` - Global ISO 14001 certificates
- **Demo Keys**: `/admin/request-demo-key` - Get temporary API access

### Getting Started with API
1. **Start the application** - Frontend connects automatically
2. **Click API status button** - Green circle in bottom-right corner
3. **Get Demo API Key** - Click "Get Demo API Key" button
4. **Test endpoints** - Use built-in testing interface
5. **Try CEVS lookup** - Search real company data on homepage

### API Response Examples

#### CEVS Score Response
```json
{
"status": "success",
"company": "Shell",
"score": 50.0,
"components": {
"base": 50.0,
"iso_bonus": 0.0,
"epa_penalty": 0.0,
"renewables_bonus": 0.0
},
"sources": {
"epa_matches": 0,
"iso_count": 40
}
}
```

#### Demo API Key Response
```json
{
"status": "success",
"data": {
"api_key": "ae21b9776a23b7e7fa28856dd9810544",
"client_name": "Demo User",
"tier": "basic",
"requests_per_minute": 30
}
}
```

## ๏ฟฝ๐Ÿ› ๏ธ Available Scripts

- `npm run dev` - Start development server
- `npm run build` - Build for production
- `npm run preview` - Preview production build
- `npm run lint` - Run ESLint

## ๐Ÿ”ง Configuration

### Environment Variables

Create a `.env` file with:

```env
# Backend API Configuration
VITE_API_URL=http://localhost:8000
VITE_API_KEY=your_production_api_key

# Analytics
VITE_GA_TRACKING_ID=G-YOUR-GA4-ID

# App Settings
VITE_APP_NAME=Envoyou
VITE_APP_DESCRIPTION=Global Environmental Data API
```

### Backend Integration

This frontend is designed to work with the FastAPI backend. Make sure:

1. **Backend Running**: FastAPI server at `http://localhost:8000`
2. **Demo Endpoint**: `/admin/request-demo-key` available
3. **CORS Enabled**: Frontend origin `http://localhost:5173` allowed
4. **All Endpoints**: Health, CEVS, Emissions, ISO data available

#### Quick Backend Test
```bash
# Test if backend is running
curl http://localhost:8000/health

# Test demo API key endpoint
curl -X POST http://localhost:8000/admin/request-demo-key \
-H "Content-Type: application/json" \
-d '{"client_name":"Test User"}'
```

### Google Analytics Setup

1. Replace `G-XXXXXXXXXX` in `index.html` with your GA4 ID
2. Update the tracking configuration as needed

## ๐ŸŽจ Customization

### Colors & Branding
- Primary: Emerald (`emerald-500`)
- Background: Dark slate (`slate-900`)
- Accent: Sky blue (`sky-300`)

### Animations
- AOS library configured with:
- Duration: 1200ms
- Offset: 100px
- Once: true (animations trigger once)

## ๐Ÿ“ˆ Performance Features

### Lazy Loading
Components are lazy-loaded for better initial page load:
```jsx
const HeroSection = lazy(() => import('../components/HeroSection'));
```

### Error Boundaries
Graceful error handling prevents app crashes:
```jsx

```

### Bundle Optimization
Automatic code splitting and chunk optimization for production builds.

## ๐Ÿ” SEO Features

### Structured Data
JSON-LD schema for better search engine understanding:
- SoftwareApplication schema
- Organization information
- Feature lists

### Meta Tags
Comprehensive meta tags for:
- Search engines
- Social media sharing
- Browser optimization

## โ™ฟ Accessibility

- ARIA labels on interactive elements
- Keyboard navigation support
- Focus management
- Screen reader friendly

## ๐Ÿ“Š Analytics & Monitoring

### Google Analytics 4
- Page view tracking
- Custom event tracking setup
- Performance monitoring

### Error Tracking
- Console error logging
- Development error details
- Production error boundaries

## ๐Ÿš€ Deployment

### Build for Production
```bash
npm run build
```

### Preview Production Build
```bash
npm run preview
```

### Deploy to Hosting
The `dist/` folder contains all files needed for deployment to:
- Vercel
- Netlify
- GitHub Pages
- Any static hosting service

## ๐Ÿš€ Deployment to Netlify

### Automatic Deployment

1. **Connect to Netlify**
- Go to [Netlify](https://netlify.com)
- Click "New site from Git"
- Connect your GitHub repository

2. **Configure Build Settings**
- **Build command**: `npm run build`
- **Publish directory**: `dist`
- **Node version**: 18.17.0 (matches `.nvmrc`)

3. **Environment Variables** (Optional)
- Add any variables from `.env.example` in Netlify dashboard

4. **Deploy**
- Netlify will automatically build and deploy on git push
- Your site will be live at `https://your-site-name.netlify.app`

### Manual Deployment

1. **Build the project**
```bash
npm run build
```

2. **Deploy to Netlify**
```bash
npx netlify-cli deploy --prod --dir=dist
```

### SEO & Performance Features

- โœ… **robots.txt** - Search engine crawling rules
- โœ… **sitemap.xml** - Site structure for search engines
- โœ… **_redirects** - SPA routing support
- โœ… **_headers** - Security headers and caching
- โœ… **netlify.toml** - Build configuration
- โœ… **Optimized chunks** - Better caching strategy
- โœ… **Gzip compression** - Faster loading

## ๐Ÿค Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Test thoroughly
5. Submit a pull request

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

### MIT License Summary

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.

**What you can do:**
- โœ… Commercial use
- โœ… Modification
- โœ… Distribution
- โœ… Private use

**What you must include:**
- ๐Ÿ“„ Copyright notice
- ๐Ÿ“„ License text

**What you cannot do:**
- โŒ Hold liable
- โŒ Use trademark

## ๏ฟฝ Additional Documentation

- **[Backend Integration Guide](./BACKEND_INTEGRATION.md)** - Detailed integration setup
- **[PWA Features](./PWA_README.md)** - Progressive Web App functionality
- **API Documentation** - Available in the app at `/documentation`

## ๏ฟฝ๐Ÿ“ž Support

- **Email**: support@envoyou.com
- **Website**: https://envoyou.com
- **GitHub Issues**: For bug reports and feature requests
- **API Documentation**: Available at `/documentation` or `http://localhost:8000/docs`
- **Backend Status**: Real-time monitoring via floating status indicator

## ๐ŸŽฏ Quick Demo

1. **Start backend**: `FastAPI server on http://localhost:8000`
2. **Start frontend**: `npm run dev`
3. **Get demo key**: Click green button โ†’ "Get Demo API Key"
4. **Test CEVS lookup**: Search "Shell" or "Tesla"
5. **Explore real data**: Company environmental scores with full breakdown

---

## Contact
Maintained by [Husni Kusuma](https://github.com/hk-dev13)
๐ŸŒ Website: [envoyou.com](https://envoyou.com)
๐Ÿ“ง More info: [info@envoyou.com](mailto:info@envoyou.com)

---
>

ยฉ 2025 Envoyou | All Rights Reserved


>

Empowering Global Environmental Transparency