A modern React frontend application for generating and solving AI-powered Python coding challenges. Features user authentication via Clerk, real-time quota tracking, challenge history visualization, and an intuitive interface for practicing Python concepts across multiple difficulty levels.
- Interactive Challenge Generation with difficulty selection (Easy, Medium, Hard)
- Multiple Choice Questions (MCQ) with instant feedback and explanations
- User Authentication powered by Clerk with secure token management
- Real-Time Quota Tracking showing remaining challenges and reset timers
- Challenge History to review past challenges and solutions
- React 19.1
- Vite 7.0
- React Router DOM 6.30
- Clerk React 5.33
- ESLint + Prettier
- Husky + lint-staged
- Node.js 18+ or higher
- npm or yarn package manager
- Running instance of the backend API
- Clerk account with publishable key
-
Clone the repository:
git clone https://github.com/rafaelanobre/python-daily-challenge-frontend.git cd python-daily-challenge-frontend -
Install dependencies:
npm install
-
Set up your environment variables:
- Copy
.env.exampleto.env - Fill in your
VITE_CLERK_PUBLISHABLE_KEYandBACKEND_URL
VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key BACKEND_URL=http://localhost:8000
- Copy
-
Start the development server:
npm run dev
The application will be available at
http://localhost:5173 -
Build for production:
npm run build
-
Preview production build:
npm run preview
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build optimized production bundle |
npm run preview |
Preview production build locally |
npm run lint |
Run ESLint and auto-fix issues |
npm run format |
Format code with Prettier |
The main interface allows users to:
- Select difficulty level (Easy, Medium, Hard)
- Generate AI-powered Python challenges
- View remaining daily quota
- See when quota resets (24-hour cycle)
- Receive instant feedback with explanations
Users can:
- View all previously generated challenges
- Review past answers and explanations
- Track learning progress over time
Secure authentication flow:
- Sign up / Sign in with Clerk
- Protected routes for authenticated users
- Automatic token refresh
- Secure API communication
frontend/
├── src/
│ ├── auth/ # Authentication components
│ │ ├── ClerkProviderWithRoutes.jsx
│ │ └── AuthenticationPage.jsx
│ ├── challenge/ # Challenge-related components
│ │ ├── ChallengeGenerator.jsx
│ │ └── MCQChallenge.jsx
│ ├── history/ # History panel
│ │ └── HistoryPanel.jsx
│ ├── layout/ # Layout components
│ │ └── Layout.jsx
│ ├── utils/ # Utility functions
│ │ └── api.js
│ ├── App.jsx # Main application component
│ ├── main.jsx # Application entry point
│ ├── App.css # Application styles
│ └── index.css # Global styles
├── index.html # HTML template
├── vite.config.js # Vite configuration
├── eslint.config.js # ESLint configuration
├── package.json # Dependencies and scripts
└── .env.example # Environment variables template
The frontend communicates with the backend through the following endpoints:
POST /api/generate-challenge- Generate new challengeGET /api/my-history- Fetch user's challenge historyGET /api/quota- Get current quota status
All requests are authenticated using Clerk JWT tokens.
This project uses:
- Husky for Git hooks
- lint-staged for pre-commit linting
- Prettier for code formatting
- ESLint for code quality
- React Fast Refresh for instant feedback during development
Code is automatically formatted and linted before each commit to maintain consistency.
Planned improvements and features currently in development:
- Add challenge timer functionality
- Implement code editor for free-form coding challenges
- Add dark mode theme
- Create challenge difficulty filters in history
- Add social sharing for completed challenges
- Implement challenge streak tracking
- Add unit tests with Vitest
- Create Dockerized deployment
MIT License
Copyright (c) 2025 Rafaela Nobre
This project uses:
- React, licensed under the MIT License.
- Vite, licensed under the MIT License.
- Clerk, licensed under the MIT License.
- React Router, licensed under the MIT License.