Skip to content

k12school/frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K12 Platform - Frontend

Quick Start

Prerequisites

  • Node.js 18+ installed
  • Backend API running on http://localhost:9080

Installation

# Install dependencies
npm install

Development

# Start dev server (runs on http://localhost:3000)
npm run dev

# Type check
npm run type-check

# Build for production
npm run build

# Preview production build
npm run preview

Architecture

This frontend follows a domain-first hexagonal architecture:

UI Layer (React) → Domain Layer (Pure TS) → Infrastructure (Adapters)

Key Principles

✅ DO:

  • Keep domain logic in pure TypeScript functions
  • Use value objects for data validation
  • Create thin React components (presentation only)
  • Wire UI to domain via hooks

❌ DON'T:

  • Put business logic in components
  • Call APIs directly from components
  • Use useState for domain state
  • Import UI libraries in domain layer

Project Structure

src/
├── domain/              # Business logic (pure TypeScript)
│   ├── models/         # Domain models & value objects
│   ├── ports/          # Interface definitions
│   ├── use-cases/      # Application logic
│   └── errors/         # Domain errors
├── infrastructure/      # External integrations
│   ├── adapters/       # API clients
│   └── dto/           # Data transfer objects
└── ui/                # React application
    ├── components/    # UI components
    ├── pages/        # Page components
    ├── hooks/        # Custom hooks
    └── providers/    # Context providers

Features Implemented

  • ✅ Login with email/password
  • ✅ Password reset request/confirmation
  • ✅ Role-based dashboards (Admin/Teacher/Parent)
  • ✅ Session management with JWT
  • ✅ Protected routes
  • ✅ Domain-first architecture

API Integration

Backend: http://localhost:9080

  • /api/auth/login - User authentication
  • /api/auth/password-reset/* - Password reset
  • /api/users/* - User management (admin)
  • /api/students/* - Student management
  • /api/classes/* - Class management

Troubleshooting

Build fails?

rm -rf node_modules package-lock.json
npm install

Type errors?

npm run type-check

API connection issues?

  • Ensure backend is running on port 9080
  • Check browser console for CORS errors

License

Proprietary - All rights reserved

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages