π Access the app here: greenloop-project.vercel.app
A comprehensive employee engagement platform designed to promote sustainability initiatives, track environmental impact, and build a greener workplace culture through gamification and team collaboration.
GreenLoop is a modern web application built with Next.js 14 that empowers organizations to engage their employees in sustainability initiatives. The platform combines gamification elements with comprehensive tracking and analytics to drive meaningful environmental change.
- π Sustainability Actions: Comprehensive library of eco-friendly actions employees can take
- π Gamification: Points, badges, levels, and challenges to motivate participation
- π₯ Team Collaboration: Team-based challenges and leaderboards
- π Analytics Dashboard: Detailed insights into environmental impact and engagement
- π Enterprise Authentication: Microsoft SSO integration and role-based access
- βοΈ Admin Management: Complete administrative control over platform settings
- π± Responsive Design: Modern, mobile-first UI built with Tailwind CSS
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Lucide React - Beautiful icon library
- Recharts - Data visualization
- Supabase - Backend-as-a-Service with PostgreSQL
- Row Level Security (RLS) - Database-level security
- Real-time subscriptions - Live updates
- Supabase Auth - User authentication and management
- Microsoft OAuth - Enterprise SSO integration
- PKCE Flow - Secure OAuth implementation
- ESLint - Code linting
- PostCSS - CSS processing
- pnpm - Package management
- Node.js 18+
- pnpm (recommended) or npm
- Supabase account and project
- Microsoft Azure App Registration (for SSO)
-
Clone the repository
git clone https://github.com/your-username/greenloop_project.git cd greenloop_project -
Install dependencies
pnpm install
-
Environment Setup Create a
.env.localfile in the root directory:# Supabase Configuration NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key # Site Configuration NEXT_PUBLIC_SITE_URL=http://localhost:3000 NEXT_PUBLIC_DEV_SUPABASE_REDIRECT_URL=http://localhost:3000/dashboard # Microsoft OAuth (Optional) MICROSOFT_CLIENT_ID=your_microsoft_client_id MICROSOFT_CLIENT_SECRET=your_microsoft_client_secret MICROSOFT_TENANT_ID=your_microsoft_tenant_id
-
Database Setup
- Import the database schema from
schema_dump.sqlinto your Supabase project - Configure Row Level Security policies as needed
- Import the database schema from
-
Run the development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
greenloop_project/
βββ app/ # Next.js App Router pages
β βββ admin/ # Admin dashboard and management
β βββ auth/ # Authentication pages
β βββ api/ # API routes
β βββ dashboard/ # User dashboard
β βββ actions/ # Sustainability actions
β βββ challenges/ # Team challenges
β βββ teams/ # Team management
β βββ ...
βββ components/ # Reusable React components
β βββ ui/ # Base UI components
β βββ admin/ # Admin-specific components
β βββ charts/ # Data visualization components
βββ lib/ # Utility libraries
β βββ supabase/ # Supabase client configurations
β βββ validations/ # Form validation schemas
βββ hooks/ # Custom React hooks
βββ public/ # Static assets
The platform can be customized through the admin settings panel:
- Platform Name: Customize the application name
- Company Name: Set your organization's name
- Registration Control: Enable/disable user registration
- Team Settings: Configure team creation and size limits
- Challenge Settings: Control challenge creation permissions
Key database tables include:
users- User profiles and authenticationsustainability_actions- Available eco-friendly actionsuser_actions- User-submitted action completionschallenges- Team-based sustainability challengesteams- Team management and membershipbadges- Achievement systempoint_transactions- Points tracking and history
- Action Library: Browse and complete sustainability actions
- Points & Badges: Earn rewards for environmental contributions
- Team Challenges: Collaborate with colleagues on sustainability goals
- Personal Dashboard: Track progress and achievements
- Leaderboards: Compete with peers in friendly competition
- Analytics Dashboard: Comprehensive insights into platform usage
- Content Management: Create and manage sustainability actions
- User Management: Oversee user accounts and permissions
- Challenge Administration: Set up team challenges and competitions
- System Settings: Configure platform-wide settings
- Environmental Impact Tracking: Measure COβ reductions and sustainability metrics
- Employee Engagement: Boost morale through meaningful sustainability initiatives
- Corporate Social Responsibility: Demonstrate commitment to environmental goals
- Community Building: Foster team collaboration around shared values
The platform supports multiple authentication methods:
- Email/Password: Traditional authentication with email verification
- Microsoft SSO: Enterprise single sign-on integration
- Invitation System: Admin-controlled user onboarding
- Row Level Security (RLS) policies
- Role-based access control
- Secure password requirements
- Email verification for new accounts
- Admin-controlled registration
The platform provides comprehensive analytics including:
- User engagement metrics
- Environmental impact calculations
- Team performance tracking
- Monthly trend analysis
- Category breakdown of actions
- Top performer identification
- Connect your GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy automatically on push to main branch
The application can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation in the
/docsfolder - Review the Supabase documentation for database-related questions
GreenLoop - Empowering organizations to build a sustainable future, one action at a time. π±