Website resmi SMK Negeri 1 Adiwerna yang dibangun dengan teknologi modern untuk memberikan informasi dan layanan terbaik kepada siswa, guru, orang tua, dan masyarakat umum.
- π« Website SMKN 1 Adiwerna
- π Daftar Isi
- π Fitur Utama
- π οΈ Teknologi Yang Digunakan
- π Struktur Proyek
- π Quick Start
- π³ Docker Development
- π Collections (Data Models)
- π Global Settings
- π¨ Frontend Features
- π§ Configuration
- π± API Endpoints
- π Production Build
- π Deployment
- π§ͺ Testing
- π Scripts
- π€ Contributing
- π License
- π Support
- Responsive Design - Tampilan optimal di semua perangkat
- Dark/Light Theme - Mode gelap dan terang dengan transisi smooth
- Interactive Animations - Menggunakan Framer Motion untuk UX yang menarik
- SEO Optimized - Struktur SEO yang baik untuk visibilitas search engine
- Progressive Web App - Pengalaman seperti aplikasi mobile
- Accessibility Compliant - Mendukung standar aksesibilitas web
- Admin Dashboard - Panel admin yang user-friendly
- Rich Text Editor - Editor konten dengan fitur lengkap
- Media Management - Upload dan manajemen file media
- Multi-language Support - Dukungan bahasa Indonesia dan Inggris
- Version Control - Sistem versioning untuk konten
- Draft System - Sistem draft untuk preview sebelum publish
- Role-based Access Control - Sistem peran dan akses
- Image Optimization - Otomatis optimasi gambar
- Caching System - Sistem cache untuk performa optimal
- API Rate Limiting - Pembatasan akses API
- Data Validation - Validasi data yang ketat
- Next.js 15.3.0 - React framework dengan App Router
- React 19.1.0 - Library UI modern
- TypeScript 5.7.3 - Type safety dan developer experience
- Tailwind CSS 4.1.10 - Utility-first CSS framework
- Framer Motion 12.18.1 - Animasi dan transisi
- Lucide React 0.515.0 - Icon library modern
- next-themes 0.4.6 - Theme switching
- PayloadCMS 3.42.0 - Headless CMS
- GraphQL 16.8.1 - Query language untuk API
- Sharp 0.32.6 - Image processing
- MongoDB - NoSQL database
- @payloadcms/db-mongodb 3.42.0 - MongoDB adapter
- Docker - Containerization
- Docker Compose - Multi-container development
- Node.js 18.20.2+ - Runtime environment
- PNPM 9+ - Package manager
SMKN-1-Adiwerna/
βββ π src/
β βββ π app/
β β βββ π (admin)/ # Admin dashboard routes
β β β βββ π admin/
β β β β βββ π page.tsx # Admin main page
β β β β βββ π not-found.tsx
β β β βββ π api/ # API routes
β β β β βββ π [...slug]/ # PayloadCMS API
β β β β βββ π graphql/ # GraphQL endpoint
β β β β βββ π graphql-playground/
β β β βββ π layout.tsx # Admin layout
β β β βββ π custom.scss # Admin styles
β β βββ π (frontend)/ # Frontend routes
β β β βββ π components/ # React components
β β β β βββ π home/ # Homepage components
β β β β β βββ π sections/
β β β β β β βββ π HeroSection.tsx
β β β β β β βββ π AboutSection.tsx
β β β β β β βββ π ProgramsSection.tsx
β β β β β β βββ π NewsSection.tsx
β β β β β β βββ ... (14+ sections)
β β β β β βββ π types/ # TypeScript interfaces
β β β β β βββ π utils/ # Utility functions
β β β β βββ π navbar.tsx # Navigation component
β β β βββ π berita/ # News page
β β β βββ π program/ # Programs page
β β β βββ π kontak/ # Contact page
β β β βββ π tanya-ai/ # AI Chat page
β β β βββ π page.tsx # Homepage
β β β βββ π layout.tsx # Frontend layout
β β β βββ π globals.css # Global styles
β β βββ π my-route/ # Custom API route
β βββ π collections/ # PayloadCMS collections
β β βββ π Users.ts # User management
β β βββ π Media.ts # File uploads
β β βββ π News.ts # News articles
β β βββ π Events.ts # School events
β β βββ π Departments.ts # Academic departments
β β βββ π Teachers.ts # Faculty information
β β βββ π Achievements.ts # School achievements
β β βββ π Extracurriculars.ts # Extracurricular activities
β β βββ π Gallery.ts # Photo gallery
β β βββ π Partners.ts # Industry partners
β β βββ π Documents.ts # Document management
β β βββ π Announcements.ts # School announcements
β β βββ π OrganizationStructure.ts
β β βββ π SchoolProfile.ts # School profile (global)
β β βββ π VisionMission.ts # Vision & mission (global)
β β βββ π AboutPage.ts # About page content (global)
β β βββ π ContactInfo.ts # Contact information (global)
β β βββ π SocialMedia.ts # Social media links (global)
β βββ π payload.config.ts # PayloadCMS configuration
β βββ π payload-types.ts # Generated TypeScript types
βββ π public/ # Static assets
β βββ π logo-smk.png # School logo
βββ π media/ # Media uploads
β βββ π DPIB.png # Department images
β βββ π ROOTS.jpg
β βββ π TITL-.jpg
β βββ ... (various department images)
βββ π .vscode/ # VS Code configuration
β βββ π extensions.json # Recommended extensions
β βββ π launch.json # Debug configuration
β βββ π settings.json # Workspace settings
βββ π package.json # Project dependencies
βββ π tsconfig.json # TypeScript configuration
βββ π next.config.mjs # Next.js configuration
βββ π postcss.config.mjs # PostCSS configuration
βββ π eslint.config.mjs # ESLint configuration
βββ π .prettierrc.json # Prettier configuration
βββ π docker-compose.yml # Docker Compose setup
βββ π Dockerfile # Docker container setup
βββ π .env.example # Environment variables template
βββ π .gitignore # Git ignore rules
βββ π README.md # Documentation
git clone https://github.com/username/SMKN-1-Adiwerna.git
cd SMKN-1-Adiwerna# Menggunakan PNPM (recommended)
pnpm install
# Atau menggunakan npm
npm install
# Atau menggunakan yarn
yarn install# Copy environment variables
cp .env.example .envEdit file .env dan sesuaikan dengan konfigurasi Anda:
# Database Configuration
DATABASE_URI=mongodb://127.0.0.1:27017/smkn1-adiwerna
# PayloadCMS Secret (generate random string)
PAYLOAD_SECRET=your-super-secret-key-here
# Server Configuration (optional)
PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3000
PAYLOAD_PUBLIC_DRAFT_SECRET=draft-secret-key
# Environment
NODE_ENV=development# Install MongoDB Community Edition
# https://docs.mongodb.com/manual/installation/
# Start MongoDB service
sudo systemctl start mongod
# Atau menggunakan brew (macOS)
brew services start mongodb-community- Buat akun di MongoDB Atlas
- Buat cluster dan database
- Dapatkan connection string
- Update
DATABASE_URIdi file.env
# Start development server
pnpm dev
# Server akan berjalan di:
# Frontend: http://localhost:3000
# Admin: http://localhost:3000/admin
# GraphQL: http://localhost:3000/api/graphqlJika Anda prefer menggunakan Docker untuk development:
# Start semua services (MongoDB + App)
docker-compose up
# Atau run di background
docker-compose up -d
# Stop services
docker-compose down
# View logs
docker-compose logs -fFile docker-compose.yml sudah dikonfigurasi dengan:
- MongoDB service
- Auto-reload untuk development
- Volume mounting untuk live code changes
- Deskripsi: Manajemen pengguna dan autentikasi
- Fields: email, password, roles, profile
- Access: Admin only
- Deskripsi: Upload dan manajemen file
- Fields: filename, mimeType, filesize, alt text
- Features: Image resizing, focal point
- Deskripsi: Jurusan dan program keahlian
- Fields:
- Basic: name, slug, description, featuredImage
- Leadership: headOfDepartment (name, title, bio, photo, email)
- Programs: array of academic programs
- Partners: industry collaboration
- SEO: meta fields
- Contact: email, phone, location
- Deskripsi: Data guru dan staff
- Fields: name, photo, position, bio, subjects, education
- Features: Multi-language support
- Deskripsi: Dokumen sekolah (kurikulum, panduan, dll)
- Fields: title, file, category, description
- Access: Role-based access
- Deskripsi: Prestasi sekolah dan siswa
- Fields: title, description, date, category, images
- Categories: Academic, sports, competitions
- Deskripsi: Kegiatan ekstrakurikuler
- Fields: name, description, schedule, instructor, gallery
- Features: Online registration integration
- Deskripsi: Berita dan artikel sekolah
- Fields:
- Content: title, slug, content, excerpt
- Media: featuredImage, imageGallery
- Meta: publishDate, category, tags, isFeatured
- Relations: relatedNews, relatedEvents
- SEO: metaTitle, metaDescription, keywords
- Author: relationship to users
- Features:
- Draft system dengan autosave
- Version control (max 10 versions)
- Advanced rich text editor
- Custom slug generation
- Related content suggestions
- Deskripsi: Event dan kegiatan sekolah
- Fields: title, description, startDate, endDate, location, registration
- Features: Calendar integration
- Deskripsi: Pengumuman penting
- Fields: title, content, priority, validUntil
- Features: Auto-expiry system
- Deskripsi: Galeri foto sekolah
- Fields: title, images, description, category
- Features: Lightbox view, bulk upload
- Deskripsi: Struktur organisasi sekolah
- Fields: position, name, photo, department
- Features: Hierarchical display
- Deskripsi: Mitra industri dan kerjasama
- Fields: name, logo, website, description, type
- Categories: Industry, education, government
Global settings yang dapat diakses di seluruh website:
- Deskripsi: Profil umum sekolah
- Fields: schoolName, address, phone, email, establishedYear
- Deskripsi: Visi, misi, dan tujuan sekolah
- Fields: vision, mission, objectives
- Deskripsi: Konten halaman tentang
- Fields: content, history, facilities
- Deskripsi: Informasi kontak
- Fields: address, phone, email, maps, office hours
- Deskripsi: Tautan media sosial
- Fields: facebook, instagram, youtube, twitter, linkedin
Landing page dengan 15+ sections:
- HeroSection: Banner utama dengan animasi
- StatsSection: Statistik sekolah
- AboutSection: Tentang sekolah
- ProgramsSection: Program keahlian
- FacilitiesSection: Fasilitas sekolah
- AchievementsSection: Prestasi terbaru
- PartnersSection: Mitra kerjasama
- TestimonialsSection: Testimoni
- ExtracurricularsSection: Ekstrakurikuler
- ActivitiesSection: Kegiatan sekolah
- TeachersSection: Guru unggulan
- GallerySection: Galeri foto
- FAQSection: Frequently Asked Questions
- NewsSection: Berita terbaru
- CTASection: Call-to-action
- Footer: Footer dengan informasi lengkap
- Daftar berita dengan filtering
- Search functionality
- Pagination
- Category filtering
- Featured news highlight
- Informasi program keahlian
- Departemen detail
- Kurikulum overview
- Career prospects
- Form kontak
- Informasi alamat
- Maps integration
- Office hours
- Virtual assistant
- FAQ automation
- Information query
- Responsive navigation
- Theme switcher (dark/light)
- Search functionality
- Mobile-optimized menu
- Active page highlighting
- Dropdown menus
- Smooth page transitions
- Hover effects
- Loading animations
- Scroll-triggered animations
- Interactive elements
File: src/payload.config.ts
export default buildConfig({
admin: {
user: Users.slug,
importMap: {
baseDir: path.resolve(dirname),
},
},
collections: [
// Core Collections
Users, Media,
// Academic Collections
Departments, Teachers, Documents, Extracurriculars, Achievements,
// Content Collections
News, Events, Announcements, Gallery,
// Institutional Collections
OrganizationStructure,
// Partnership Collections
Partners,
],
globals: [ContactInfo, VisionMission, SchoolProfile, AboutPage, SocialMedia],
editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET || '',
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
db: mongooseAdapter({
url: process.env.DATABASE_URI || '',
}),
sharp,
plugins: [payloadCloudPlugin()],
})File: next.config.mjs
import { withPayload } from '@payloadcms/next/withPayload'
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
reactCompiler: false
},
images: {
domains: ['localhost'],
unoptimized: process.env.NODE_ENV === 'development'
}
}
export default withPayload(nextConfig)File: @tailwindcss/postcss
- Utility-first CSS framework
- Custom color palette sesuai branding sekolah
- Responsive design system
- Dark mode support
- Custom animations
Base URL: http://localhost:3000/api
GET /api/news # Get all news
POST /api/news # Create news (auth required)
GET /api/news/:id # Get news by ID
PUT /api/news/:id # Update news (auth required)
DELETE /api/news/:id # Delete news (auth required)
GET /api/departments # Get all departments
GET /api/teachers # Get all teachers
GET /api/events # Get all events
GET /api/achievements # Get all achievements
# ... similar patterns for other collections
GET /api/news/slug/:slug # Get news by slug
GET /api/departments/slug/:slug # Get department by slug
GET /api/globals/school-profile # School profile
GET /api/globals/vision-mission # Vision & mission
GET /api/globals/contact-info # Contact information
GET /api/globals/social-media # Social media links
GET /api/globals/about-page # About page content
Endpoint: http://localhost:3000/api/graphql
Playground: http://localhost:3000/api/graphql-playground
# Get all published news
query GetNews {
News(where: { status: { equals: published } }) {
docs {
id
title
slug
excerpt
publishDate
featuredImage {
url
alt
}
category
}
}
}
# Get department by slug
query GetDepartment($slug: String!) {
Departments(where: { slug: { equals: $slug } }) {
docs {
id
name
description
featuredImage {
url
alt
}
headOfDepartment {
name
title
bio
}
programs {
programName
programDescription
}
}
}
}# Build untuk production
pnpm build
# Start production server
pnpm start
# Generate types
pnpm generate:types
# Generate import map
pnpm generate:importmap# Build image
docker build -t smkn1-adiwerna .
# Run container
docker run -p 3000:3000 \
-e DATABASE_URI="your-mongodb-uri" \
-e PAYLOAD_SECRET="your-secret" \
smkn1-adiwerna# docker-compose.prod.yml
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DATABASE_URI=mongodb://mongo:27017/smkn1-adiwerna
- PAYLOAD_SECRET=your-production-secret
depends_on:
- mongo
restart: unless-stopped
mongo:
image: mongo:latest
volumes:
- mongo_data:/data/db
restart: unless-stopped
volumes:
mongo_data:# Deploy dengan Docker Compose
docker-compose -f docker-compose.prod.yml up -d-
Setup Environment Variables:
DATABASE_URI=your-mongodb-atlas-uri PAYLOAD_SECRET=your-secret-key PAYLOAD_PUBLIC_SERVER_URL=https://your-domain.vercel.app -
Deploy:
# Install Vercel CLI npm i -g vercel # Deploy vercel --prod
- Connect GitHub repository
- Set environment variables
- Deploy automatically on push
- Create new app from GitHub
- Configure build settings:
- Build Command:
pnpm build - Run Command:
pnpm start
- Build Command:
- Set environment variables
# Run linting
pnpm lint
# Fix linting issues
pnpm lint --fix
# Check types
pnpm type-check
# Format code
pnpm format| Script | Deskripsi |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build untuk production |
pnpm start |
Start production server |
pnpm lint |
Run ESLint |
pnpm generate:types |
Generate TypeScript types |
pnpm generate:importmap |
Generate import map |
pnpm payload |
Run PayloadCMS CLI commands |
- Fork repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Gunakan TypeScript untuk type safety
- Follow ESLint dan Prettier rules
- Tulis commit message yang deskriptif
- Test fitur sebelum submit PR
- Update dokumentasi jika diperlukan
MIT License - see LICENSE file for details.
Jika mengalami masalah atau membutuhkan bantuan:
- π§ Email: admin@smkn1adiwerna.sch.id
- π± WhatsApp: +62-xxx-xxxx-xxxx
- π Website: https://smkn1adiwerna.sch.id
- π Alamat: Jl. Raya Adiwerna, Tegal, Jawa Tengah
SMKN 1 Adiwerna - Mencetak Generasi Unggul dan Berkarakter π