A modern, full-stack productivity tracking application built with Next.js, featuring time tracking, notes management, nutrition tracking, and social collaboration features.
- Time Tracking: Advanced timer with category-based tracking and detailed analytics
- Notes Management: Rich text notes with collaboration, version history, and image uploads
- Calendar Integration: Visual time entry management with day/week/month views
- Analytics & Reports: Comprehensive productivity insights with charts and statistics
- Nutrition Tracking: Meal planning and nutritional intake monitoring
- Friend System: Send/receive friend requests and view friend activities
- Real-time Messaging: Chat with friends directly in the app
- Collaborative Notes: Share and collaborate on notes with team members
- Activity Sharing: View friends' productivity patterns (with permission)
- Dark/Light Mode: Seamless theme switching
- Responsive Design: Optimized for desktop, tablet, and mobile
- PWA Ready: Progressive Web App capabilities
- Real-time Updates: Live data synchronization
- Rich Text Editor: Markdown support with live preview
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Framer Motion - Smooth animations
- Radix UI - Accessible component primitives
- Chart.js - Data visualization
- React Hook Form - Form management
- Next.js API Routes - Serverless backend
- NextAuth.js - Authentication system
- Prisma - Database ORM
- PostgreSQL - Primary database
- Cloudinary - Image storage and optimization
- Zustand - Lightweight state management
- React Query - Server state management
- ESLint - Code linting
- Prettier - Code formatting
- TypeScript - Static type checking
- Node.js 18+
- PostgreSQL database
- Cloudinary account (for image uploads)
- Git
git clone https://github.com/blazedglimmer/ProductivityTracker
cd flowsync
npm install
Create a .env.local
file in the root directory:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/flowsync"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"
# Cloudinary
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
# Generate Prisma client
npx prisma generate
# Run database migrations
npx prisma db push
# (Optional) Seed the database
npx prisma db seed
npm run dev
Visit http://localhost:3000
to see the application.
flowsync/
βββ app/ # Next.js App Router
β βββ (app)/ # Protected app routes
β βββ (auth)/ # Authentication routes
β βββ api/ # API endpoints
β βββ globals.css # Global styles
βββ components/ # Reusable UI components
β βββ ui/ # Base UI components
β βββ sections/ # Page sections
β βββ notes/ # Notes-specific components
β βββ auth/ # Authentication components
βββ lib/ # Utility libraries
β βββ actions/ # Server actions
β βββ store/ # Zustand store
β βββ validations/ # Zod schemas
βββ hooks/ # Custom React hooks
βββ types/ # TypeScript type definitions
βββ prisma/ # Database schema and migrations
βββ public/ # Static assets
The application uses Prisma with PostgreSQL. Key models include:
- User: User accounts and profiles
- TimeEntry: Time tracking records
- Category: Time entry categories
- Todo: Notes and tasks
- Friendship: Social connections
- Message: Chat messages
NextAuth.js handles authentication with:
- Email/password authentication
- Session management
- Protected routes
Cloudinary integration for:
- Profile pictures
- Note attachments
- Image optimization
- Start Timer: Click the timer tab and start tracking
- Add Categories: Create custom categories in settings
- Manual Entries: Add time entries via calendar view
- View Reports: Analyze productivity in the reports section
- Create Notes: Use the rich text editor with markdown support
- Collaborate: Share notes with friends and team members
- Organize: Use colors and pinning for organization
- Version History: Track changes over time
- Add Friends: Search and send friend requests
- Chat: Real-time messaging with friends
- Share Activities: View friend productivity (with permission)
- Authentication: Secure session-based auth
- Authorization: Role-based access control
- Data Validation: Server-side input validation
- CSRF Protection: Built-in Next.js protection
- SQL Injection Prevention: Prisma ORM protection
- Time Distribution: Visual breakdown by category
- Productivity Trends: Historical analysis
- Goal Tracking: Set and monitor objectives
- Export Data: Download reports in various formats
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prod
# Build image
docker build -t flowsync .
# Run container
docker run -p 3000:3000 flowsync
Ensure all environment variables are set in your deployment platform:
- Database connection string
- NextAuth configuration
- Cloudinary credentials
- Any additional API keys
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
- Image Optimization: Next.js automatic image optimization
- Code Splitting: Automatic route-based splitting
- Caching: Strategic caching for API responses
- Database Indexing: Optimized database queries
- CDN: Cloudinary for asset delivery
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow TypeScript best practices
- Use conventional commit messages
- Add tests for new features
- Update documentation as needed
POST /api/auth/signin
- User loginPOST /api/auth/signup
- User registrationPOST /api/auth/signout
- User logout
GET /api/time-entries
- Get user's time entriesPOST /api/time-entries
- Create new time entryPATCH /api/time-entries/[id]
- Update time entryDELETE /api/time-entries/[id]
- Delete time entry
GET /api/categories
- Get user's categoriesPOST /api/categories
- Create new categoryPATCH /api/categories/[id]
- Update categoryDELETE /api/categories/[id]
- Delete category
GET /api/friends
- Get user's friendsPOST /api/friends/requests
- Send friend requestGET /api/messages/[friendId]
- Get chat messagesPOST /api/messages
- Send message
Database Connection Issues
# Check database connection
npx prisma db pull
Build Errors
# Clear Next.js cache
rm -rf .next
npm run build
Authentication Issues
- Verify NEXTAUTH_SECRET is set
- Check NEXTAUTH_URL matches your domain
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js - The React framework
- Prisma - Database toolkit
- Tailwind CSS - CSS framework
- Radix UI - UI components
- Cloudinary - Image management
For support, email [email protected] or join our Discord community.
- Mobile app development
- Advanced analytics dashboard
- Team management features
- Integration with external calendars
- AI-powered productivity insights
- Offline mode support
- Advanced notification system
- Custom themes and branding
FlowSync - Track your time, boost your productivity, collaborate with your team.