Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,434 +1,337 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
-
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
- **
|
| 29 |
-
- Real-time
|
| 30 |
-
- User
|
| 31 |
-
-
|
| 32 |
-
-
|
| 33 |
-
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
-
-
|
| 42 |
-
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
###
|
| 120 |
-
```
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
}
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
-
|
| 276 |
-
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
**Scenario 4: Submit Feedback**
|
| 340 |
-
```bash
|
| 341 |
-
curl -X POST "http://localhost:8000/api/feedback" \
|
| 342 |
-
-H "Content-Type: application/json" \
|
| 343 |
-
-d '{
|
| 344 |
-
"booking_id": "BKG001",
|
| 345 |
-
"slot_id": "A1",
|
| 346 |
-
"rating": 5.0,
|
| 347 |
-
"comment": "Great spot!",
|
| 348 |
-
"user_satisfaction": true
|
| 349 |
-
}'
|
| 350 |
-
```
|
| 351 |
-
|
| 352 |
-
### Post-Production Testing
|
| 353 |
-
|
| 354 |
-
#### 1. Health Check
|
| 355 |
-
```bash
|
| 356 |
-
curl http://your-deployed-url.com/
|
| 357 |
-
```
|
| 358 |
-
|
| 359 |
-
#### 2. Load Testing
|
| 360 |
-
```bash
|
| 361 |
-
# Install hey (load testing tool)
|
| 362 |
-
# Run load test
|
| 363 |
-
hey -n 1000 -c 10 http://your-deployed-url.com/api/recommend-slots
|
| 364 |
-
```
|
| 365 |
-
|
| 366 |
-
#### 3. Monitor Performance
|
| 367 |
-
- Response times < 500ms
|
| 368 |
-
- Error rate < 1%
|
| 369 |
-
- Model accuracy > 80%
|
| 370 |
-
- Payment success rate > 98%
|
| 371 |
-
|
| 372 |
-
#### 4. Test Payment Integration
|
| 373 |
-
- Test with Razorpay test cards
|
| 374 |
-
- Verify payment webhooks
|
| 375 |
-
- Check payment verification
|
| 376 |
-
- Test refund functionality
|
| 377 |
-
|
| 378 |
-
## π Next Steps
|
| 379 |
-
|
| 380 |
-
### Phase 1: Core Implementation β
|
| 381 |
-
- [x] AI classification model with feedback learning
|
| 382 |
-
- [x] Razorpay payment integration (sandbox)
|
| 383 |
-
- [x] FastAPI backend with all endpoints
|
| 384 |
-
- [x] Comprehensive testing suite
|
| 385 |
-
- [x] Deployment configurations
|
| 386 |
-
|
| 387 |
-
### Phase 2: Testing & Validation (Current)
|
| 388 |
-
- [ ] Run local test suite (`python test_system.py`)
|
| 389 |
-
- [ ] Test all API endpoints with Postman/curl
|
| 390 |
-
- [ ] Verify payment flows with test credentials
|
| 391 |
-
- [ ] Load testing and performance optimization
|
| 392 |
-
- [ ] Security testing and validation
|
| 393 |
-
|
| 394 |
-
### Phase 3: Production Deployment
|
| 395 |
-
- [ ] Deploy backend to Render/Railway
|
| 396 |
-
- [ ] Configure production environment variables
|
| 397 |
-
- [ ] Set up monitoring and logging
|
| 398 |
-
- [ ] Configure auto-scaling
|
| 399 |
-
- [ ] Set up backup and disaster recovery
|
| 400 |
-
|
| 401 |
-
### Phase 4: Integration & Enhancement
|
| 402 |
-
- [ ] Connect to real parking database
|
| 403 |
-
- [ ] Integrate with external systems (to be handled by other teams)
|
| 404 |
-
- [ ] Add real-time slot updates
|
| 405 |
-
- [ ] Implement caching for performance
|
| 406 |
-
- [ ] Add analytics dashboard
|
| 407 |
-
|
| 408 |
-
### Phase 5: Continuous Improvement
|
| 409 |
-
- [ ] Collect production feedback data
|
| 410 |
-
- [ ] Retrain AI model with real data
|
| 411 |
-
- [ ] A/B test different recommendation algorithms
|
| 412 |
-
- [ ] Optimize model performance
|
| 413 |
-
- [ ] Add advanced features based on usage patterns
|
| 414 |
-
|
| 415 |
-
## π€ Integration Points
|
| 416 |
-
|
| 417 |
-
This module provides REST APIs that can be integrated with:
|
| 418 |
-
- **Frontend applications** (Web/Mobile)
|
| 419 |
-
- **WhatsApp/Telegram bots** (handled by other teams)
|
| 420 |
-
- **Admin dashboards**
|
| 421 |
-
- **IoT parking sensors**
|
| 422 |
-
- **Third-party booking systems**
|
| 423 |
-
|
| 424 |
-
## π License
|
| 425 |
-
|
| 426 |
-
MIT License
|
| 427 |
-
|
| 428 |
-
## π§ Support
|
| 429 |
-
|
| 430 |
-
For issues and questions, please create an issue in the repository.
|
| 431 |
-
|
| 432 |
-
---
|
| 433 |
-
|
| 434 |
-
**AI + Payment Module** | Smart Parking System v1.0
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Smart Parking System
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
license: mit
|
| 9 |
+
app_port: 7860
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# π
ΏοΈ Smart Parking System - AI-Powered Parking Slot Recommendation
|
| 13 |
+
|
| 14 |
+
[](https://huggingface.co/spaces/suryatejabatchu008/code-strom)
|
| 15 |
+
[](https://fastapi.tiangolo.com)
|
| 16 |
+
[](https://www.python.org/downloads/)
|
| 17 |
+
|
| 18 |
+
An intelligent parking management system that uses AI to recommend the best parking slots based on proximity, price, user feedback, and popularity.
|
| 19 |
+
|
| 20 |
+
## π Live Demo
|
| 21 |
+
|
| 22 |
+
**API Endpoint:** https://suryatejabatchu008-code-strom.hf.space
|
| 23 |
+
|
| 24 |
+
**Interactive Docs:** https://suryatejabatchu008-code-strom.hf.space/docs
|
| 25 |
+
|
| 26 |
+
## β¨ Features
|
| 27 |
+
|
| 28 |
+
- π€ **AI-Powered Recommendations** - RandomForest ML model for optimal slot selection
|
| 29 |
+
- π **Real-time Location** - GPS-based proximity scoring
|
| 30 |
+
- β **User Feedback** - Integrated rating system (0-5 stars)
|
| 31 |
+
- π³ **Razorpay Integration** - Secure payment processing
|
| 32 |
+
- π **Smart Analytics** - Popularity and availability tracking
|
| 33 |
+
- π **Live Database** - Real-time slot availability updates
|
| 34 |
+
|
| 35 |
+
## π― How It Works
|
| 36 |
+
|
| 37 |
+
1. **User sends GPS location** β System fetches nearby parking lots
|
| 38 |
+
2. **AI Model analyzes 5 features:**
|
| 39 |
+
- Proximity (40% weight)
|
| 40 |
+
- User Ratings (30% weight)
|
| 41 |
+
- Popularity (20% weight)
|
| 42 |
+
- Availability (10% weight)
|
| 43 |
+
- Price Factor
|
| 44 |
+
3. **Returns top recommendations** β Sorted by weighted score
|
| 45 |
+
4. **Secure booking & payment** β Razorpay integration
|
| 46 |
+
|
| 47 |
+
## π‘ API Endpoints
|
| 48 |
+
|
| 49 |
+
### π Health Check
|
| 50 |
+
```bash
|
| 51 |
+
curl https://suryatejabatchu008-code-strom.hf.space/
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
### π― Get Slot Recommendations
|
| 55 |
+
```bash
|
| 56 |
+
curl -X POST "https://suryatejabatchu008-code-strom.hf.space/api/recommend-slots" \
|
| 57 |
+
-H "Content-Type: application/json" \
|
| 58 |
+
-d '{
|
| 59 |
+
"user_location": {
|
| 60 |
+
"latitude": 16.4645659,
|
| 61 |
+
"longitude": 80.5076208
|
| 62 |
+
},
|
| 63 |
+
"vehicle_type": "4-wheeler",
|
| 64 |
+
"top_k": 5
|
| 65 |
+
}'
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
**Response:**
|
| 69 |
+
```json
|
| 70 |
+
{
|
| 71 |
+
"recommendations": [
|
| 72 |
+
{
|
| 73 |
+
"slot_id": "A1-1",
|
| 74 |
+
"db_slot_id": 1,
|
| 75 |
+
"lot_name": "A1",
|
| 76 |
+
"location": "SRM University AP Parking lot background",
|
| 77 |
+
"distance_km": 0.15,
|
| 78 |
+
"vehicle_type": "4-wheeler",
|
| 79 |
+
"hourly_rate": 60.0,
|
| 80 |
+
"avg_feedback": 4.5,
|
| 81 |
+
"popularity_score": 0.75,
|
| 82 |
+
"recommendation_score": 0.89,
|
| 83 |
+
"coordinates": {
|
| 84 |
+
"latitude": 16.4645659,
|
| 85 |
+
"longitude": 80.5076208
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
],
|
| 89 |
+
"total_available": 1,
|
| 90 |
+
"user_location": {
|
| 91 |
+
"latitude": 16.4645659,
|
| 92 |
+
"longitude": 80.5076208
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
### π³ Create Payment Order
|
| 98 |
+
```bash
|
| 99 |
+
curl -X POST "https://suryatejabatchu008-code-strom.hf.space/api/payment/create-order" \
|
| 100 |
+
-H "Content-Type: application/json" \
|
| 101 |
+
-d '{
|
| 102 |
+
"booking_uid": "ABC12345",
|
| 103 |
+
"amount": 120.00,
|
| 104 |
+
"currency": "INR"
|
| 105 |
+
}'
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
### β Submit Feedback
|
| 109 |
+
```bash
|
| 110 |
+
curl -X POST "https://suryatejabatchu008-code-strom.hf.space/api/feedback" \
|
| 111 |
+
-H "Content-Type: application/json" \
|
| 112 |
+
-d '{
|
| 113 |
+
"booking_uid": "ABC12345",
|
| 114 |
+
"rating": 5,
|
| 115 |
+
"comment": "Great parking experience!"
|
| 116 |
+
}'
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
### π Get Booking Details
|
| 120 |
+
```bash
|
| 121 |
+
curl "https://suryatejabatchu008-code-strom.hf.space/api/booking/ABC12345"
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
### π Retrain AI Model
|
| 125 |
+
```bash
|
| 126 |
+
curl -X POST "https://suryatejabatchu008-code-strom.hf.space/api/retrain-model"
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
## π§ͺ Testing with Python
|
| 130 |
+
|
| 131 |
+
```python
|
| 132 |
+
import requests
|
| 133 |
+
|
| 134 |
+
# Base URL
|
| 135 |
+
BASE_URL = "https://suryatejabatchu008-code-strom.hf.space"
|
| 136 |
+
|
| 137 |
+
# Get recommendations
|
| 138 |
+
response = requests.post(
|
| 139 |
+
f"{BASE_URL}/api/recommend-slots",
|
| 140 |
+
json={
|
| 141 |
+
"user_location": {
|
| 142 |
+
"latitude": 16.4645659,
|
| 143 |
+
"longitude": 80.5076208
|
| 144 |
+
},
|
| 145 |
+
"vehicle_type": "4-wheeler",
|
| 146 |
+
"top_k": 5
|
| 147 |
+
}
|
| 148 |
+
)
|
| 149 |
+
|
| 150 |
+
recommendations = response.json()
|
| 151 |
+
print(f"Found {len(recommendations['recommendations'])} slots")
|
| 152 |
+
|
| 153 |
+
# Book a slot (first create booking via database API)
|
| 154 |
+
booking_uid = "ABC12345" # From your database
|
| 155 |
+
|
| 156 |
+
# Create payment
|
| 157 |
+
payment_response = requests.post(
|
| 158 |
+
f"{BASE_URL}/api/payment/create-order",
|
| 159 |
+
json={
|
| 160 |
+
"booking_uid": booking_uid,
|
| 161 |
+
"amount": 120.00,
|
| 162 |
+
"currency": "INR"
|
| 163 |
+
}
|
| 164 |
+
)
|
| 165 |
+
|
| 166 |
+
payment_data = payment_response.json()
|
| 167 |
+
print(f"Payment Order ID: {payment_data['order_id']}")
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
## π Testing with JavaScript
|
| 171 |
+
|
| 172 |
+
```javascript
|
| 173 |
+
// Get slot recommendations
|
| 174 |
+
fetch('https://suryatejabatchu008-code-strom.hf.space/api/recommend-slots', {
|
| 175 |
+
method: 'POST',
|
| 176 |
+
headers: {
|
| 177 |
+
'Content-Type': 'application/json',
|
| 178 |
+
},
|
| 179 |
+
body: JSON.stringify({
|
| 180 |
+
user_location: {
|
| 181 |
+
latitude: 16.4645659,
|
| 182 |
+
longitude: 80.5076208
|
| 183 |
+
},
|
| 184 |
+
vehicle_type: '4-wheeler',
|
| 185 |
+
top_k: 5
|
| 186 |
+
})
|
| 187 |
+
})
|
| 188 |
+
.then(response => response.json())
|
| 189 |
+
.then(data => {
|
| 190 |
+
console.log('Recommendations:', data.recommendations);
|
| 191 |
+
console.log('Total available slots:', data.total_available);
|
| 192 |
+
})
|
| 193 |
+
.catch(error => console.error('Error:', error));
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
## ποΈ Architecture
|
| 197 |
+
|
| 198 |
+
```
|
| 199 |
+
βββββββββββββββββββ
|
| 200 |
+
β User Device β
|
| 201 |
+
β (GPS Location) β
|
| 202 |
+
ββββββββββ¬βββββββββ
|
| 203 |
+
β
|
| 204 |
+
βΌ
|
| 205 |
+
βββββββββββββββββββββββββββββββββββββββ
|
| 206 |
+
β FastAPI Backend (HF Space) β
|
| 207 |
+
β βββββββββββββββββββββββββββββββ β
|
| 208 |
+
β β AI Model (RandomForest) β β
|
| 209 |
+
β β - Proximity Scoring β β
|
| 210 |
+
β β - Feedback Analysis β β
|
| 211 |
+
β β - Popularity Tracking β β
|
| 212 |
+
β βββββββββββββββββββββββββββββββ β
|
| 213 |
+
β β
|
| 214 |
+
β βββββββββββββββββββββββββββββββ β
|
| 215 |
+
β β Payment Service β β
|
| 216 |
+
β β - Razorpay Integration β β
|
| 217 |
+
β βββββββββββββββββββββββββββββββ β
|
| 218 |
+
βββββββββββββ¬ββββββββββββββββββββββββββ
|
| 219 |
+
β
|
| 220 |
+
βΌ
|
| 221 |
+
βββββββββββββββββββββββββββββββββββββββ
|
| 222 |
+
β Database API (PHP Backend) β
|
| 223 |
+
β - Parking Slots Management β
|
| 224 |
+
β - Booking System β
|
| 225 |
+
β - User Management β
|
| 226 |
+
β - Payment Status Tracking β
|
| 227 |
+
βββββββββββββββββββββββββββββββββββββββ
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
## π οΈ Technology Stack
|
| 231 |
+
|
| 232 |
+
- **Backend:** FastAPI (Python 3.10)
|
| 233 |
+
- **AI/ML:** scikit-learn (RandomForest)
|
| 234 |
+
- **Payment:** Razorpay API
|
| 235 |
+
- **Database:** MySQL (via REST API)
|
| 236 |
+
- **Deployment:** Docker on Hugging Face Spaces
|
| 237 |
+
- **Web Server:** Uvicorn
|
| 238 |
+
|
| 239 |
+
## π AI Model Features
|
| 240 |
+
|
| 241 |
+
The AI model uses 5 weighted features to recommend parking slots:
|
| 242 |
+
|
| 243 |
+
| Feature | Weight | Description |
|
| 244 |
+
|---------|--------|-------------|
|
| 245 |
+
| **Proximity** | 40% | Distance from user's current location |
|
| 246 |
+
| **Feedback** | 30% | Average user rating (0-5 stars) |
|
| 247 |
+
| **Popularity** | 20% | Historical booking frequency |
|
| 248 |
+
| **Availability** | 10% | Real-time slot availability |
|
| 249 |
+
| **Price** | Factor | Hourly rate consideration |
|
| 250 |
+
|
| 251 |
+
## π Environment Variables
|
| 252 |
+
|
| 253 |
+
The following environment variables are configured as Hugging Face Spaces secrets:
|
| 254 |
+
|
| 255 |
+
```bash
|
| 256 |
+
RAZORPAY_KEY_ID=rzp_test_RYlqJbc24Sl6jz
|
| 257 |
+
RAZORPAY_KEY_SECRET=bghQe0L7iort9vmqb6Jlf8Ec
|
| 258 |
+
API_HOST=0.0.0.0
|
| 259 |
+
API_PORT=7860
|
| 260 |
+
ENVIRONMENT=production
|
| 261 |
+
DEBUG=False
|
| 262 |
+
```
|
| 263 |
+
|
| 264 |
+
## π± Current Deployment
|
| 265 |
+
|
| 266 |
+
- **Parking Lots:** 1 (A1 at SRM University AP)
|
| 267 |
+
- **Available Slots:** Real-time availability
|
| 268 |
+
- **Payment Mode:** Test mode (Razorpay)
|
| 269 |
+
- **Database:** https://aadarshsenapati.in/api/api.php
|
| 270 |
+
|
| 271 |
+
## π§ͺ Test Credentials
|
| 272 |
+
|
| 273 |
+
For testing payments:
|
| 274 |
+
|
| 275 |
+
- **Test Card:** 4111 1111 1111 1111
|
| 276 |
+
- **Expiry:** Any future date
|
| 277 |
+
- **CVV:** Any 3 digits
|
| 278 |
+
- **OTP:** 1234 (for test mode)
|
| 279 |
+
|
| 280 |
+
## π Performance Metrics
|
| 281 |
+
|
| 282 |
+
- **Response Time:** < 500ms for recommendations
|
| 283 |
+
- **AI Inference:** < 100ms
|
| 284 |
+
- **Database Queries:** < 200ms
|
| 285 |
+
- **Uptime:** 99.9% (Hugging Face Spaces)
|
| 286 |
+
|
| 287 |
+
## π Troubleshooting
|
| 288 |
+
|
| 289 |
+
### API Not Responding
|
| 290 |
+
```bash
|
| 291 |
+
# Check status
|
| 292 |
+
curl https://suryatejabatchu008-code-strom.hf.space/
|
| 293 |
+
|
| 294 |
+
# Expected response:
|
| 295 |
+
# {"message": "Smart Parking API is running!", "status": "healthy"}
|
| 296 |
+
```
|
| 297 |
+
|
| 298 |
+
### No Recommendations Returned
|
| 299 |
+
- Check if slots are available in database
|
| 300 |
+
- Verify GPS coordinates are valid
|
| 301 |
+
- Ensure vehicle type matches available slots
|
| 302 |
+
|
| 303 |
+
### Payment Errors
|
| 304 |
+
- Verify Razorpay credentials in Spaces secrets
|
| 305 |
+
- Check if booking_uid exists
|
| 306 |
+
- Ensure amount is > 0
|
| 307 |
+
|
| 308 |
+
## π API Support
|
| 309 |
+
|
| 310 |
+
For API issues or questions:
|
| 311 |
+
- Check the [Interactive API Docs](https://suryatejabatchu008-code-strom.hf.space/docs)
|
| 312 |
+
- View example requests in the `/docs` endpoint
|
| 313 |
+
- Test endpoints directly in the Swagger UI
|
| 314 |
+
|
| 315 |
+
## π Updates & Maintenance
|
| 316 |
+
|
| 317 |
+
The system automatically:
|
| 318 |
+
- β
Retrains AI model when feedback is submitted
|
| 319 |
+
- β
Updates slot availability in real-time
|
| 320 |
+
- β
Syncs with database every request
|
| 321 |
+
- β
Processes payments securely via Razorpay
|
| 322 |
+
|
| 323 |
+
## π License
|
| 324 |
+
|
| 325 |
+
MIT License - Feel free to use this project for learning and development!
|
| 326 |
+
|
| 327 |
+
## π¨βπ» Developer
|
| 328 |
+
|
| 329 |
+
Developed by **Surya Teja Batchu** ([@suryatejabatchu008](https://huggingface.co/suryatejabatchu008))
|
| 330 |
+
|
| 331 |
+
---
|
| 332 |
+
|
| 333 |
+
**π Deployed on Hugging Face Spaces**
|
| 334 |
+
|
| 335 |
+
Visit: [https://suryatejabatchu008-code-strom.hf.space](https://suryatejabatchu008-code-strom.hf.space)
|
| 336 |
+
|
| 337 |
+
Interactive Docs: [https://suryatejabatchu008-code-strom.hf.space/docs](https://suryatejabatchu008-code-strom.hf.space/docs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|