Skip to content

CodeDreamer06/GrainUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒพ Grain - Credit Tracker

Minimalist credit-based learning tracker that encourages balance between study and breaks.

Grain Screenshot

๐ŸŒŸ Features

  • ๐Ÿ“Š 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

๐Ÿš€ Getting Started

First, clone the repository and install the dependencies:

git clone https://github.com/your-username/grain.git
cd grain
npm install

Run the development server:

npm run dev

Open http://localhost:3000 to see the app.

๐Ÿ“– How It Works

๐Ÿ“ Core Concept

  1. Earn 1 study credit for each unit of focused study time
  2. Use 1 break credit for each unit of break time
  3. You start with 12 break credits each week
  4. If you exceed your 90 study credit goal, you earn surplus credits
  5. Surplus credits convert to additional break credits for the next week
  6. Track your streak by hitting your goal for consecutive weeks

๐ŸŽฎ Usage

  • 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

๐Ÿ› ๏ธ Tech Stack

  • โš›๏ธ 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

๐Ÿงฑ Project Structure

/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

๐Ÿ“ฆ Data Model

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

๐Ÿงช Development

Adding New Themes

  1. Add CSS variables to globals.css for both light and dark variants
  2. Add the theme name to the ThemeName type in store.ts
  3. Update the theme rotation pool if desired

Customizing Achievements

Modify the achievements in the initialAppStateWithoutActions object in store.ts.

๐Ÿ“„ License

MIT License - See LICENSE file for details.

๐Ÿ™ Acknowledgements

  • Special thanks to the Next.js and Tailwind CSS teams
  • Icons provided by Lucide Icons
  • Inspiration from Pomodoro and time-blocking techniques

About

๐ŸŒพ Grain โ€” A local-first, credit-based ๐Ÿ“š productivity tracker for focused learners. Gamify consistency, not time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors