This is a habit tracking web application built with Next.js (using the Pages Router), TypeScript, and styled with Tailwind CSS.
localStorage
.Clone the repository (if applicable):
git clone <repository-url>
cd habit-tracker
Install dependencies:
npm install
# or
yarn install
# or
pnpm install
Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open the application: Open http://localhost:3000 in your browser.
pages/index.tsx
: The main page component, responsible for state management, orchestrating the habit tracker UI, handling habit/category logic, and data persistence.pages/_app.tsx
: Custom App component to load global styles.components/AddHabitModal.tsx
: React component for the 'Create New Habit' modal form, including basic inputs and a collapsible 'Advanced Options' section (Goal End Date, Category, Icon).components/HabitCard.tsx
: React component for displaying an individual habit card, including completion heatmap, streaks, and goal end date (if set).types.ts
: TypeScript definitions for shared types like Habit
, Category
, and Frequency
.styles/globals.css
: Global CSS file, primarily for Tailwind CSS directives.tailwind.config.ts
: Tailwind CSS configuration.next.config.mjs
: Next.js configuration.useState
, useEffect
, useMemo
, useCallback
)localStorage
Contributions are welcome! Please feel free to open an issue or submit a pull request.