A modern, interactive dashboard for tracking and visualizing study and progress. This application helps users maintain consistency in their studies by providing visual feedback on study patterns, streaks, and subject distribution.
- Study Calendar: Visual representation of study days with color-coded indicators
- Study Statistics: Track study rate, monthly goals, current streak, and best streak
- Subject Distribution: Analyze which subjects you study most frequently
- Discord Integration: workflows save study sessions directly from Discord using a bot
- Frontend: React, TypeScript, Vite
- UI Components: Radix UI, Tailwind CSS
- Data Visualization: Recharts
- Backend: Supabase (PostgreSQL)
- Discord Bot: Discord.js
- Testing: Vitest, Testing Library
study-dashboard/
├── .github/workflows/ # GitHub Actions workflows
├── scripts/ # Discord bot and utility scripts
├── src/ # Source code
│ ├── components/ # React components
│ │ ├── ui/ # UI components
│ │ ├── StudyCalendar.tsx
│ │ ├── StudyStats.tsx
│ │ └── SubjectChart.tsx
│ ├── lib/ # Utility functions and services
│ │ └── supabaseClient.ts
│ ├── pages/ # Page components
│ │ ├── Index.tsx
│ │ └── NotFound.tsx
│ ├── test/ # Test setup and utilities
│ ├── App.tsx # Main application component
│ └── main.tsx # Application entry point
└── ... # Configuration files
- Node.js (v18 or higher)
- npm or yarn
- Supabase account
- Discord bot token (for Discord integration)
Create a .env
file in the root directory with the following variables:
# Set this at the vercel deployment environment variables
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_KEY=your_supabase_anon_key
# For Discord bot and Supabase at .env
DISCORD_TOKEN=your_discord_bot_token
DISCORD_CLIENT_ID=your_discord_client_id
DISCORD_GUILD_ID=your_discord_server_id
ANNOUNCE_CHANNEL_ID=your_announcement_channel_id
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_service_key
The application requires the following tables in your Supabase database:
-
study_sessions
- Records of study sessionsid
(auto-generated)user_id
(string)subject
(string)duration
(integer, minutes)notes
(text, optional)timestamp
(timestamp)
-
study_streaks
- Tracks the best study streakid
(integer, primary key)best_streak
(integer)
-
study_current_streak
- Tracks the current study streakid
(integer, primary key)current_streak
(integer)
-
Clone the repository:
git clone https://github.com/TheusHen/study-dashboard.git cd study-dashboard
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:5173
The project uses Vitest for testing. To run the tests:
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
The Discord bot allows users to log study sessions directly from Discord.
- Create a Discord application and bot at the Discord Developer Portal
- Add the bot to your server with appropriate permissions
- Set up the environment variables as described above
- Run the bot:
node scripts/studyFormBot.js
The bot provides a /study
command that opens a form for logging study sessions.
The project includes two GitHub workflows:
- Discord Bot Scheduler (
ci.yml
): Runs the Discord bot daily at 18:00 UTC to remind users to log their study sessions - Tests (
tests.yml
): Runs the test suite on push to main, pull requests, and manual triggers
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.