You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HostelNET is an enterprise-grade, polyglot microservices platform engineered for modern hostel management and room allocation across universities, hostel wardens, and students. Built with an Event-Driven Architecture (EDA), Apache Kafka messaging, an Nginx API Gateway, high-concurrency Go microservices, Django Auth, and an integrated Google Gemini AI Assistant (RoomieAI).
Authentication & Authorization: Manages user signups, logins, and issues JWT tokens containing claims (username, email, role).
Role-Based Unique ID Generation: Automatically generates system-wide unique identifiers prefixed by role (e.g., UNI... for Universities, HOS... for Hostels, STD... for Students).
Event Production: Uses confluent_kafka to publish domain events (UserCreated, UserUpdated, UserDeleted) onto the user-events Kafka topic.
3. β‘ Allocation Service β Core Business Operations (backend1/Services/Service-Allocation-Go/)
Tech Stack: Go (Golang 1.20+), Gin Web Framework, GORM, PostgreSQL
Port: 8012
Responsibilities:
High-concurrency service handling core domain models: Hostels, Rooms, Beds, Applications, Allocations, Students, and Universities.
JWT Validation Middleware: Intercepts requests, validates token signatures, and enforces role permissions across /university, /student, and /hostel routes.
Kafka Consumer Engine: Listens to the user-events topic (allocation_service_go_group) to asynchronously sync user records from the User Service into its local PostgreSQL database.
4. π€ RoomieAI Service β Context-Aware Assistant (backend1/Services/Service-Chatbot/)
Interactive embedded RoomieAI Chat Modal for real-time guidance.
π₯ Role-Based Workflows
sequenceDiagram
autonumber
actor Admin as University Admin
actor Student as Student
actor Warden as Hostel Warden
participant US as User Service (Django)
participant K as Kafka Bus
participant AS as Allocation Service (Go)
Note over Admin, US: 1. Registration Phase
Admin->>US: Register Hostel (Role: Warden) & Student (Role: Student)
US-->>Admin: Returns Credentials (UNI..., HOS..., STD...)
US->>K: Publish UserCreated Event
K->>AS: Sync User Profile to Allocation DB
Note over Admin, AS: 2. Assignment Phase
Admin->>AS: Assign Hostel to Student (STD ID -> HOS ID)
Note over Student, AS: 3. Application Phase
Student->>AS: Submit Room Application (Preferences & Docs)
Note over Warden, AS: 4. Allocation Phase
Warden->>AS: View Pending Applications
Warden->>AS: Allocate Room (STD ID -> Room #)
AS-->>Student: Application Approved (Room Number Displayed)
cd backend1/Services/Service-User/UserService
# Create virtual environment & install requirements
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r ../requirements.txt
# Run migrations & start server on port 8011
python manage.py migrate
python manage.py runserver 8011
Step 3: Launch Allocation Service (Go)
cd backend1/Services/Service-Allocation-Go
# Copy or configure .env file# Ensure KAFKA_BROKER_URL=localhost:9092 and DATABASE_URL is set
go run main.go
# Starts Allocation Service on port 8012
Step 4: Launch RoomieAI Service (FastAPI)
cd backend1/Services/Service-Chatbot/RoomieAI
# Install requirements & set Gemini API Key
pip install -r ../requirements.txt
export GEMINI_API_KEY="your_gemini_api_key_here"# On Windows set GEMINI_API_KEY="..."# Run FastAPI app with uvicorn on port 8000
uvicorn main:app --reload --port 8000
Step 5: Launch Next.js Frontend
cd Frontend/hostelnet-frontend
# Install dependencies
npm install
# Start Next.js development server
npm run dev
Access the application in your browser at http://localhost:3000.
π€ Contributing & License
Distributed under the MIT License. Built for scalable hostel management and modern microservice architecture demonstrations.
About
SaaS for virtual room allotment system for hostels