Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c235300
Style and UX overhaul
small-cactus Apr 17, 2025
4b2bee7
Full screen QR code fix
small-cactus Apr 17, 2025
1b3fe1f
Fix metadata
small-cactus Apr 17, 2025
fa60f57
add logo and fix QR code link
small-cactus Apr 17, 2025
9b4b8df
fix qr code
small-cactus Apr 17, 2025
494cae6
Fix logic error for QR scans
small-cactus Apr 17, 2025
c922dd8
Fix event missing club member
small-cactus Apr 17, 2025
44c113f
QOL and function additions
small-cactus Apr 17, 2025
348ace7
calm update
small-cactus Apr 17, 2025
ecff79a
function fix
small-cactus Apr 24, 2025
e7a9565
ISSUE FIXED
small-cactus Apr 24, 2025
2261f6e
Update Welcome.tsx
small-cactus Apr 24, 2025
1984fb0
brand new landing page
small-cactus Apr 24, 2025
be488ca
mobile design
small-cactus Apr 24, 2025
a4c05e4
Update Welcome.tsx
small-cactus Apr 24, 2025
bd94ce3
added background
small-cactus Apr 24, 2025
8a75990
Added vercel stuff
small-cactus Apr 24, 2025
9e1b3b2
Update Layout.tsx
small-cactus Apr 24, 2025
437e476
vercel stuff
small-cactus Apr 24, 2025
5437090
Update index.html
small-cactus Apr 24, 2025
e3ca27f
SEO
small-cactus Apr 24, 2025
b67ee76
Update index.html
small-cactus Apr 24, 2025
0fead41
SEO
small-cactus Apr 24, 2025
8b2aeaa
Design change (welcome page)
small-cactus Apr 25, 2025
f74295a
changes
small-cactus Apr 25, 2025
fdf1ad7
google analytics
small-cactus Apr 26, 2025
1dc20cc
Update index.html
small-cactus Apr 26, 2025
184cbce
Update sitemap.xml
small-cactus Apr 26, 2025
fed1c53
add demo
small-cactus Apr 29, 2025
9a2aff2
Update Login.tsx
small-cactus Apr 29, 2025
e75eea2
Update ClubJoinPage.tsx
small-cactus Apr 29, 2025
f93e15f
bug fix
small-cactus May 20, 2025
a750460
fix timezone display for event dates
small-cactus Jun 4, 2025
d3ff38e
Merge pull request #1 from small-cactus/codex/fix-event-time-display-bug
small-cactus Jun 4, 2025
9c36871
Fix dashboard load for guest users
small-cactus Jun 4, 2025
e4e133b
Merge pull request #3 from small-cactus/k8l5lw-codex/fix-dashboard-re…
small-cactus Jun 4, 2025
264dc47
fix: show correct event time on dashboard
small-cactus Jun 4, 2025
fff3b40
Merge pull request #4 from small-cactus/codex/fix-time-display-in-stu…
small-cactus Jun 4, 2025
4fd4e5e
Improve name autocomplete
small-cactus Jun 4, 2025
534d375
Merge pull request #6 from small-cactus/rzq70u-codex/fix-close-match-…
small-cactus Jun 4, 2025
5ee8293
fix event time display on dashboard
small-cactus Jun 4, 2025
248672d
Merge pull request #7 from small-cactus/codex/fix-event-time-display-…
small-cactus Jun 4, 2025
f4aae03
fix: prevent tab content flicker
small-cactus Jun 4, 2025
15b5d75
Merge pull request #8 from small-cactus/codex/fix-flickering-blur-in-…
small-cactus Jun 4, 2025
a1e2a9b
Ensure event check-in button disables before start
small-cactus Jun 4, 2025
32187ff
Merge pull request #11 from small-cactus/ypqczm-codex/gray-out-event-…
small-cactus Jun 4, 2025
29bc8f8
Fix event time display
small-cactus Jun 5, 2025
ec4e4b5
Merge pull request #13 from small-cactus/7e2fyt-codex/fix-event-time-…
small-cactus Jun 5, 2025
d818a13
Refine QR page and role selection
small-cactus Jul 17, 2025
2cfa20e
Merge pull request #17 from small-cactus/xd6urz-codex/update-qr-event…
small-cactus Jul 17, 2025
ca6af09
Improve scroll reset and disable mobile auto scroll
small-cactus Jul 18, 2025
de407d8
Merge pull request #21 from small-cactus/189fwt-codex/improve-mobile-…
small-cactus Jul 18, 2025
5169353
UI fixes
small-cactus Jul 18, 2025
adf3aaf
build fixes
small-cactus Jul 18, 2025
91caba9
ios app
small-cactus Jul 18, 2025
a156332
Update index.html
small-cactus Jul 18, 2025
6311a1d
Update index.html
small-cactus Jul 18, 2025
88e2d40
state changes
small-cactus Jul 18, 2025
c8272ee
refactor: redesign landing page
small-cactus Aug 8, 2025
44e3cea
fix: show redesigned home on root
small-cactus Aug 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 195 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Attendify is a modern attendance tracking platform for school clubs and organizations built with React, TypeScript, and Supabase. It provides features for managing clubs, events, members, and tracking attendance with location-based verification.

## Development Commands

```bash
# Install dependencies
npm install

# Start development server (runs on http://localhost:5173)
npm run dev

# Build for production (runs TypeScript check then Vite build)
npm run build

# Preview production build locally
npm run preview

# Run ESLint
npm run lint
```

## Architecture & Code Structure

### Frontend Architecture
- **Framework**: React 18 with TypeScript and Vite
- **Routing**: React Router v7 with file-based routing in `/src/pages/`
- **State Management**: React Context API (see `/src/contexts/AuthContext.tsx`)
- **Styling**: Tailwind CSS with custom theme + shadcn/ui components
- **Forms**: React Hook Form with Zod validation
- **UI Components**: Custom components in `/src/components/` with shadcn/ui base components in `/src/components/ui/`

### Backend Services
- **Supabase**: Handles authentication, database (PostgreSQL), and file storage
- **Database Schema**: Complex relational structure with tables for:
- Users, clubs, events, members, attendance records
- Authentication (identities, sessions, mfa)
- Storage (buckets, objects)
- Audit logging and flow states

### Key Technical Patterns

1. **Authentication Flow**:
- AuthContext provides user state and auth methods
- Protected routes check authentication status
- Supabase handles session management

2. **Data Fetching**:
- Direct Supabase client calls in components
- No centralized data fetching layer or caching
- Real-time subscriptions available but not extensively used

3. **Location Features**:
- Geolocation utilities in `/src/utils/geolocation.ts`
- Used for event check-in verification
- Integrates with Leaflet for map displays

4. **Component Structure**:
- Pages handle routing and data fetching
- Components are mostly presentational
- UI components follow shadcn/ui patterns with Radix UI primitives

### Important Implementation Details

1. **Path Aliases**: TypeScript configured with `@/*` alias pointing to `/src/*`

2. **Deployment**: Configured for Vercel with SPA routing (see `vercel.json`)

3. **No Testing Framework**: Currently no unit or E2E tests configured

4. **Database Migrations**: Utility exists at `/src/utils/dbMigrations.ts` but implementation details vary

5. **File Uploads**: Supabase storage buckets configured for club and user avatars

6. **Analytics**: Vercel Analytics and Speed Insights integrated

## Common Development Tasks

When working on new features:
1. Check existing patterns in similar components
2. Use the established UI component library (shadcn/ui)
3. Follow the existing file structure (pages in `/src/pages/`, components in `/src/components/`)
4. Maintain TypeScript strict mode compliance
5. Use Tailwind classes for styling, avoid inline styles

When debugging:
1. Check browser console for Supabase errors
2. Verify authentication state in AuthContext
3. Check network tab for failed API calls
4. Ensure environment has correct Supabase credentials

## Code Style Guidelines

- TypeScript with strict mode enabled
- React functional components with hooks
- Tailwind CSS for styling with custom theme extensions
- ESLint configured for React and TypeScript
- Path imports using `@/` alias
- Form validation using React Hook Form + Zod

## Performance Fixes Applied

### Animation Flicker Fix (Clubs Page - December 2024)

**Problem**: Cards/list items had visible flicker during fade-in animations, appearing briefly then jumping to new position before animating properly.

**Root Causes Identified**:
1. **AuthContext creating new objects**: `useAuth()` was creating new user objects on every render even when data was identical
2. **Framer Motion animation conflicts**: Complex animation state dependencies caused restart cycles
3. **Excessive re-renders**: Component rendered 15+ times instead of ~5 legitimate renders

**Solutions Applied**:

1. **Fixed AuthContext Performance** (`/src/contexts/AuthContext.tsx`):
```tsx
// Memoize user object to prevent recreation with identical data
const stableUser = useMemo(() => {
return user;
}, [user?.id, user?.email, user?.created_at]);

// Memoize context value to prevent unnecessary re-renders
const contextValue = useMemo(() => ({
user: stableUser,
loading,
signUp,
signIn,
signOut
}), [stableUser, loading]);

// Memoize functions to prevent recreation
const signUp = useCallback(async (email: string, password: string) => {
// ... implementation
}, []);
```

2. **Replaced Framer Motion with CSS Transitions**:
```tsx
// Before: Complex Framer Motion (caused restarts)
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: shouldAnimate ? 1 : 0 }}
transition={{ duration: 0.3, delay: index * 0.08 }}
>

// After: Pure CSS transitions (stable)
<div
style={{
opacity: shouldAnimate ? 1 : 0,
transition: `opacity 300ms ease-out ${shouldAnimate ? index * 80 : 0}ms`
}}
className="transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5"
>
```

3. **Optimized State Management**:
```tsx
// Memoize filtered arrays to prevent recreation
const filteredClubs = useMemo(() => {
return clubs.filter(club =>
club.name.toLowerCase().includes(searchQuery.toLowerCase())
);
}, [clubs, searchQuery]);

// Use refs to prevent useEffect re-runs
const isFetchingRef = useRef(false);

// Batch state updates with startTransition
startTransition(() => {
setClubs(data);
setError(null);
setFetching(false);
});
```

**Results**:
- ✅ Eliminated animation flicker completely
- ✅ Reduced renders from 15+ to ~5 legitimate renders
- ✅ Improved performance across all pages using AuthContext
- ✅ Stable, smooth fade-in animations

**Apply These Patterns When**:
- List items flicker during animations
- Components re-render excessively (use debug logging to identify)
- Framer Motion animations restart unexpectedly
- Context values cause unnecessary re-renders

**Debugging Tools Created**:
- Debug panel component for tracking render causes
- Render cause detection using `useRef` for previous values comparison
- AuthContext call frequency tracking
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# React + TypeScript + Vite
# <img src="public/attendify-favicon.png" alt="Attendify logo" width="32" style="vertical-align:middle; margin-right:8px;"/> Attendify

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Attendify is a modern attendance tracking platform designed for school clubs and organizations. Effortlessly manage attendance, clubs, and members with a clean, intuitive interface.

While this project uses React, Vite supports many popular JS frameworks. [See all the supported frameworks](https://vitejs.dev/guide/#scaffolding-your-first-vite-project).
## Features
- Easy attendance tracking for clubs and events
- Club and member management
- Detailed participation reports
- User-friendly, modern design

## Deploy Your Own
## Getting Started

Deploy your own Vite project with Vercel.
1. Install dependencies:
```bash
npm install
```
2. Start the development server:
```bash
npm run dev
```

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/vite-react&template=vite-react)

_Live Example: https://vite-react-example.vercel.app_

### Deploying From Your Terminal

You can deploy your new Vite project with a single command from your terminal using [Vercel CLI](https://vercel.com/download):

```shell
$ vercel
```
## License
MIT
21 changes: 21 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
Loading