LISA (Library Intelligent Seat Allocation System) is a comprehensive solution designed to automate and optimize the process of library seat allocation. Utilizing a state-of-the-art AI-driven computer vision system, LISA detects real-time seat occupancy and synchronizes the data across user interfaces. It offers three distinct frontends: a landing page, an admin dashboard for library and zone management, and a user app for checking seat availability.
- Frameworks: React 19, Vite
- Styling: Tailwind CSS v4
- Routing: React Router v7
- HTTP Client: Axios
The frontend is divided into three separate packages:
landing-page- Public introductory pageadmin-frontend- Dashboard for administrators to manage libraries, floors, and zones.user-frontend- Application for end users to view seat availability.
- Framework: Express.js
- Database: Firebase (Firestore & Realtime functionalities integration)
- Authentication: JWT, bcrypt/bcryptjs
- Media/File Storage: Cloudinary, Multer
- Validation: Zod
- Other utilities: Nodemailer, cookie-parser, cors
- Framework: FastAPI, Uvicorn
- Computer Vision: OpenCV-Python, Numpy
- Database integration: Firebase-admin
LISA uses a NoSQL structure in Firebase Firestore. Below are the primary collections and their inferred schemas:
users
email(string)password(string - hashed)role(string - e.g., admin, user)createdAt(timestamp)
libraries
libraryName(string)libraryAddress(string)adminId(reference to User)
floors
floorName(string)libraryId(reference to Library)
zones
name(string)hasAC(boolean)capacity(number)vacancy(number)floorId(reference to Floor)
- Node.js (v18 or higher recommended)
- Python 3.9+
- Firebase Project with Firestore Database & Service Account configured
- Cloudinary Account (for image/video uploads)
-
Clone the repository:
git clone <repository-url> cd LISA
-
Backend Setup:
cd server npm installCreate a
.envfile in theserverdirectory and add your Firebase, Cloudinary, and JWT configuration variables. -
AI Service Setup:
cd server/ai_service pip install -r requirements.txtYou'll need a Firebase Service Account JSON file configured to allow the AI service to communicate with the DB.
-
Frontend Setup: Navigate to each frontend directory and install dependencies:
# Admin Frontend cd frontend/admin-frontend npm install # User Frontend cd frontend/user-frontend npm install # Landing Page cd frontend/landing-page npm install
-
Start the Express Server:
cd server npm run devThis will run on
http://localhost:3000(or your configuredPORT) and also serves the frontend build files statically if built. -
Start Frontend Development Servers: Open separate terminals for the frontends you wish to work on and run:
npm run dev
(e.g.,
cd frontend/admin-frontend && npm run dev)
The Node.js server acts as the central hub. It statically serves the built frontend applications. To prepare for deployment:
- Build the frontends:
cd frontend/landing-page && npm run build cd ../admin-frontend && npm run build cd ../user-frontend && npm run build
- The
server/index.jsroutes incoming UI requests based on the URL paths (/,/app,/admin) to the respective/distfolders of the frontends. - Deploy the
serverdirectory (andserver/ai_serviceseparately or via Docker) to platforms like Render, Heroku, AWS, or GCP. Ensure you inject all required environment variables into the deployment host.
The Base API is served via Express. Below are the core route groups:
POST /auth/user/signup- Register a new userPOST /auth/user/login- User loginGET /auth/user/logout- User logoutPOST /auth/admin/signup- Register a new adminPOST /auth/admin/verify/:AdminId- Verify admin registrationPOST /auth/admin/login- Admin loginGET /auth/admin/logout- Admin logoutGET /auth/me- Get current authenticated user
GET /lib/floors/:floorId- Get zones for a floorPOST /lib/libraries- Create a new libraryPUT /lib/libraries/:libraryId- Update an existing libraryDELETE /lib/libraries/:libraryId- Delete a library and its sub-resourcesPOST /lib/libraries/:libraryId/floors- Add a floor to a libraryPUT /lib/floors/:floorId- Update a floorDELETE /lib/floors/:floorId- Delete a floor and its zonesPOST /lib/floors/:floorId/zones- Create a new zone on a floorPUT /lib/zones/:zoneId- Update a zoneDELETE /lib/zones/:zoneId- Delete a zone
GET /dashboard/libraries- List all librariesGET /dashboard/libraries/:libraryId- Get dashboard data for a libraryGET /dashboard/floors/:floorId- Get dashboard data for zones on a floor
POST /camera/setup- Upload setup media (requiresimageandvideoin multipart form data)GET /camera/:zoneName- Retrieve camera data for a zone
POST /ai/start/:zoneName- Start the AI seat detection for a zonePOST /ai/stop/:zoneName- Stop the AI seat detection for a zoneGET /ai/seat-states/live/:zoneName- Retrieve real-time seat statesGET /ai/health- Check health status of the AI serviceGET /ai/config/:zoneName- Get AI configuration for a specific zone