π A Next.js accountability platform that connects users in small groups (pods) to help them achieve their goals through peer support and daily check-ins.
- π User Authentication: Google OAuth via Firebase + traditional login/register with secure JWT sessions
- π₯ Accountability Pods: Smart matching algorithm that creates 4-6 member groups based on goals and preferences
- π Daily Check-ins: Progress tracking with streak counters and weekly summaries
- π¬ Real-time Chat: Pod communication powered by Socket.io with typing indicators
- π Crisis Support: Emergency alert system and personalized crisis toolkit
- π Leaderboard: Pod rankings, individual achievements, and badge system
- π± Responsive Design: Mobile-first design that works seamlessly on all devices
- π€ AI Integration: Gemini AI for generating anonymous names and supportive messages
- Guided onboarding for new users
- Anonymous display names for privacy
- Customizable availability schedules
- Avatar uploads with Cloudinary
- Real-time notifications
- Week progress visualization
- Framework: Next.js 16 (App Router + Turbopack)
- Language: TypeScript 5.0
- Styling: Tailwind CSS 3.4
- UI Components: shadcn/ui
- Icons: Lucide React
- Real-time: Socket.io Client
- API: Next.js API Routes (Edge & Node Runtime)
- ORM: Prisma 6.18
- Database: Neon PostgreSQL (with connection pooling)
- Authentication: NextAuth.js v4
- Real-time Server: Socket.io Server
- File Upload: Cloudinary
- AI: Google Gemini API
- Package Manager: npm
- Linting: ESLint 9
- Type Checking: TypeScript strict mode
- Deployment: Vercel (recommended)
- Version Control: Git
- Node.js: 18.x or higher
- npm: 9.x or higher
- PostgreSQL: Neon account (free tier available)
- Firebase: Google Cloud project for OAuth
- Cloudinary: Account for image uploads (optional)
- Gemini API: Google AI API key (optional, has fallback)
-
Clone the repository
git clone https://github.com/brittytino/podlink.git cd podlink -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:# Database Configuration DATABASE_URL="postgresql://user:password@host/database?sslmode=require" DIRECT_URL="postgresql://user:password@host/database?sslmode=require" # NextAuth Configuration NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-secret-key-generate-with-openssl-rand-base64-32" # Firebase Configuration (Google OAuth) NEXT_PUBLIC_FIREBASE_API_KEY="your-firebase-api-key" NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="your-project.firebaseapp.com" NEXT_PUBLIC_FIREBASE_PROJECT_ID="your-project-id" NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="your-project.appspot.com" NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="123456789" NEXT_PUBLIC_FIREBASE_APP_ID="1:123456789:web:abcdef" # Cloudinary Configuration (Image Uploads) CLOUDINARY_CLOUD_NAME="your-cloud-name" CLOUDINARY_API_KEY="your-api-key" CLOUDINARY_API_SECRET="your-api-secret" NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloud-name" # Socket.io Configuration SOCKET_PORT=3001 NEXT_PUBLIC_SOCKET_URL="http://localhost:3001" # AI Features (Optional - has fallback) GEMINI_API_KEY="your-gemini-api-key" GEMINI_MODEL="gemini-2.0-flash-exp"
-
Set up the database
# Reset database and apply all migrations npx prisma migrate reset --force # Generate Prisma Client npx prisma generate # Optional: Seed database with demo data npx prisma db seed
-
Start development servers
npm run dev
This will start:
- Next.js server on
http://localhost:3000 - Socket.io server on
http://localhost:3001 - Socket emit server on
http://localhost:3002
- Next.js server on
-
Open your browser
Navigate to
http://localhost:3000and start using PodLink!
# Build the application
npm run build
# Start production server
npm start-
Create Firebase Project
- Go to Firebase Console
- Click "Add project" and follow the setup wizard
- Enable Google Analytics (optional)
-
Enable Google Authentication
- In Firebase Console, go to "Authentication" β "Sign-in method"
- Enable "Google" provider
- Add your domain to authorized domains (e.g.,
localhost,your-app.vercel.app)
-
Get Configuration
- Go to Project Settings β General
- Scroll to "Your apps" section
- Click the web icon (
</>) to add a web app - Copy the configuration values to your
.env.local
-
Configure OAuth Consent Screen
- Go to Google Cloud Console
- Select your Firebase project
- Navigate to "APIs & Services" β "OAuth consent screen"
- Configure app name, support email, and authorized domains
-
Create Neon Account
- Sign up at Neon.tech
- Create a new project (free tier includes 1 project)
-
Get Connection Strings
- In Neon dashboard, click on your project
- Go to "Connection Details"
- Copy the Pooled connection string for
DATABASE_URL - Copy the Direct connection string for
DIRECT_URL - Important: Use pooled connection for better performance on free tier
-
Configure Database
- The database will auto-pause after 5 minutes of inactivity (free tier)
- First query may take 2-5 seconds to wake up the database
- The app handles this automatically with retry logic
-
Create Cloudinary Account
- Sign up at Cloudinary
- Free tier includes 25GB storage
-
Get API Credentials
- Go to Dashboard
- Copy Cloud Name, API Key, and API Secret
- Add them to
.env.local
-
Configure Upload Preset (Optional)
- Go to Settings β Upload
- Create an unsigned upload preset
- Set folder name to
podlink-avatars
-
Get API Key
- Go to Google AI Studio
- Create a new API key
- Add it to
.env.localasGEMINI_API_KEY
-
Note on Fallbacks
- If API key is not set or quota is exceeded, the app uses built-in fallback name generation
- AI features gracefully degrade to static responses
- The app remains fully functional without Gemini API
-
Push to GitHub
git add . git commit -m "Ready for deployment" git push origin main
-
Import to Vercel
- Go to Vercel Dashboard
- Click "New Project"
- Import your GitHub repository
- Vercel will auto-detect Next.js
-
Configure Environment Variables
- In Vercel project settings, go to "Environment Variables"
- Add all variables from your
.env.local - Make sure to add them for all environments (Production, Preview, Development)
-
Configure Build Settings
- Build Command:
npm run build - Output Directory:
.next - Install Command:
npm install - Node Version: 18.x
- Build Command:
-
Deploy
- Click "Deploy"
- Vercel will build and deploy your app
- Every push to
mainbranch will trigger automatic deployment
# Install Railway CLI
npm i -g @railway/cli
# Login and deploy
railway login
railway init
railway up- Create new Web Service
- Connect GitHub repository
- Set build command:
npm run build - Set start command:
npm start - Add environment variables
For production, update these environment variables:
NEXTAUTH_URL="https://your-domain.com"
NEXT_PUBLIC_SOCKET_URL="https://your-domain.com"-
New User Registration
- User clicks "Continue with Google" or uses email/password
- Firebase/NextAuth handles authentication
- User data stored in Neon PostgreSQL
- Anonymous display name generated via Gemini AI (or fallback)
- User redirected to onboarding
-
Onboarding Process
- Goal selection (quit habit vs. build habit)
- Goal category and description
- Gender selection (for pod matching)
- Availability schedule setup
- Timezone configuration
- Pod assignment based on preferences
-
Existing User Login
- Authentication via Google OAuth or credentials
- Session validation with NextAuth JWT
- Smart routing based on onboarding status
- Redirect to dashboard if onboarding complete
-
Session Management
- JWT tokens with secure httpOnly cookies
- Middleware protects all authenticated routes
- Auto-refresh on token expiration
- Logout clears all session data
-
Smart Matching Algorithm
- Groups users by goal type (quit/build habit)
- Matches similar goal categories
- Considers timezone and availability
- Balances pod sizes (4-6 members)
-
Pod Features
- Real-time chat with Socket.io
- Member presence indicators
- Shared streak tracking
- Crisis alert system
- Pod-wide achievements
- Simple yes/no tracking: "Did you stay on track today?"
- Automatic streak calculation
- Weekly progress summaries
- Visual progress indicators
- Achievement badges for milestones
-
Emergency Alerts
- One-click SOS button
- Instant notification to pod members
- AI-generated supportive messages
- Response tracking
-
Crisis Toolkit
- Personalized coping strategies
- Quick access resources
- Breathing exercises
- Emergency contacts
podlink/
βββ prisma/
β βββ schema.prisma # Database schema
β βββ seed.ts # Database seed data
β βββ migrations/ # Migration history
βββ public/ # Static assets
βββ scripts/ # Utility scripts
βββ src/
β βββ app/
β β βββ (auth)/ # Authentication pages
β β β βββ login/
β β β βββ register/
β β βββ (protected)/ # Protected routes
β β β βββ dashboard/
β β β βββ onboarding/
β β β βββ pod/
β β β βββ profile/
β β β βββ leaderboard/
β β β βββ crisis-toolkit/
β β βββ api/ # API routes
β β β βββ auth/ # NextAuth handlers
β β β βββ pods/ # Pod operations
β β β βββ check-ins/ # Check-in tracking
β β β βββ alerts/ # Crisis alerts
β β β βββ profile/ # User profile
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Landing page
β β βββ globals.css # Global styles
β βββ components/
β β βββ ui/ # shadcn/ui components
β β βββ auth/ # Auth components
β β βββ dashboard/ # Dashboard widgets
β β βββ pod/ # Pod chat & features
β β βββ profile/ # Profile management
β β βββ leaderboard/ # Rankings display
β β βββ toolkit/ # Crisis toolkit
β β βββ layout/ # Navigation components
β β βββ onboarding/ # Onboarding steps
β βββ hooks/
β β βββ useAuth.ts # Authentication hook
β β βββ useSocket.ts # Socket.io hook
β β βββ usePodMessages.ts # Pod chat hook
β β βββ use-toast.ts # Toast notifications
β βββ lib/
β β βββ auth.ts # NextAuth config
β β βββ prisma.ts # Prisma client
β β βββ firebase.ts # Firebase config
β β βββ gemini.ts # Gemini AI utils
β β βββ socket.ts # Socket.io server
β β βββ socket-emit.ts # Socket emit server
β β βββ cloudinary.ts # Image upload
β β βββ pod-matching.ts # Pod assignment logic
β β βββ utils.ts # Helper functions
β βββ types/
β β βββ index.ts # Shared types
β β βββ socket.ts # Socket event types
β β βββ next-auth.d.ts # NextAuth type extensions
β βββ middleware.ts # Route protection
β βββ styles/ # Additional styles
βββ server.mjs # Socket.io server
βββ package.json
βββ tsconfig.json
βββ next.config.js
βββ tailwind.config.ts
βββ README.md
Solution:
-
Get Fresh Connection String
- Go to Neon Console
- Select your project
- Copy the pooled connection string (ends with
-pooler)
-
Update
.env.localDATABASE_URL="postgresql://user:password@host-pooler.region.aws.neon.tech/database?sslmode=require" -
Restart Server
# Stop current server (Ctrl+C) rm -rf .next # Clear cache npm run dev # Restart
Solution:
# Reset database and reapply migrations
npx prisma migrate reset --force
# Generate Prisma Client
npx prisma generate
# Restart server
npm run devSolution:
# Check for type errors
npm run build
# Common fixes:
# 1. Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# 2. Clear Next.js cache
rm -rf .next
# 3. Regenerate Prisma Client
npx prisma generateSolution:
- Ensure
.env.localexists in project root - Check all required variables are set
- Use
.env.exampleas reference - Restart dev server after changes
Solution:
- The app automatically falls back to redirect mode
- Clear browser cache and cookies
- Check Firebase authorized domains include your domain
- Ensure popup blockers are disabled
Solution:
# Check NEXTAUTH_SECRET is set
echo $NEXTAUTH_SECRET
# Generate new secret if needed
openssl rand -base64 32
# Add to .env.local
NEXTAUTH_SECRET="your-new-secret"Solution:
-
Check Socket Server is Running
# Should see: "π Socket.io server running on port 3001" npm run dev -
Update Socket URL
# In .env.local NEXT_PUBLIC_SOCKET_URL="http://localhost:3001"
-
Check Firewall/Network
- Ensure port 3001 is not blocked
- Check browser console for connection errors
Solution:
- This is normal for free tier
- App automatically uses fallback name generation
- No action needed - the app works perfectly without Gemini
- Optional: Upgrade to paid Gemini API tier for higher limits
Solution:
- Free tier databases auto-pause after 5 minutes
- First query takes 2-5 seconds to wake up
- This is normal and handled by auto-retry logic
- Consider upgrading to Neon Pro for always-on database
# Unit tests
npm test
# E2E tests
npm run test:e2e
# Coverage
npm run test:coverage- User registration with email/password
- Google OAuth login
- Onboarding flow completion
- Pod assignment
- Daily check-in submission
- Real-time chat messaging
- Crisis alert creation
- Profile updates
- Avatar upload
- Leaderboard display
POST /api/auth/register
Body: { email: string, password: string }
Response: { user: { id: string, email: string } }
GET /api/auth/session
Response: { user: User | null }GET /api/pods/members
Response: { members: User[] }
POST /api/pods/messages
Body: { message: string, podId: string }
Response: { message: PodMessage }
GET /api/pods/assign
Response: { pod: Pod }POST /api/check-ins/create
Body: { stayedOnTrack: boolean }
Response: { checkIn: CheckIn, streak: number }
GET /api/check-ins/history
Query: { days?: number }
Response: { checkIns: CheckIn[] }GET /api/profile
Response: { user: User }
PUT /api/profile/update
Body: Partial<User>
Response: { user: User }
POST /api/profile/upload-avatar
Body: FormData (multipart/form-data)
Response: { avatarUrl: string }We welcome contributions from the community! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
-
Fork the Repository
- Click the "Fork" button at the top right of this repository
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/podlink.git cd podlink
-
Create a Branch
git checkout -b feature/your-amazing-feature # or git checkout -b fix/bug-description -
Make Your Changes
- Follow the existing code style
- Write clear, commented code
- Add tests if applicable
- Update documentation as needed
-
Test Your Changes
# Run type checking npm run build # Test locally npm run dev # Run tests (if available) npm test
-
Commit Your Changes
git add . git commit -m "feat: add amazing feature" # or git commit -m "fix: resolve bug description"
Commit Message Guidelines:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding testschore:Maintenance tasks
-
Push to Your Fork
git push origin feature/your-amazing-feature
-
Open a Pull Request
- Go to the original repository
- Click "Pull Requests" β "New Pull Request"
- Select your fork and branch
- Fill out the PR template with:
- Clear description of changes
- Screenshots (if UI changes)
- Related issue numbers
- Testing steps
Here are some areas where we'd love your help:
- Fix reported issues
- Improve error handling
- Enhance performance
- Fix accessibility issues
- Video chat support for pods
- Mobile app (React Native)
- Advanced analytics dashboard
- Gamification features
- Integration with habit tracking apps
- Multi-language support (i18n)
- Dark mode improvements
- Custom pod themes
- Improve setup instructions
- Add API documentation
- Create video tutorials
- Write blog posts
- Translate documentation
- Write unit tests
- Add E2E tests
- Improve test coverage
- Test on different devices
- Improve UI/UX
- Create new illustrations
- Design marketing materials
- Optimize for accessibility
- Use TypeScript for type safety
- Follow existing naming conventions
- Use functional components in React
- Prefer composition over inheritance
- Write self-documenting code
- Keep components small and focused
- Use custom hooks for shared logic
- Handle loading and error states
- Optimize for performance
- Ensure mobile responsiveness
- Write accessible HTML
- Create migrations for schema changes
- Test migrations on fresh database
- Don't modify existing migrations
- Update seed data if needed
// Good component example
interface Props {
userId: string;
onUpdate: () => void;
}
export function UserProfile({ userId, onUpdate }: Props) {
// hooks
const [isLoading, setIsLoading] = useState(false);
// handlers
const handleUpdate = async () => {
// implementation
};
// render
return (
<div>
{/* JSX */}
</div>
);
}- π¬ Discussions: Ask questions in GitHub Discussions
- π Issues: Report bugs in GitHub Issues
- π§ Email: Contact brittytino@example.com for private inquiries
- π Docs: Check this README and code comments
We are committed to providing a welcoming and inclusive experience for everyone. We expect all contributors to:
- Be respectful and considerate
- Welcome newcomers and help them get started
- Accept constructive criticism gracefully
- Focus on what is best for the community
- Show empathy towards other community members
Unacceptable behavior includes:
- Harassment or discrimination
- Trolling or insulting comments
- Public or private harassment
- Publishing others' private information
- Other unethical or unprofessional conduct
Contributors will be:
- Listed in the Contributors section
- Mentioned in release notes
- Given credit in relevant documentation
Thank you for helping make PodLink better! π
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2025 PodLink
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- π Documentation: Read this README thoroughly
- π¬ GitHub Discussions: Ask questions and share ideas
- π Bug Reports: Open an issue
- β¨ Feature Requests: Suggest new features
- π§ Email: brittytino@example.com
- β Star this repo to show support and stay notified
- π Watch releases for update notifications
- π¦ Follow on Twitter: @brittytino
- πΌ LinkedIn: Connect with us
Built with these amazing technologies:
- Next.js - React framework
- Prisma - Database ORM
- NextAuth.js - Authentication
- Socket.io - Real-time communication
- Tailwind CSS - Styling
- shadcn/ui - UI components
- Neon - Serverless PostgreSQL
- Vercel - Deployment platform
- Cloudinary - Image management
- Google Gemini - AI capabilities
Special thanks to all contributors who help make PodLink better!
Built with β€οΈ for accountability and personal growth
Website β’ Report Bug β’ Request Feature
Made by brittytino and contributors
β Star this repo if you find it helpful!