Bunkr

Bunkr - Attendance Tracker PWA

A minimal but ready-to-deploy Progressive Web App (PWA) for tracking attendance with Supabase authentication, course management, and duty leave document uploads.

✨ Features

🔐 Authentication

📚 Course Management

📅 Attendance Overview

📄 Duty Leave Management

🎨 Themes

📱 PWA Features

🚀 Tech Stack

📋 Prerequisites

🛠️ Setup Instructions

1. Clone and Install

git clone <your-repo-url>
cd bunkr
npm install

2. Supabase Setup

  1. Create Supabase Project
    • Go to supabase.com
    • Create a new project
    • Note your project URL and anon key
  2. Database Setup
    • Go to SQL Editor in your Supabase dashboard
    • Copy and paste the contents of supabase-setup.sql
    • Execute the SQL to create tables and policies
  3. Environment Variables
    • Copy env.example to .env.local
    • Fill in your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
NEXT_PUBLIC_APP_NAME=Bunkr
NEXT_PUBLIC_APP_VERSION=0.1.0

3. Development

npm run dev

Open http://localhost:3000 in your browser.

4. Build and Deploy

npm run build
npm start

🗄️ Database Schema

Tables

Row Level Security (RLS)

All tables have RLS enabled with policies ensuring users can only access their own data.

📱 PWA Configuration

The app includes:

🎨 Theme System

Midnight Scholar (Dark)

Metallic Luxe (Light)

🔒 Security Features

📊 Attendance Logic

Percentage = (Sum of weights / Total counted sessions) × 100

🚀 Deployment

  1. Connect your GitHub repository to Vercel
  2. Add environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Other Platforms

The app can be deployed to any platform supporting Next.js:

📁 Project Structure

src/
├── app/                    # Next.js app router
│   ├── dashboard/         # Dashboard pages
│   ├── globals.css        # Global styles
│   └── layout.tsx         # Root layout
├── components/            # Reusable components
│   ├── auth/             # Authentication components
│   └── layout/           # Layout components
├── contexts/              # React contexts
├── lib/                   # Utilities and configurations
└── types/                 # TypeScript type definitions

🔧 Customization

Adding New Features

  1. New Pages: Add routes in src/app/
  2. Components: Create in src/components/
  3. Database: Add tables and policies in Supabase
  4. Styling: Modify src/app/globals.css and Tailwind config

Theme Customization

Edit src/lib/themes.ts to modify color schemes and add new themes.

🐛 Troubleshooting

Common Issues

  1. Authentication Errors: Check Supabase credentials and policies
  2. Database Connection: Verify Supabase project status
  3. PWA Issues: Clear browser cache and service worker
  4. Build Errors: Ensure all dependencies are installed

Support

📄 License

This project is licensed under the MIT License.

🤝 Contributing

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

🙏 Acknowledgments


Bunkr - Making attendance tracking simple and beautiful. 📚✨