Skip to content

Repository files navigation

CI2P Research Lab

Computational Intelligence, Innovation & Performance
University of Jinan - Key Laboratory of Intelligent Computing Technology

A modern, full-stack research lab website built with Next.js 15, TypeScript, and Prisma. Features comprehensive content management, authentication, and resource booking systems.

🎬 Demo

Hero Section

Screenshots

About Section Research Focus Areas
Research in Action Neural Network Flow

πŸš€ Features

Public-Facing

  • Homepage: Video hero section with lab metrics, featured research, and team showcase
  • Research Publications: Searchable database with filters, citations, and PDF downloads
  • Projects: Active and completed projects with team member integration
  • News & Updates: Blog-style news feed with categories and tags
  • Team Directory: Researcher profiles with publications and project listings
  • Resource Booking: Lab equipment and facility reservation system

Content Management

  • Admin Dashboard: Full CRUD operations for all content types
  • Rich Text Editor: Markdown-based content editing with preview
  • File Management: Secure file uploads with validation
  • Featured Content: Pin and feature important publications/projects
  • View Tracking: Automatic analytics for papers, projects, and news

Technical Features

  • Authentication: JWT-based auth with role-based access control (SUPER_ADMIN, RESEARCHER, STUDENT, GUEST)
  • Database: PostgreSQL with Prisma ORM
  • API Routes: RESTful APIs with proper error handling and validation
  • Responsive Design: Mobile-first, fully responsive UI with Tailwind CSS
  • Type Safety: Full TypeScript coverage with strict mode
  • Performance: Server-side rendering, static generation, and optimized images

πŸ› οΈ Tech Stack

  • Framework: Next.js 15 (App Router)
  • Language: TypeScript 5
  • Database: PostgreSQL with Prisma ORM
  • Styling: Tailwind CSS + shadcn/ui components
  • Authentication: JWT with bcrypt password hashing
  • Forms: React Hook Form + Zod validation
  • Rich Text: Custom Markdown editor with live preview
  • Animations: Framer Motion
  • Icons: Lucide React

πŸ“ Project Structure

ci2p/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ (main)/            # Main public routes
β”‚   β”œβ”€β”€ (auth)/            # Authentication routes (login, register)
β”‚   β”œβ”€β”€ (public)/          # Public content routes
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   β”œβ”€β”€ auth/          # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ papers/        # Publications CRUD
β”‚   β”‚   β”œβ”€β”€ projects/      # Projects CRUD
β”‚   β”‚   β”œβ”€β”€ news/          # News CRUD
β”‚   β”‚   β”œβ”€β”€ resources/     # Resource booking system
β”‚   β”‚   └── ...
β”‚   └── layout.tsx         # Root layout
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ layout/           # Navigation, footer, etc.
β”‚   β”œβ”€β”€ sections/         # Homepage sections
β”‚   β”œβ”€β”€ editor/           # Rich text editor
β”‚   └── ui/               # shadcn/ui components
β”œβ”€β”€ lib/                  # Utility functions
β”‚   β”œβ”€β”€ auth.ts           # JWT utilities
β”‚   β”œβ”€β”€ prisma.ts         # Prisma client
β”‚   └── utils.ts          # Helpers
β”œβ”€β”€ prisma/               # Database schema and migrations
β”‚   β”œβ”€β”€ schema.prisma     # Database models
β”‚   └── seed.ts           # Seed data
└── types/                # TypeScript type definitions

πŸƒβ€β™‚οΈ Getting Started

Prerequisites

  • Node.js 18.x or higher
  • PostgreSQL 14.x or higher
  • npm/yarn/pnpm

Installation

  1. Clone the repository
git clone https://github.com/Hetawk/ci2p.git
cd ci2p
  1. Install dependencies
npm install
  1. Set up environment variables
cp .env.example .env

Edit .env with your database and JWT secret:

DATABASE_URL="postgresql://user:password@localhost:5432/ci2p"
JWT_SECRET="your-secret-key-here"
  1. Set up the database
# Run migrations
npx prisma migrate dev

# Seed initial data (optional)
npx prisma db seed
  1. Run the development server
npm run dev

Open http://localhost:3000 to view the site.

Example Login (After Seeding)

After running the seed script, you can login with the credentials configured in your .env file:

  • Email: your-admin-email@example.com
  • Password: Set via SEED_PASSWORD environment variable

πŸ“š API Documentation

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login and get JWT token
  • POST /api/auth/verify-email - Verify email address
  • POST /api/auth/forgot-password - Request password reset
  • POST /api/auth/reset-password - Reset password with token
  • GET /api/auth/me - Get current user profile

Publications

  • GET /api/papers - List publications (with filters)
  • POST /api/papers - Create publication (admin)
  • GET /api/papers/[id] - Get single publication
  • PUT /api/papers/[id] - Update publication (admin)
  • DELETE /api/papers/[id] - Delete publication (admin)
  • PATCH /api/papers/[id] - Toggle featured/published status (admin)

Projects

  • GET /api/projects - List projects
  • POST /api/projects - Create project (admin)
  • GET /api/projects/[id] - Get project details
  • PUT /api/projects/[id] - Update project (admin)
  • DELETE /api/projects/[id] - Delete project (admin)

Resources & Bookings

  • GET /api/resources - List available resources
  • POST /api/resources - Create resource (admin)
  • GET /api/resources/bookings - List bookings (filtered by user)
  • POST /api/resources/bookings - Create booking request
  • PATCH /api/resources/bookings/[id] - Approve/reject booking (admin)

Full API documentation available in /zdir/API_Documentation.md

πŸ” User Roles & Registration Flow

User Roles

  • SUPER_ADMIN: Full system access, user management
  • RESEARCHER: Create/edit own content, view analytics
  • STUDENT: Limited content creation, resource booking
  • GUEST: View public content only

Registration Process

  1. User Registration: Prospective researchers/students submit registration form with personal information
  2. Admin Review: Registration requests appear in admin dashboard for approval
  3. Approval & Account Creation: Admin/Super Admin reviews and approves, system generates temporary password
  4. First Login: User receives temporary credentials and must change password on first login
  5. Access Granted: User can now access system with their chosen secure password

This ensures proper vetting of all lab members and maintains security standards.

πŸš€ Deployment

Vercel (Recommended)

  1. Push to GitHub
  2. Import project in Vercel
  3. Add environment variables
  4. Deploy

Docker

docker build -t ci2p .
docker run -p 3000:3000 ci2p

πŸ“ Recent Updates

Phase 2 Complete (October 2025)

  • βœ… Fixed all Next.js 15 async params errors
  • βœ… Fixed auth API schema mismatches
  • βœ… Implemented Resources & Bookings API system
  • βœ… Added conflict detection for bookings
  • βœ… Admin approval workflow for reservations
  • βœ… Resolved routing conflicts
  • βœ… Zero TypeScript compilation errors

Phase 1 Complete

  • βœ… Papers detail page with view tracking
  • βœ… Projects detail page with member integration
  • βœ… News detail page with related posts
  • βœ… Full CRUD APIs for all content types

🀝 Contributing

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

πŸ“„ License

This project is proprietary software for CI2P Research Lab.

πŸ“§ Contact

CI2P Research Lab
Prof. Sijie Niu - Lab Director
School of Information Science and Engineering
University of Jinan
No. 336 West Road of Nan Xinzhuang
Jinan, Shandong 250022, China

πŸ“§ Email: sjniu@hotmail.com | ise_niusj@ujn.edu.cn
πŸ“ž Phone: 0531-82767569
πŸ”¬ Google Scholar: Prof. Sijie Niu
πŸ”— ORCID: 0000-0002-1401-9859


Built with ❀️ by the CI2P Development Team

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages