Skip to content

AminaiTech/EduFlow_SchoolsWebTemplates

Repository files navigation

School Website Templates

A professional, Next.js-based website template system for schools. This project provides three distinct, customizable templates that can be dynamically assigned to different schools through the backend API.

🎨 Available Templates

1. Modern Template (MODERN)

  • Glassmorphism design with vibrant colors
  • Smooth animations and hover effects
  • Mobile-first responsive design
  • Perfect for contemporary, forward-thinking schools

2. Classic Template (CLASSIC)

  • Traditional, professional layout
  • Serif typography for an academic feel
  • Sidebar-based content layout
  • Ideal for established, heritage-focused institutions

3. Minimal Template (MINIMAL)

  • Clean, distraction-free design
  • Large typography and whitespace
  • Subtle grayscale aesthetics
  • Best for modern, design-conscious schools

4. Creative Template (CREATIVE)

  • Vibrant gradient backgrounds
  • Playful, colorful card designs
  • Animated elements and fun emojis
  • Perfect for elementary schools and creative academies

5. Corporate Template (CORPORATE)

  • Professional business aesthetic
  • Stats-driven hero section
  • Clean, structured layouts
  • Ideal for technical colleges and business schools

πŸš€ Features

  • Dynamic Template Selection: Schools can switch templates via the backend WebsiteSettings model
  • API-Driven Content: All content (News, Events, Settings) is fetched from Django REST API
  • SEO Optimized: Server-side rendering with Next.js for excellent SEO
  • Fully Responsive: Mobile, tablet, and desktop optimized
  • Mock Data Fallback: Works offline with built-in mock data during development

πŸ“¦ Tech Stack

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS 4
  • Icons: Lucide React
  • Backend Integration: Django REST Framework

πŸ› οΈ Setup Instructions

Prerequisites

  • Node.js 18+ installed
  • Backend API running at http://localhost:8000

Installation

  1. Install dependencies:

    npm install --legacy-peer-deps
  2. Set environment variables (optional): Create a .env.local file:

    NEXT_PUBLIC_API_URL=http://localhost:8000/api/website
    
  3. Run development server:

    npm run dev
  4. Build for production:

    npm run build
    npm start

πŸ“ Project Structure

schools_web_templates/
β”œβ”€β”€ app/                      # Next.js App Router
β”‚   β”œβ”€β”€ page.tsx             # Main homepage with template selector
β”‚   └── globals.css          # Global styles
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ templates/           # Complete template assemblies
β”‚   β”‚   β”œβ”€β”€ ModernTemplate.tsx
β”‚   β”‚   β”œβ”€β”€ ClassicTemplate.tsx
β”‚   β”‚   └── MinimalTemplate.tsx
β”‚   β”œβ”€β”€ layout/              # Header & Footer components
β”‚   β”‚   β”œβ”€β”€ ModernHeader.tsx
β”‚   β”‚   β”œβ”€β”€ ClassicHeader.tsx
β”‚   β”‚   β”œβ”€β”€ MinimalHeader.tsx
β”‚   β”‚   └── ...Footers
β”‚   └── ui/                  # Reusable UI components
β”‚       β”œβ”€β”€ ModernHero.tsx
β”‚       β”œβ”€β”€ ModernNews.tsx
β”‚       └── ...
β”œβ”€β”€ lib/
β”‚   └── api.ts              # API client with mock data
β”œβ”€β”€ types/
β”‚   β”œβ”€β”€ index.ts            # Data model types
β”‚   └── template.ts         # Template prop types
└── package.json

πŸ”Œ Backend Integration

The templates consume data from the following Django API endpoints:

  • Settings: /api/website/settings/ - Returns website configuration including template choice
  • News: /api/website/news/ - Published news articles
  • Events: /api/website/events/ - Upcoming events

Backend Models

# school_website/models.py
- NewsArticle: title, slug, summary, content, image, published_at
- Event: title, slug, description, location, start_datetime, end_datetime, image
- WebsiteSettings: hero_title, hero_subtitle, template (MODERN/CLASSIC/MINIMAL), primary_color, etc.

🎨 Customizing Templates

Each school can customize:

  • Template Choice: Set template field in WebsiteSettings
  • Brand Colors: primary_color and secondary_color (hex codes)
  • Content: Hero text, about section, social links
  • Visibility: Toggle show_news, show_events, show_staff

Example: Changing Template

Update via Django Admin or API:

settings = WebsiteSettings.objects.first()
settings.template = 'CLASSIC'  # or 'MODERN' or 'MINIMAL'
settings.primary_color = '#1E40AF'  # Navy blue
settings.save()

The website will automatically reflect changes on next page load (revalidated every 60 seconds).

πŸ“± Responsive Design

All templates are fully responsive with breakpoints:

  • Mobile: < 768px
  • Tablet: 768px - 1024px
  • Desktop: > 1024px

πŸ§ͺ Development

Adding a New Template

  1. Create template components in components/templates/:

    export default function YourTemplate({ settings, news, events }: TemplateProps) {
      // Your design
    }
  2. Add to template selector in app/page.tsx:

    case 'YOUR_TEMPLATE':
      return <YourTemplate settings={settings} news={news} events={events} />;
  3. Update backend TEMPLATE_CHOICES in WebsiteSettings model

🚒 Deployment

Vercel (Recommended)

vercel --prod

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --legacy-peer-deps
COPY . .
RUN npm run build
CMD ["npm", "start"]

πŸ“ License

This project is part of the School Management System.

🀝 Contributing

To contribute a new template:

  1. Follow the design system patterns from existing templates
  2. Ensure mobile responsiveness
  3. Test with different color schemes
  4. Submit with screenshots

Built with ❀️ for Schools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages