A production-grade PG discovery platform for students and working professionals.
Search, shortlist, chat, and book verified PG accommodations β no brokers, no hassle.
π Live Demo Β Β·Β π¦ Backend API Docs Β Β·Β π Deploy Your Own
| Category | Feature |
|---|---|
| π Discovery | Smart search by location, gender, price range with instant results |
| πΊοΈ Map View | Interactive Leaflet map with PG markers and routing |
| π¬ Live Chat | Real-time WebSocket chat between tenant and owner, with automated greetings |
| π Auth | JWT-based sessions, bcrypt password hashing, protected routes |
| π³ Payments | Razorpay checkout integration (test & live mode) |
| π Owner Portal | Hosts submit and manage listings from their own dashboard |
| π‘οΈ Admin Panel | Secure OTP-protected admin console for platform management |
| π£ Notifications | Custom animated toast system β no browser alerts |
| π¨ Premium UI | Glassmorphic design, Framer Motion animations, fully responsive |
| Tool | Purpose |
|---|---|
| React 19 + Vite 6 | Component framework + blazing fast build tool |
| Tailwind CSS v4 | Utility-first styling |
| Framer Motion | Page transitions & micro-animations |
| React Leaflet | Interactive maps |
| Lucide React | Icon system |
| Axios | HTTP client |
| Socket.io-client | WebSocket chat |
| Tool | Purpose |
|---|---|
| FastAPI | Async REST + WebSocket API |
| Uvicorn | ASGI production server |
| SQLAlchemy 2.0 | ORM & query builder |
| Pydantic v2 | Request/response validation |
| python-jose | JWT token creation & verification |
| bcrypt | Password hashing |
| Layer | Service |
|---|---|
| Frontend Hosting | Vercel (global CDN, auto HTTPS) |
| Backend Hosting | Render (free tier, auto-deploy) |
| Database | Neon PostgreSQL (serverless, free) |
| Gmail SMTP via App Password |
pg_dhundo/
βββ backend/ # Python FastAPI application
β βββ app/
β β βββ core/ # Config, security, JWT helpers
β β βββ models/ # SQLAlchemy database models
β β βββ routes/ # API routers
β β β βββ auth.py # Register, Login, Token refresh
β β β βββ pgs.py # PG listings CRUD + search
β β β βββ chat.py # WebSocket real-time chat
β β β βββ admin.py # Admin dashboard endpoints
β β βββ schemas/ # Pydantic request/response schemas
β β βββ database.py # DB engine & session factory
β β βββ main.py # App entry, middleware, CORS
β βββ requirements.txt
β βββ Procfile # Render / Railway start command
β βββ .env.example # Environment variable template
β βββ run.py # Local dev runner
β
βββ frontend/ # React + Vite SPA
β βββ src/
β β βββ components/
β β β βββ features/ # Domain components (listings, chat, auth)
β β β βββ ui/ # Shared UI primitives
β β βββ context/ # Auth, Toast, Notification providers
β β βββ pages/ # Route-level views
β β βββ App.jsx # Router & layout wrapper
β βββ vite.config.js # Build config + dev proxy
β βββ vercel.json # SPA rewrites + security headers
β βββ .env.example
β
βββ vercel.json # Root-level Vercel config
- Python 3.10+
- Node.js 18+
- PostgreSQL (local, or a free Neon cloud DB)
git clone https://github.com/YOUR_USERNAME/pg-dhundo.git
cd pg-dhundocd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# β Open .env and fill in DATABASE_URL, SECRET_KEY, etc.
# Start API server (auto-reloads on file changes)
python run.pyAPI will be live at http://localhost:8000
Swagger docs at http://localhost:8000/docs
# In a new terminal
cd frontend
npm install
# Configure environment
cp .env.example .env
# β VITE_API_URL=http://127.0.0.1:8000 (already set for local dev)
npm run devApp will be live at http://localhost:5173
The Vite dev server proxies all
/pgs,/auth,/chat,/wsrequests to the local backend β no CORS issues in dev.
Full step-by-step deployment guide β DEPLOYMENT.md
TL;DR free-tier setup:
Database β Neon.tech (free PostgreSQL)
Backend β Render.com (free web service, auto-deploys from GitHub)
Frontend β Vercel.com (free hosting, global CDN)
Required environment variables:
| Variable | Where | Description |
|---|---|---|
DATABASE_URL |
Render | Neon PostgreSQL connection string |
SECRET_KEY |
Render | 48-char random hex for JWT signing |
ALLOWED_ORIGINS |
Render | Your Vercel frontend URL |
ENVIRONMENT |
Render | production |
SMTP_USER |
Render | Gmail address for email notifications |
SMTP_PASSWORD |
Render | Gmail App Password (16 chars) |
VITE_API_URL |
Vercel | Your Render backend URL |
VITE_RAZORPAY_KEY |
Vercel | Razorpay public key ID |
DATABASE_URL=postgresql://user:pass@host/dbname?sslmode=require
SECRET_KEY=<generate: python -c "import secrets; print(secrets.token_hex(48))">
ALLOWED_ORIGINS=http://localhost:5173
ENVIRONMENT=development
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your@gmail.com
SMTP_PASSWORD=xxxx xxxx xxxx xxxxVITE_API_URL=http://127.0.0.1:8000
VITE_RAZORPAY_KEY=rzp_test_YOUR_KEY_HERE
β οΈ Never commit.envfiles. Both are in.gitignore. Use.env.exampleas the reference.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/auth/register |
β | Create user account |
POST |
/auth/login |
β | Login, returns JWT |
GET |
/pgs |
β | List/search PG listings |
GET |
/pgs/{id} |
β | Single PG details |
POST |
/pgs |
Owner | Create listing |
PUT |
/pgs/{id} |
Owner | Update listing |
WS |
/ws/chat/{room} |
JWT | Real-time chat |
GET |
/admin/listings |
Admin | All listings (moderation) |
Full interactive docs available at /docs (Swagger UI) and /redoc.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
Please follow conventional commits (feat:, fix:, chore:, docs:) for clean history.
This project is licensed under the MIT License β see LICENSE for details.
Built with β€οΈ for students and professionals tired of broker fees.