Skip to content

ammbo/zeroflex

Repository files navigation

ZeroFlex

ZeroFlex is a gamified email management application that helps users maintain inbox zero through streak tracking, badges, and leaderboards.

Core Features

  • Gmail Integration: Track inbox zero status via Gmail labels API
  • Streak Tracking: Daily tracking of inbox zero streaks
  • Signature Badges: Dynamic SVG badges to show off your streak in email signatures
  • Social Leaderboards: Compete with other users for the longest streaks
  • Achievements: Unlock achievements as you progress

Tech Stack

  • Frontend: Next.js 13.4, React 18, TypeScript, Tailwind CSS
  • Authentication: NextAuth.js with Google OAuth
  • Database: GibsonAI hosted database (MySQL)
  • API: Server-side API routes for all external communication

Getting Started

Prerequisites

  • Node.js (v18+)
  • Google API credentials for OAuth
  • GibsonAI project and API credentials

Environment Setup

Create a .env.local file with the following variables:

NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key

# Google OAuth
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Gibson API Keys
GIBSON_API_KEY=your-gibson-api-key
GIBSON_PROJECT_ID=your-gibson-project-id

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Initialize the database by seeding badges:
    # Visit this endpoint after starting the server
    http://localhost:3000/api/seed
    
  4. Start the development server:
    npm run dev
    

Deployment

  1. Build the project:
    npm run build
    
  2. Start the production server:
    npm start
    

Project Structure

See directory-tree.txt for a detailed overview of the project structure.

Badge System

Badges are dynamically generated SVGs that display:

  • Current streak count
  • Level (based on streak length)
  • Visual indicators of achievements

Users can embed these badges in their email signatures and when recipients click on them, they're taken to a public profile page.

Gmail Integration

The application uses the Gmail labels API to check inbox zero status. It only requests the minimum permissions needed:

  • https://www.googleapis.com/auth/gmail.labels
  • https://www.googleapis.com/auth/userinfo.email
  • https://www.googleapis.com/auth/userinfo.profile

License

MIT

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published