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.
- Glassmorphism design with vibrant colors
- Smooth animations and hover effects
- Mobile-first responsive design
- Perfect for contemporary, forward-thinking schools
- Traditional, professional layout
- Serif typography for an academic feel
- Sidebar-based content layout
- Ideal for established, heritage-focused institutions
- Clean, distraction-free design
- Large typography and whitespace
- Subtle grayscale aesthetics
- Best for modern, design-conscious schools
- Vibrant gradient backgrounds
- Playful, colorful card designs
- Animated elements and fun emojis
- Perfect for elementary schools and creative academies
- Professional business aesthetic
- Stats-driven hero section
- Clean, structured layouts
- Ideal for technical colleges and business schools
- Dynamic Template Selection: Schools can switch templates via the backend
WebsiteSettingsmodel - 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
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS 4
- Icons: Lucide React
- Backend Integration: Django REST Framework
- Node.js 18+ installed
- Backend API running at
http://localhost:8000
-
Install dependencies:
npm install --legacy-peer-deps
-
Set environment variables (optional): Create a
.env.localfile:NEXT_PUBLIC_API_URL=http://localhost:8000/api/website -
Run development server:
npm run dev
-
Build for production:
npm run build npm start
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
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
# 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.Each school can customize:
- Template Choice: Set
templatefield inWebsiteSettings - Brand Colors:
primary_colorandsecondary_color(hex codes) - Content: Hero text, about section, social links
- Visibility: Toggle
show_news,show_events,show_staff
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).
All templates are fully responsive with breakpoints:
- Mobile:
< 768px - Tablet:
768px - 1024px - Desktop:
> 1024px
-
Create template components in
components/templates/:export default function YourTemplate({ settings, news, events }: TemplateProps) { // Your design }
-
Add to template selector in
app/page.tsx:case 'YOUR_TEMPLATE': return <YourTemplate settings={settings} news={news} events={events} />;
-
Update backend
TEMPLATE_CHOICESinWebsiteSettingsmodel
vercel --prodFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --legacy-peer-deps
COPY . .
RUN npm run build
CMD ["npm", "start"]This project is part of the School Management System.
To contribute a new template:
- Follow the design system patterns from existing templates
- Ensure mobile responsiveness
- Test with different color schemes
- Submit with screenshots
Built with β€οΈ for Schools