Skip to content

SafinBhuiyan/Software-Engineering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Presentation Room Booking System

A comprehensive presentation room booking system for university students and teachers, built with Node.js and Oracle Database 11g.

πŸš€ Quick Start

Prerequisites

  • Node.js (Latest LTS version)
  • Oracle Database 11g running
  • Oracle Instant Client installed and configured

Environment Setup

  1. Clone the repository and install dependencies:

    npm install
  2. Configure environment variables: Create a .env file in the root directory:

    DB_USER=your_oracle_username
    DB_PASSWORD=your_oracle_password
    DB_CONNECT_STRING=your_connection_string
    PORT=3000
  3. Start the application:

    npm start
  4. Access the application:

    • Open your browser and go to http://localhost:3000

✨ Features

Student Features

  • βœ… User registration and login
  • βœ… View available rooms and time slots
  • βœ… Book presentation slots with conflict prevention
  • βœ… Generate printable booking tokens
  • βœ… View booking history and manage bookings
  • βœ… Cancel bookings (with restrictions)

Teacher Features

  • βœ… User registration and login
  • βœ… Create new rooms with custom time availability
  • βœ… Auto-generate 30-minute time slots
  • βœ… View all bookings across all rooms
  • βœ… Manage room availability and schedules
  • βœ… Edit room details (with booking restrictions)

System Features

  • βœ… Session-based authentication with secure cookies
  • βœ… Responsive design for mobile and desktop
  • βœ… Real-time availability checking
  • βœ… Token-based booking verification
  • βœ… Comprehensive error handling

πŸ› οΈ Technology Stack

Backend Architecture

  • Runtime: Node.js (Latest LTS)
  • Server: Custom HTTP server (built with Node.js http module)
  • Database: Oracle Database 11g with oracledb driver
  • Authentication: Session-based with HTTP-only cookies
  • Security: SHA-256 password hashing
  • Routing: Manual URL-based routing system

Frontend Architecture

  • Markup: HTML5 with semantic elements
  • Styling: CSS3 with modern features (backdrop-filter, flexbox, grid)
  • Interactivity: Vanilla JavaScript (ES6+)
  • Responsive: Mobile-first design with media queries

Dependencies

{
  "dotenv": "^17.2.2",
  "oracledb": "^6.9.0"
}

Database Requirements

  • Oracle Database: 11g or higher
  • Instant Client: Version 23.9 (located at C:\instantclient_23_9)
  • Tables: Students, Teachers, Rooms, Slots, Bookings, Sessions

πŸ“ Project Structure

presentation-room-booking/
β”œβ”€β”€ app.js                    # Main server application
β”œβ”€β”€ package.json              # Node.js dependencies and scripts
β”œβ”€β”€ .env                      # Environment variables (configure this)
β”œβ”€β”€ TECH_STACK.md            # Detailed tech stack documentation
β”œβ”€β”€ README.md                # This file
β”œβ”€β”€ test-oracle-connection.js # Database connection testing
β”‚
β”œβ”€β”€ db/                      # Database layer
β”‚   β”œβ”€β”€ oracle.js            # Oracle connection and query utilities
β”‚   └── schema-oracle11g.sql # Database schema and setup
β”‚
β”œβ”€β”€ routes/                  # API route handlers
β”‚   β”œβ”€β”€ auth.js              # Authentication (login/register/logout/check)
β”‚   β”œβ”€β”€ student.js           # Student operations (bookings, slots)
β”‚   └── teacher.js           # Teacher operations (rooms, bookings)
β”‚
β”œβ”€β”€ views/                   # HTML templates
β”‚   β”œβ”€β”€ index.html           # Landing page
β”‚   β”œβ”€β”€ login.html           # User authentication
β”‚   β”œβ”€β”€ register.html        # User registration
β”‚   β”œβ”€β”€ dashboard_student.html    # Student dashboard
β”‚   β”œβ”€β”€ dashboard_teacher.html    # Teacher dashboard
β”‚   β”œβ”€β”€ bookings.html        # Student bookings management
β”‚   β”œβ”€β”€ slots.html           # Available slots browser
β”‚   β”œβ”€β”€ rooms.html           # Teacher rooms management
β”‚   β”œβ”€β”€ teacher_bookings.html # All bookings overview
β”‚   └── token.html           # Booking token display
β”‚
└── public/                  # Static assets
    β”œβ”€β”€ favicon.ico          # Website favicon
    β”œβ”€β”€ css/
    β”‚   └── style.css        # Main stylesheet
    β”œβ”€β”€ js/
    β”‚   └── script.js        # Client-side utilities
    └── images/              # Image assets (logo, icons)

πŸ”§ API Endpoints

Authentication Endpoints

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User authentication
  • POST /api/auth/logout - User logout
  • GET /api/auth/check - Session validation

Student Endpoints

  • GET /api/student/slots - Get available slots
  • POST /api/student/book - Book a slot
  • GET /api/student/bookings - Get user's bookings
  • DELETE /api/student/bookings/:id - Cancel booking
  • GET /api/student/token/:code - Get booking token

Teacher Endpoints

  • POST /api/teacher/create-room - Create new room with slots
  • GET /api/teacher/rooms - Get all rooms
  • PUT /api/teacher/rooms/:id - Update room details
  • DELETE /api/teacher/delete-room - Delete room
  • GET /api/teacher/bookings - Get all bookings
  • DELETE /api/teacher/delete-slot - Delete slot

πŸ—„οΈ Database Schema

Core Tables

  • Students: Student accounts (student_id, name, email, password, batch, dept)
  • Teachers: Teacher accounts (teacher_id, name, email, password)
  • Rooms: Presentation rooms (room_id, room_no, date_available, time_from, time_to)
  • Slots: Time slots (slot_id, room_id, date, time_start, time_end, status)
  • Bookings: Room bookings (booking_id, student_id, slot_id, token_code, booking_time)
  • Sessions: User sessions (session_id, user_id, role, created_at)

Key Relationships

  • Students β†’ Bookings (one-to-many)
  • Teachers β†’ Rooms (one-to-many)
  • Rooms β†’ Slots (one-to-many)
  • Slots β†’ Bookings (one-to-one)

πŸš€ Deployment & Development

Development Environment

  • OS: Windows 11 (configured for Oracle Instant Client)
  • Node.js: Latest LTS version
  • Oracle: Database 11g with Instant Client 23.9
  • Browser: Modern browsers with ES6+ support

Production Considerations

  • Process Management: Use PM2 for production deployment
  • Reverse Proxy: Nginx recommended for static file serving
  • SSL/TLS: HTTPS required for secure cookie transmission
  • Database: Implement connection pooling for high traffic
  • Environment: Use separate production .env configuration

Security Features

  • βœ… Password hashing (SHA-256)
  • βœ… HTTP-only session cookies
  • βœ… Session expiration (24 hours)
  • βœ… SQL injection prevention (parameterized queries)
  • βœ… CORS headers configuration
  • βœ… Input validation and sanitization

πŸ“š Additional Resources

Documentation

Development Tools

  • Postman: API testing and documentation
  • Browser DevTools: Frontend debugging and testing
  • Oracle SQL Developer: Database management and queries

πŸŽ‰ Ready to Use!

Once you've configured your Oracle database connection in the .env file, simply run npm start and access http://localhost:3000 to begin using the Presentation Room Booking System!

Version: 1.0.0 Last Updated: December 2024

About

A comprehensive presentation room booking system for university students and teachers, built with Node.js and Oracle Database 11g.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors