Skip to content

cp-laboratory/cplab-latest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

126 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cyber Physical Laboratory (CPLAB) Website

A modern, feature-rich research laboratory website built with Next.js 15, Payload CMS 3, and TypeScript. This platform serves as a comprehensive digital presence for the Cyber Physical Laboratory, showcasing research publications, projects, team members, and lab activities.

🌟 Features

Frontend Application

  • Modern UI/UX: Built with Next.js 15, Tailwind CSS, and Framer Motion animations
  • Responsive Design: Mobile-first approach with seamless experience across all devices
  • Dark Mode Support: Automatic theme switching with system preference detection
  • Progressive Web App (PWA): Installable web app with offline support
  • Push Notifications: Real-time updates for lab announcements and news

Core Pages

🏠 Homepage

  • Dynamic hero section with lab introduction
  • Research areas showcase
  • Latest news and announcements
  • Lab highlights and statistics
  • Professor profiles section
  • Recruitment banner
  • Newsletter subscription
  • FAQ section

πŸ‘₯ Team

  • Team Listing: Grid view of all lab members with filters by member type
  • Team Detail Pages: Individual profile pages with:
    • Personal information and bio
    • Education and experience
    • Research interests and expertise
    • Publications with sorting (by year/title)
    • Projects participation
    • Certificates and awards
    • Social media links
    • Contact information

πŸ“š Publications

  • Publications Listing: Comprehensive list with advanced filtering
    • Search by title, author, keywords, or abstract
    • Filter by publication type (Journal, Conference, Book Chapter, etc.)
    • Filter by year
    • Pagination support
  • Publication Detail Pages: Beautiful, professional layout featuring:
    • Complete publication metadata
    • Clickable author links (internal team members β†’ profile, external β†’ custom link)
    • Abstract and keywords
    • Venue information
    • DOI and identifier links
    • Metrics (citations, downloads, impact factor)
    • Awards and recognition
    • Featured image display
    • Share functionality

πŸ”¬ Projects

  • Projects Listing: Showcase of research and student projects
    • Filter by project type, status, and research areas
    • Search functionality
    • Featured projects highlighting
  • Project Detail Pages: Comprehensive project information:
    • Project overview and timeline
    • Problem, solution, and impact sections
    • Team members with roles
    • Technologies and tools used
    • Key features
    • Project links (GitHub, live demo, documentation)
    • Embedded YouTube videos
    • Image galleries
    • Achievements and milestones
    • Challenges and learnings
    • Funding information
    • Related publications
    • Downloadable documents

πŸ“° News & Updates

  • Latest lab news and articles
  • News detail pages with rich content
  • Featured image support

πŸ“ž Contact

  • Contact information and form
  • Lab location details
  • Social media links

πŸ’Ό Recruitment

  • Multi-step application form with validation
    • Personal information
    • Academic background
    • Research interests
    • Project proposals with Lexical editor
    • Resume/CV upload
    • Statement of Purpose
  • Client and server-side validation
  • Progress tracking through steps

πŸŽ“ Certificate Verification

  • Verify lab-issued certificates by ID
  • QR code generation for certificates
  • Downloadable certificate PDFs

Admin Dashboard (Payload CMS)

Role-Based Access Control (RBAC)

Professor Role (Admin)
  • Full access to all collections and features
  • Can create, read, update, and delete all content
  • Media upload capabilities
  • User management
  • System configuration
Student Role (Member)
  • Limited access to own content
  • Can create and manage own:
    • Profile/Portfolio
    • Publications (where they are authors)
    • Projects (where they are team members)
  • Read-only access to published content
  • Cannot access administrative features

Content Collections

  1. Users: User management with professor/student roles
  2. Profiles: Detailed member portfolios with education, experience, publications, and projects
  3. Publications: Research papers with:
    • Flexible author system (internal lab members or external authors with custom links)
    • Rich metadata (DOI, ISBN, arXiv, PubMed IDs)
    • Venue information
    • Keywords and tags
    • Files and supplementary materials
    • Metrics tracking
    • Awards and funding
  4. Projects: Comprehensive project management
  5. News: News articles and announcements
  6. Recruitment: Student application submissions
  7. Certificates: Certificate generation and management
  8. Notifications: Push notification system
  9. FAQ: Frequently asked questions (Admin only)
  10. Notices: General notices (Admin only)
  11. Lab Highlights: Homepage statistics (Admin only)
  12. Research Areas: Research focus areas (Admin only)

πŸ› οΈ Technology Stack

Frontend

  • Framework: Next.js 15 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Animations: Framer Motion
  • UI Components: Radix UI primitives
  • Icons: Lucide React, Tabler Icons
  • Forms: React Hook Form with Zod validation
  • Rich Text: Lexical Editor
  • State Management: React Context API

Backend & CMS

  • CMS: Payload CMS 3.x
  • Database: MongoDB (via Mongoose adapter)
  • Storage: AWS S3 compatible (Cloudflare R2)
  • Email: Nodemailer
  • Authentication: Payload built-in auth with JWT

Additional Features

  • SEO: Payload SEO plugin
  • PWA: Service Worker with offline support
  • Analytics: Vercel Analytics & Speed Insights
  • PDF Generation: jsPDF, html2canvas
  • Image Processing: Sharp

πŸ“ Project Structure

cplab-latest/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (frontend)/           # Public-facing pages
β”‚   β”‚   β”œβ”€β”€ page.tsx          # Homepage
β”‚   β”‚   β”œβ”€β”€ team/             # Team pages
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx      # Team listing
β”‚   β”‚   β”‚   └── [id]/         # Individual profiles
β”‚   β”‚   β”œβ”€β”€ publications/     # Publications
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx      # Publications listing
β”‚   β”‚   β”‚   └── [slug]/       # Publication details
β”‚   β”‚   β”œβ”€β”€ projects/         # Projects
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx      # Projects listing
β”‚   β”‚   β”‚   └── [id]/         # Project details
β”‚   β”‚   β”œβ”€β”€ news/             # News pages
β”‚   β”‚   β”œβ”€β”€ recruitment/      # Recruitment application
β”‚   β”‚   β”œβ”€β”€ certificate/      # Certificate verification
β”‚   β”‚   β”œβ”€β”€ contact/          # Contact page
β”‚   β”‚   β”œβ”€β”€ developer/        # Developer info
β”‚   β”‚   └── offline/          # Offline fallback
β”‚   β”œβ”€β”€ (payload)/            # Payload CMS admin
β”‚   β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   └── api/
β”‚   β”œβ”€β”€ api/                  # Custom API routes
β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   └── globals.css           # Global styles
β”œβ”€β”€ collections/              # Payload collections
β”‚   β”œβ”€β”€ Users.ts
β”‚   β”œβ”€β”€ Profiles.ts
β”‚   β”œβ”€β”€ Publications.ts
β”‚   β”œβ”€β”€ Projects.ts
β”‚   β”œβ”€β”€ News.ts
β”‚   β”œβ”€β”€ Recruitment.ts
β”‚   β”œβ”€β”€ Certificates.ts
β”‚   β”œβ”€β”€ Notifications.ts
β”‚   └── ...
β”œβ”€β”€ components/               # Reusable components
β”‚   β”œβ”€β”€ navbar.tsx
β”‚   β”œβ”€β”€ footer.tsx
β”‚   β”œβ”€β”€ notification-panel.tsx
β”‚   β”œβ”€β”€ home/                 # Homepage sections
β”‚   β”œβ”€β”€ ui/                   # UI components
β”‚   └── ...
β”œβ”€β”€ contexts/                 # React contexts
β”‚   └── notification-context.tsx
β”œβ”€β”€ lib/                      # Utilities
β”‚   β”œβ”€β”€ utils.ts
β”‚   β”œβ”€β”€ fonts.ts
β”‚   └── utilities/
β”œβ”€β”€ public/                   # Static assets
β”‚   β”œβ”€β”€ manifest.json
β”‚   β”œβ”€β”€ sw.js                 # Service Worker
β”‚   └── offline.html
β”œβ”€β”€ docs/                     # Documentation
β”‚   β”œβ”€β”€ QUICK_START.md
β”‚   β”œβ”€β”€ RBAC_IMPLEMENTATION.md
β”‚   β”œβ”€β”€ PAYLOAD_SETUP.md
β”‚   └── ...
β”œβ”€β”€ payload.config.ts         # Payload configuration
β”œβ”€β”€ next.config.mjs          # Next.js configuration
β”œβ”€β”€ tsconfig.json            # TypeScript config
└── tailwind.config.ts       # Tailwind config

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm
  • MongoDB database
  • AWS S3 compatible storage (Cloudflare R2 recommended)

Environment Variables

Create a .env.local file in the root directory:

# Database
DATABASE_URI=mongodb://localhost:27017/cplab

# Payload CMS
PAYLOAD_SECRET=your-super-secret-key-here
NEXT_PUBLIC_SERVER_URL=http://localhost:3000

# AWS S3 / Cloudflare R2
S3_ENDPOINT=https://your-account-id.r2.cloudflarestorage.com
S3_BUCKET=your-bucket-name
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET_ACCESS_KEY=your-secret-key
S3_REGION=auto

# Email (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
[email protected]
SMTP_PASS=your-app-password

# Push Notifications (Optional)
NEXT_PUBLIC_VAPID_PUBLIC_KEY=your-vapid-public-key
VAPID_PRIVATE_KEY=your-vapid-private-key

Installation

  1. Clone the repository

    git clone https://github.com/cp-laboratory/cplab-latest.git
    cd cplab-latest
  2. Install dependencies

    pnpm install
  3. Set up environment variables

    cp .env.example .env.local
    # Edit .env.local with your configuration
  4. Run the development server

    pnpm dev
  5. Access the application

First-Time Setup

  1. Navigate to http://localhost:3000/admin
  2. Create the first user account with Professor (Admin) role
  3. Configure lab settings and content through the admin dashboard

πŸ“ Usage Guide

For Administrators (Professors)

  1. Managing Team Members

    • Create user accounts for new lab members
    • Assign appropriate roles (Professor/Student)
    • Create and manage detailed profiles
  2. Publications

    • Add new publications with complete metadata
    • Choose between internal lab members or external authors
    • For external authors: provide name, affiliation, and profile link
    • Upload PDFs and supplementary materials
  3. Projects

    • Create project entries with comprehensive details
    • Assign team members and technologies
    • Upload project images and documents
    • Track project metrics and achievements
  4. Content Management

    • Publish news and announcements
    • Manage FAQs and notices
    • Update lab highlights and research areas
    • Send push notifications to subscribers

For Students

  1. Profile Management

    • Update personal profile and portfolio
    • Add education and experience
    • Showcase skills and expertise
  2. Publications & Projects

    • Create entries for publications where you're an author
    • Manage projects you're part of
    • View published content from the lab

🎨 Customization

Theme Configuration

  • Edit tailwind.config.ts for custom colors and styling
  • Modify app/globals.css for global styles
  • Theme colors automatically adapt to dark/light mode

Component Customization

  • All UI components are in /components directory
  • Use Radix UI primitives for accessible components
  • Framer Motion for animations

Content Structure

  • Modify collection schemas in /collections directory
  • Add new fields or collections as needed
  • Update TypeScript interfaces accordingly

πŸ”’ Security Features

  • Role-Based Access Control: Granular permissions for professors and students
  • JWT Authentication: Secure token-based authentication
  • Input Validation: Client and server-side validation
  • HTTPS Enforcement: Production deployments use HTTPS
  • Environment Variables: Sensitive data stored securely

πŸ“± Progressive Web App

The application is a fully functional PWA with:

  • Offline Support: Service Worker caches essential resources
  • Installable: Add to home screen on mobile devices
  • Push Notifications: Real-time updates for important announcements
  • App-like Experience: Smooth, native-like interactions

πŸš€ Deployment

Vercel (Recommended)

  1. Connect your GitHub repository to Vercel
  2. Configure environment variables in Vercel dashboard
  3. Deploy with automatic builds on push

Docker

# Build the image
docker build -t cplab .

# Run the container
docker run -p 3000:3000 --env-file .env.local cplab

Manual Deployment

# Build for production
pnpm build

# Start production server
pnpm start

πŸ“Š Performance

  • Server Components: Optimized with React Server Components
  • Image Optimization: Next.js Image component with WebP/AVIF
  • Code Splitting: Automatic route-based code splitting
  • ISR: Incremental Static Regeneration for dynamic content
  • Edge Caching: CDN caching for static assets

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support

For support and questions:

πŸ”— Links


Developed with ❀️ by Shahriar Hasan

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages