Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram). AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan. Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
129 lines
4.3 KiB
Markdown
129 lines
4.3 KiB
Markdown
# Gitgram Web - Fixes and Implementation Plan
|
|
|
|
## โ
COMPLETED FIXES
|
|
|
|
### 1. Landing Page Layout (FIXED)
|
|
- **Issue**: Content was left-aligned instead of centered
|
|
- **Fix**:
|
|
- Updated `ConditionalLayout` to handle landing page separately
|
|
- Added proper centering with `items-center justify-center` on main container
|
|
- Changed all text colors to use design system variables (white, foreground-secondary)
|
|
- Updated borders and backgrounds to use design system colors
|
|
|
|
### 2. GitHub OAuth Button (FIXED)
|
|
- **Issue**: Button didn't work, no error handling
|
|
- **Fix**:
|
|
- Added proper error handling for missing `NEXT_PUBLIC_GITHUB_CLIENT_ID`
|
|
- Added URL encoding for redirect URI
|
|
- Added user-friendly error messages
|
|
- Added try-catch for error handling
|
|
|
|
### 3. Global CSS Reset (FIXED)
|
|
- **Issue**: Default browser margins/padding causing layout issues
|
|
- **Fix**: Added proper CSS reset for html, body, and all elements
|
|
|
|
### 4. Auth Pages Centering (FIXED)
|
|
- **Issue**: Login/Register pages not centered
|
|
- **Fix**: Updated `ConditionalLayout` to properly center auth pages
|
|
|
|
## ๐ง IMPLEMENTATION PLAN
|
|
|
|
### Phase 1: Environment Setup (REQUIRED)
|
|
1. **Create `.env.local` file in `web/` directory:**
|
|
```env
|
|
NEXT_PUBLIC_GITHUB_CLIENT_ID=your_github_client_id_here
|
|
NEXT_PUBLIC_API_URL=http://localhost:4000/api
|
|
```
|
|
|
|
2. **Get GitHub OAuth Credentials:**
|
|
- Go to GitHub Settings > Developer settings > OAuth Apps
|
|
- Create new OAuth App
|
|
- Set Authorization callback URL: `http://localhost:3000/auth/github/callback`
|
|
- Copy Client ID to `.env.local`
|
|
|
|
### Phase 2: Backend API Verification
|
|
1. **Verify Backend Endpoints:**
|
|
- `/api/v1/auth/github` - GitHub OAuth callback handler
|
|
- `/api/v1/auth/login` - Email/password login
|
|
- `/api/v1/auth/register` - User registration
|
|
- All endpoints should return proper JSON responses
|
|
|
|
2. **Test API Connection:**
|
|
- Ensure backend is running on port 4000 (or update `NEXT_PUBLIC_API_URL`)
|
|
- Test with Postman/curl to verify endpoints work
|
|
|
|
### Phase 3: Frontend Functionality
|
|
1. **Authentication Flow:**
|
|
- โ
GitHub OAuth button (with error handling)
|
|
- โ
Email/password login
|
|
- โ
User registration
|
|
- โ
Token storage in Zustand store
|
|
- โ
Protected routes
|
|
|
|
2. **Page Layouts:**
|
|
- โ
Landing page (centered, proper styling)
|
|
- โ
Login page (centered)
|
|
- โ
Register page (centered)
|
|
- โ
Feed page (with sidebar)
|
|
- โ
Profile pages
|
|
- โ
All other pages
|
|
|
|
### Phase 4: Testing Checklist
|
|
- [ ] Landing page displays centered
|
|
- [ ] "Connect with GitHub" button works (redirects to GitHub)
|
|
- [ ] GitHub OAuth callback works (redirects back and logs in)
|
|
- [ ] Login form works
|
|
- [ ] Register form works
|
|
- [ ] All pages are properly centered
|
|
- [ ] Navigation works
|
|
- [ ] Protected routes redirect to login if not authenticated
|
|
|
|
## ๐ KNOWN ISSUES TO FIX
|
|
|
|
### 1. Environment Variables
|
|
- **Problem**: `NEXT_PUBLIC_GITHUB_CLIENT_ID` might not be set
|
|
- **Solution**: Create `.env.local` file (see Phase 1)
|
|
|
|
### 2. Backend Connection
|
|
- **Problem**: API might not be running or URL incorrect
|
|
- **Solution**: Verify `NEXT_PUBLIC_API_URL` in `.env.local`
|
|
|
|
### 3. GitHub OAuth Callback
|
|
- **Problem**: Callback URL must match GitHub OAuth app settings
|
|
- **Solution**: Ensure callback URL in GitHub matches: `http://localhost:3000/auth/github/callback`
|
|
|
|
## ๐ NEXT STEPS
|
|
|
|
1. **Set up environment variables** (`.env.local`)
|
|
2. **Start backend server** (if not running)
|
|
3. **Test GitHub OAuth flow** end-to-end
|
|
4. **Verify all pages load correctly**
|
|
5. **Test authentication flows**
|
|
|
|
## ๐จ Design System Consistency
|
|
|
|
All pages now use:
|
|
- **Colors**: Design system variables (primary, background-dark, surface, etc.)
|
|
- **Typography**: Space Grotesk font
|
|
- **Spacing**: Consistent padding and margins
|
|
- **Layout**: Centered content with max-width constraints
|
|
- **Components**: Reusable UI components from `components/ui/`
|
|
|
|
## โ ๏ธ IMPORTANT NOTES
|
|
|
|
1. **GitHub OAuth requires:**
|
|
- GitHub OAuth App created
|
|
- Client ID in environment variables
|
|
- Backend endpoint `/api/v1/auth/github` working
|
|
|
|
2. **All functionality is REAL, not mocked:**
|
|
- Authentication uses real API calls
|
|
- All services connect to backend
|
|
- Error handling in place
|
|
|
|
3. **If something doesn't work:**
|
|
- Check browser console for errors
|
|
- Verify environment variables are set
|
|
- Ensure backend is running
|
|
- Check network tab for API calls
|