Skip to content

NITRR-Official/ArchHira

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ArchHira

PRs Welcome

The operating platform for Architecture Department venue booking workflows β€” designed to manage authentication, booking, approvals, and admin operations in one system.

πŸ“– About

ArchHira is a Next.js-based booking and operations platform for:

  • Hira Hall bookings
  • Architecture Hall bookings
  • Guest House bookings (date-range and room-capacity flow)

It replaces fragmented manual processes with a unified system including OTP-based auth, conflict-aware booking, admin approval workflows, and email notifications.

Key Problems Solved

  • Scheduling conflicts β€” Slot/date conflict checks for halls and guest-house capacity logic
  • Manual approval overhead β€” Structured admin dashboard for review and status updates
  • Authentication friction β€” OTP-assisted login and password reset flows
  • Data inconsistency β€” Centralized booking state with MongoDB persistence option
  • Operational visibility gap β€” Dedicated admin views and booking detail workflows

Who Is This For?

  • Faculty/Staff/Student organizers requesting halls and guest-house stays
  • Department admins managing approvals and rejections
  • System maintainers extending booking, auth, and workflow capabilities

✨ Features

Authentication & Session Layer βœ…

  • User registration with hashed passwords
  • OTP-based login verification
  • OTP resend and password-reset via OTP
  • Session check (/api/auth/me) and logout flow

Booking Engine βœ…

  • Multi-venue support: HIRA_HALL, ARCHITECTURE_HALL, GUEST_HOUSE
  • Slot system for halls: FIRST_HALF, SECOND_HALF, FULL_DAY
  • Guest-house date-range and room availability checks
  • Booking lifecycle: PENDING, APPROVED, REJECTED
  • Approval date policy enforcement (minimum 7-day lead time)

Admin Operations βœ…

  • Admin login endpoint and admin dashboard
  • Super-admin-only add-admin capability
  • First super admin seeded via environment variables
  • Approval/rejection email notifications

Testing & Quality 🟑

  • Validation scripts available (npm run lint, npm run build)
  • Detailed testing strategy and status documentation present
  • Automated unit/integration test suites documented but not yet implemented

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm

Installation

npm install

Configure Environment

Create .env.local from .env.example:

# MongoDB
MONGODB_URI=mongodb://localhost:27017
# MONGODB_DB_NAME=hira-hall

# First admin (super admin)
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your-secure-password

# Optional SMTP
# SMTP_HOST=smtp.gmail.com
# SMTP_PORT=587
# SMTP_USER=your@gmail.com
# SMTP_PASS=your-app-password
# SMTP_FROM=noreply@yourdomain.com

Run the Project

npm run dev

Open: http://localhost:3000

πŸ” Access Model

  • Public auth endpoints: register/login/verify/resend/forgot/reset
  • Authenticated user required: booking APIs, /api/auth/me, /api/auth/logout
  • MongoDB required: admin APIs (/api/admin/login, /api/admin/add)
  • Super-admin restriction: only super admin can add additional admins

πŸ› οΈ Tech Stack

  • Frontend/Server: Next.js 15 (App Router), React 19, TypeScript
  • Validation & Forms: Zod, react-hook-form, @hookform/resolvers
  • UI/Date: Tailwind CSS, Lucide React, react-day-picker, date-fns
  • Data: MongoDB (with in-memory fallback for bookings where applicable)
  • Email: Nodemailer

πŸ—οΈ Architecture Highlights

Layered Design

  • API Layer: App Router handlers under app/api/**
  • Business Logic Layer: conflict and rule enforcement in lib/booking-logic.ts
  • Validation Layer: shared Zod schemas in lib/validations.ts
  • Persistence Layer: MongoDB-backed auth/admin; bookings via store abstraction

Core Modules

  • Auth Module β€” OTP lifecycle, password reset, session flows
  • Bookings Module β€” create/list/update/delete + conflict checks
  • Admin Module β€” login + super-admin-controlled admin provisioning

πŸ“ Project Structure

app/
  api/auth/*                  # Register/login/OTP/password reset/session/logout
  api/bookings/route.ts       # List/create bookings
  api/bookings/[id]/route.ts  # CRUD and status updates by ID
  api/admin/login/route.ts    # Admin login
  api/admin/add/route.ts      # Add admin (super admin only)
  page.tsx                    # Auth entry
  dashboard/page.tsx          # Main user dashboard
  book/hall/page.tsx
  book/architecture-hall/page.tsx
  book/guest-house/page.tsx
  admin/page.tsx
  admin/dashboard/page.tsx
  admin/booking/[id]/page.tsx

components/
  booking-calendar.tsx
  booking-form.tsx
  guest-house-booking-form.tsx
  LogoutButton.tsx

lib/
  auth.ts
  admins.ts
  booking-logic.ts
  store-server.ts
  mongodb.ts
  validations.ts
  email.ts

βœ… Validation Commands

Run from repository root:

npm run lint
npm run build

πŸ“š Documentation

🎯 Roadmap Snapshot

  • βœ… Authentication + OTP flows
  • βœ… Multi-venue booking APIs and UI
  • βœ… Admin dashboard and approval lifecycle
  • 🟑 Automated test suite implementation and CI hardening
  • πŸ“‹ Session hardening, rate-limiting, and operational observability improvements

🀝 Contributing

Contributions are welcome. Please keep changes aligned with:

  • Existing module boundaries (auth, bookings, admin)
  • Shared validation and typing patterns
  • Root validation checks (npm run lint, npm run build)
  • Documentation updates for behavior changes

About

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages