Minimalist credit-based learning tracker that encourages balance between study and breaks.
- ๐ Credit System: Earn study credits and spend break credits to maintain balance
- ๐ Weekly Snapshots: Track your study progress throughout the week
- ๐ฏ Goal Tracking: Aim for 90 study credits per week
- ๐ Achievements: Unlock achievements for hitting milestones
- ๐จ Multiple Themes: Choose from beautiful theme variants:
- ๐ฟ Leafy Green
- ๐ Cherry Pink
- ๐ป Sunflower Yellow
- ๐ Midnight Blue
- ๐ Auto Theme Rotation: Automatically switch themes daily or weekly
- ๐ Light/Dark Mode: Support for light and dark mode variants of each theme
- ๐พ Data Persistence: Your progress is saved locally in your browser
- ๐ฑ PWA Support: Install as a standalone app on your device
First, clone the repository and install the dependencies:
git clone https://github.com/your-username/grain.git
cd grain
npm installRun the development server:
npm run devOpen http://localhost:3000 to see the app.
- Earn 1 study credit for each unit of focused study time
- Use 1 break credit for each unit of break time
- You start with 12 break credits each week
- If you exceed your 90 study credit goal, you earn surplus credits
- Surplus credits convert to additional break credits for the next week
- Track your streak by hitting your goal for consecutive weeks
- Click the
+Study Credit button to log study time - Click the
-Break Credit button to use a break credit - View your daily activity in the Today Log
- Monitor your weekly progress in the Weekly Snapshot
- Check achievements and streaks in the Stats page
- Customize the theme in Settings
- โ๏ธ Next.js 14: React framework with App Router
- ๐จ Tailwind CSS: Utility-first CSS framework
- ๐ Zustand: State management
- ๐ localStorage: Data persistence
- ๐ญ shadcn/ui: UI component system
- ๐ฑ PWA: Progressive Web App capabilities
/src
/app # Next.js app router pages
/components # React components
/ui # UI components (shadcn)
ThemeProvider.tsx # Theme management
CreditControls.tsx # Main credit buttons
TodayLog.tsx # Daily activity log
WeeklySnapshot.tsx # Weekly progress bar
/lib
/store.ts # Zustand store for state management
/utils.ts # Utility functions
/app/globals.css # Global styles and theme definitions
The app uses a Zustand store with these main state slices:
- todayLog: Current day's study/break entries
- weeklySummary: Weekly aggregated data and metrics
- achievements: Unlockable achievements
- themeSettings: User theme preferences
- Add CSS variables to
globals.cssfor both light and dark variants - Add the theme name to the
ThemeNametype instore.ts - Update the theme rotation pool if desired
Modify the achievements in the initialAppStateWithoutActions object in store.ts.
MIT License - See LICENSE file for details.
- Special thanks to the Next.js and Tailwind CSS teams
- Icons provided by Lucide Icons
- Inspiration from Pomodoro and time-blocking techniques
