A Next.js component library built for teaching Object-Oriented Programming (OOP) concepts through practical web development.
This project is designed for a student workshop where participants will:
- Learn OOP concepts (encapsulation, inheritance, polymorphism, composition)
- Build features for a school help platform called "HelpFlow"
- Code with AI assistance to understand modern development workflows
Students will use these pre-built components as building blocks to create their own features.
- Node.js 18+ installed
- Basic understanding of HTML/CSS
- Text editor (VS Code recommended)
-
Navigate to the project:
cd helpflow-app -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser: Navigate to http://localhost:3000
You should see the HelpFlow Component Library showcase page!
Reusable button with multiple variants and sizes.
import { Button } from '@/components/ui/Button';
<Button variant="primary">Click me</Button>
<Button variant="secondary" size="large">Large Button</Button>
<Button variant="accent" disabled>Disabled</Button>Variants: primary (black), secondary (white), accent (yellow)
Sizes: small, medium, large
Subject and category labels.
import { Tag } from '@/components/ui/Tag';
<Tag label="MATEMATIKA" />
<Tag label="9.A" variant="outlined" />
<Tag label="CLICK ME" onClick={() => alert('Clicked!')} />Container for content with consistent styling.
import { Card } from '@/components/ui/Card';
<Card variant="outlined" padding="large">
<h3>Card Title</h3>
<p>Card content goes here...</p>
</Card>Form inputs and search bars.
import { Input } from '@/components/ui/Input';
<Input
type="search"
placeholder="Search..."
value={value}
onChange={setValue}
fullWidth
/>
<Input
type="textarea"
rows={4}
placeholder="Enter details..."
/>Main navigation with logo, search, and actions.
import { Header } from '@/components/layout/Header';
<Header
onSearch={(query) => console.log(query)}
onProgressClick={() => {/* handle */}}
onNewQuestionClick={() => {/* handle */}}
onProfileClick={() => {/* handle */}}
/>Filter panels and info widgets.
import { Sidebar } from '@/components/layout/Sidebar';
<Sidebar
classFilters={classFilterItems}
subjectFilters={subjectFilterItems}
onClassFilterClick={(id) => {/* handle */}}
onSubjectFilterClick={(id) => {/* handle */}}
/>Complete question card with voting, tags, and actions.
import { QuestionCard } from '@/components/features/QuestionCard';
<QuestionCard
tags={[
{ label: 'FIZIKA' },
{ label: '10.B', variant: 'outlined' }
]}
timeAgo="2 PERCE"
title="Question title here..."
votes={42}
answerCount={8}
onVote={() => {/* handle voting */}}
onAnswer={() => {/* handle answer */}}
onShare={() => {/* handle share */}}
/>Clickable filter lists for subjects, classes, etc.
import { FilterList } from '@/components/features/FilterList';
<FilterList
title="TANTÁRGYAK"
items={[
{ id: 'math', label: 'MATEMATIKA', count: 24 },
{ id: 'physics', label: 'FIZIKA', count: 18, active: true }
]}
onFilterClick={(id) => {/* handle filter */}}
/>Dialog overlay for forms and confirmations.
import { Modal } from '@/components/features/Modal';
<Modal
isOpen={isOpen}
title="ÚJ KÉRDÉS"
onClose={() => setIsOpen(false)}
onSubmit={handleSubmit}
>
<p>Modal content here...</p>
</Modal>- Primary (Black):
#000000- Main buttons, text, borders - Secondary (White):
#FFFFFF- Backgrounds, secondary buttons - Accent (Yellow):
#FFD600- Call-to-action buttons, highlights
- Sharp corners - No border radius for a bold, modern look
- Thick borders - 3px black borders throughout
- High contrast - Black and white with yellow accents
- Bold typography - Strong, readable fonts
Components hide their internal implementation:
// You don't need to know HOW Button renders, just HOW to use it
<Button variant="primary">Click</Button>Build complex UIs from simple components:
<Card>
<Tag label="MATH" />
<h3>Question Title</h3>
<Button>Answer</Button>
</Card>Same component, different behaviors:
<Button variant="primary">Primary</Button>
<Button variant="accent">Accent</Button>Type-safe component contracts:
interface ButtonProps {
variant?: 'primary' | 'secondary' | 'accent';
onClick?: () => void;
// ...
}Students can practice by:
- Creating a new question page - Use QuestionCard, Input, and Modal
- Building a profile page - Compose Cards and Buttons
- Adding a leaderboard - Use FilterList and Card components
- Creating custom variants - Extend existing components
- Building new components - Apply learned OOP principles
npm run dev- Start development servernpm run build- Build for productionnpm start- Run production buildnpm run lint- Run ESLint
helpflow-app/
├── app/
│ ├── page.tsx # Component showcase page
│ ├── layout.tsx # Root layout
│ └── globals.css # Global styles
├── components/
│ ├── ui/ # Basic UI components
│ │ ├── Button/
│ │ ├── Card/
│ │ ├── Tag/
│ │ └── Input/
│ ├── layout/ # Layout components
│ │ ├── Header/
│ │ └── Sidebar/
│ └── features/ # Feature components
│ ├── QuestionCard/
│ ├── FilterList/
│ └── Modal/
├── public/ # Static assets
└── tailwind.config.ts # Tailwind configuration
- Start with simple components (Button, Tag) to explain props and composition
- Move to complex components (QuestionCard) to show how composition works
- Have students modify component variants to understand polymorphism
- Guide them through creating a new feature using existing components
- Encourage AI-assisted coding with clear, specific prompts
- Hour 1: Intro to OOP + explore component library
- Hour 2: Build a simple feature with guidance
- Hour 3: Independent feature building with AI help
- Hour 4: Present and discuss creations
This is a workshop project! Students should feel free to:
- Add new component variants
- Create new components following existing patterns
- Extend functionality with new features
- Improve styling and accessibility
This project is created for educational purposes.
- Check component examples on the showcase page
- Read component source code with detailed comments
- Ask your instructor or use AI assistance
- Experiment and learn by doing!
Happy Coding! 🚀