Plek is a full-stack web application for managing room bookings in an institutional or corporate environment. It provides a robust backend built with Django and a modern frontend using React, with features for users, coordinators, and administrators.
https://drive.google.com/drive/folders/1IJOQv5UZ_g-wDyXzXfyzFAUP2eUCp_bS?usp=drive_link
- Features
- Architecture Overview
- Backend Structure
- Frontend Structure
- Key Modules
- User Roles & Permissions
- Booking Workflow
- Analytics & Audit
- Testing & Data Generation
- Styling & UI
- How to Run
- API Overview
- Extending the System
- Room Booking: Users can search, book, and manage room reservations.
- Role Management: Supports Users, Coordinators, Administrators, and Superadmins.
- Approval Workflow: Bookings may require approval based on user role and policy.
- Resource Management: Admins can manage rooms, buildings, floors, amenities, and departments.
- Analytics: Visual dashboards for room usage, booking trends, and user activity.
- Audit Logging: All critical actions are logged for traceability.
- Chatbot: Users can interact with a chatbot for booking and support.
- Responsive UI: Modern, mobile-friendly interface.
- Backend: Django REST Framework, SQLite (default), modular apps for accounts, bookings, rooms, analytics, audit, etc.
- Frontend: React (Vite), Tailwind CSS, modular components and pages.
- APIs: RESTful endpoints for all resources, authentication, and analytics.
- Testing: Django test cases and scripts for generating test data.
Located in backend/
:
- accounts/: User authentication, profile, and role/group management.
- bookings/: Booking models, approval logic, and endpoints.
- rooms/: Room, building, floor, amenity, and department management.
- analytics/: Aggregated statistics and reporting endpoints.
- audit/: Logging of user/system actions (
audit/admin.py
). - chatbot/: Chatbot logic and endpoints.
- core/, checks/, notifications/: Supporting modules.
- scripts/: Utilities like
generate_test_data.py
. - manage.py: Django management.
Located in frontend/
:
- src/components/: Reusable UI components (e.g., NavBar, ConfirmBooking, ModifyBooking).
- src/pages/: Page-level components for user/admin dashboards, analytics, booking, etc.
- src/context/: React context providers (Auth, Policy).
- src/utils/: Utility functions for formatting, API, bookings, etc.
- src/index.css: Tailwind CSS and custom styles.
- App.jsx: Main app router.
- main.jsx: Entry point.
- Users can create, view, modify, and cancel bookings.
- Bookings may require approval (by coordinator/admin) depending on user role and policy.
- Bookings are associated with rooms, time slots, and purposes.
- Admins can manage rooms, buildings, floors, amenities, and departments.
- Rooms have capacity, amenities, and can be filtered/searched.
- Roles: User, Coordinator, Admin, Superadmin.
- Coordinators manage bookings for assigned floors/departments.
- Admins manage all resources and users.
- Dashboards for booking trends, room utilization, top users, and more.
- Visualized using charts.
- All critical actions (booking, approval, changes) are logged in
AuditLog
andSystemLog
. - Logs are read-only in the admin interface.
- Users can interact with a chatbot for booking, modifying, or cancelling reservations.
- Chatbot integrates with backend logic for bookings.
- User: Can book rooms and manage their own bookings.
- Coordinator: Can approve bookings for assigned floors/departments.
- Administrator: Can manage all rooms and promote users.
- Superadmin: Full access, including institute policies.
Role logic is enforced in both backend (Django permissions) and frontend (conditional UI).
- User selects room, date, and time slot.
- Booking is created:
- If auto-approval is enabled or user is privileged, booking is approved instantly.
- Otherwise, booking is marked as pending for coordinator/admin approval.
- Approval:
- Coordinators/admins review and approve/reject bookings.
- Users are notified of status changes.
- Modification/Cancellation:
- Users can modify/cancel bookings (subject to policy and approval).
- Analytics:
- Room utilization, peak hours, top users, etc.
- Data fetched from
/api/analytics/
endpoints and visualized in admin dashboard.
- Audit Logs:
- All actions are logged with timestamp, user, action, and details.
- Logs are accessible in Django admin, read-only.
- Unit Tests:
- Example:
rooms/tests.py
for amenities and room APIs.
- Example:
- Test Data:
scripts/generate_test_data.py
creates sample users, rooms, bookings, etc.
- Tailwind CSS:
- Custom theme in
tailwind.config.js
. - Utility classes and custom components in
index.css
.
- Custom theme in
- Responsive Design:
- Layouts adapt to mobile and desktop.
- Install dependencies:
pip install -r backend/requirements.txt
- Run migrations:
python backend/manage.py migrate
- Create superuser:
python backend/manage.py createsuperuser
- Start server:
python backend/manage.py runserver
- Install dependencies:
cd frontend npm install
- Start dev server:
npm run dev
- Authentication:
/api/auth/
- Bookings:
/api/bookings/
- Rooms:
/api/rooms/
- Buildings/Floors:
/api/buildings/
,/api/floors/
- Amenities:
/api/amenities/
- Analytics:
/api/analytics/
- Audit Logs:
/api/audit/
- Chatbot:
/api/chatbot/
See frontend/src/api.js
and backend viewsets for details.
- Add new resources: Extend models and admin in backend, update frontend forms.
- Customize policies: Update policy logic in backend and
PolicyProvider
in frontend. - Integrate calendar: Extend booking logic and add calendar sync in frontend/backend.
- Add notifications: Use
notifications/
for email/SMS.
For more, see the codebase and explore