Connecting to CouchDB at http://localhost:5984
CouchDB Request: GET http://localhost:5984/ 
(node:244552) [MONGODB DRIVER] Warning: useNewUrlParser is a deprecated option: useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
(Use `node --trace-warnings ...` to show where the warning was created)
(node:244552) [MONGODB DRIVER] Warning: useUnifiedTopology is a deprecated option: useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
Server running on port 5000
MongoDB connection error: Error: querySrv ENOTFOUND _mongodb._tcp.cluster0.mongodb.net
    at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:294:17) {
  errno: undefined,
  code: 'ENOTFOUND',
  syscall: 'querySrv',
  hostname: '_mongodb._tcp.cluster0.mongodb.net'
}
CouchDB Response: 200 {"couchdb":"Welcome","version":"3.3.3","git_sha":"40afbcfc7","uuid":"264fe9859abb8fe6f7b9b28dacb51bbb","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}
CouchDB connection established
CouchDB Request: GET http://localhost:5984/adopt-a-street 
CouchDB Response: 200 {"instance_start_time":"1762038010","db_name":"adopt-a-street","purge_seq":"0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4","update_seq":"59-g1AAAACLeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyMpgTVXOBAuzJ5qlJaYaJ6HpwmJLIkFQP1S4G1p6UbJxqaZCKrjgLAD_6K3k","sizes":{"file":266641,"external":1077,"active":9347},"props":{},"doc_del_count":26,"doc_count":4,"disk_format_version":8,"compact_running":false,"cluster":{"q":2,"n":1,"w":1,"r":1}}
Database 'adopt-a-street' exists
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/users 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/users: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/streets 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/streets: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/tasks 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/tasks: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/posts 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/posts: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/comments 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/comments: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/events 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/events: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/reports 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/reports: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/badges 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/badges: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/transactions 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/transactions: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/rewards 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/rewards: Cannot read properties of null (reading '_rev')
CouchDB Request: GET http://localhost:5984/adopt-a-street/_design/general 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
Error creating design document _design/general: Cannot read properties of null (reading '_rev')
CouchDB service initialized successfully
CouchDB initialized
CouchDB Request: POST http://localhost:5984/adopt-a-street/_find Data: {"selector":{"type":"user","email":"test@example.com"},"limit":1}
CouchDB Response: 200 {"docs":[{"_id":"user_1762039120629_khw8hhnp1","_rev":"1-8dac2ab3dfe1b9f050fecb6cda8b9afd","type":"user","name":"Test User","email":"test@example.com","password":"$2b$10$GZCfAOv8plYptiMpYz.91enVdikmc4OsbXXsOLG0BNXyHYeCtgI62","isPremium":false,"points":0,"adoptedStreets":[],"completedTasks":[],"posts":[],"events":[],"profilePicture":null,"cloudinaryPublicId":null,"earnedBadges":[],"stats":{"streetsAdopted":0,"tasksCompleted":0,"postsCreated":0,"eventsParticipated":0,"badgesEarned":0},"createdAt":"2025-11-01T23:18:40.473Z","updatedAt":"2025-11-01T23:18:40.473Z"}],"bookmark":"g1AAAABoeJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYrLlBanFsUbmpsZGRhbGhoZmBlZxmdnlFtkZOQVGIL0cMD0EFSdBQD0AB3p","warning":"No matching index found, create an index to optimize query time."}
CouchDB Request: GET http://localhost:5984/adopt-a-street/street_1762039133583_vfrv0ca7n 
CouchDB Response: 200 {"_id":"street_1762039133583_vfrv0ca7n","_rev":"1-5b3f8ff4dae9e542c859a38e82829107","type":"street","name":"Test Street","location":{"type":"Point","coordinates":[-74.006,40.7128]},"adoptedBy":null,"status":"available","createdAt":"2025-11-01T23:18:53.583Z","updatedAt":"2025-11-01T23:18:53.583Z","stats":{"completedTasksCount":0,"reportsCount":0,"openReportsCount":0}}
CouchDB Request: GET http://localhost:5984/adopt-a-street/user_1762039120629_khw8hhnp1 
CouchDB Response: 200 {"_id":"user_1762039120629_khw8hhnp1","_rev":"1-8dac2ab3dfe1b9f050fecb6cda8b9afd","type":"user","name":"Test User","email":"test@example.com","password":"$2b$10$GZCfAOv8plYptiMpYz.91enVdikmc4OsbXXsOLG0BNXyHYeCtgI62","isPremium":false,"points":0,"adoptedStreets":[],"completedTasks":[],"posts":[],"events":[],"profilePicture":null,"cloudinaryPublicId":null,"earnedBadges":[],"stats":{"streetsAdopted":0,"tasksCompleted":0,"postsCreated":0,"eventsParticipated":0,"badgesEarned":0},"createdAt":"2025-11-01T23:18:40.473Z","updatedAt":"2025-11-01T23:18:40.473Z"}
CouchDB Request: PUT http://localhost:5984/adopt-a-street/street_1762039133583_vfrv0ca7n Data: {"_id":"street_1762039133583_vfrv0ca7n","_rev":"1-5b3f8ff4dae9e542c859a38e82829107","type":"street","name":"Test Street","location":{"type":"Point","coordinates":[-74.006,40.7128]},"adoptedBy":{"userId":"user_1762039120629_khw8hhnp1","name":"Test User","profilePicture":""},"status":"adopted","createdAt":"2025-11-01T23:18:53.583Z","updatedAt":"2025-11-01T23:19:53.127Z","stats":{"completedTasksCount":0,"reportsCount":0,"openReportsCount":0}}
CouchDB Response: 201 {"ok":true,"id":"street_1762039133583_vfrv0ca7n","rev":"2-dbea6670a71aa5c3b6f20e3f9648046c"}
CouchDB Request: PUT http://localhost:5984/adopt-a-street/user_1762039120629_khw8hhnp1 Data: {"_id":"user_1762039120629_khw8hhnp1","_rev":"1-8dac2ab3dfe1b9f050fecb6cda8b9afd","type":"user","name":"Test User","email":"test@example.com","password":"$2b$10$GZCfAOv8plYptiMpYz.91enVdikmc4OsbXXsOLG0BNXyHYeCtgI62","isPremium":false,"points":0,"adoptedStreets":["street_1762039133583_vfrv0ca7n"],"completedTasks":[],"posts":[],"events":[],"profilePicture":null,"cloudinaryPublicId":null,"earnedBadges":[],"stats":{"streetsAdopted":1,"tasksCompleted":0,"postsCreated":0,"eventsParticipated":0,"badgesEarned":0},"createdAt":"2025-11-01T23:18:40.473Z","updatedAt":"2025-11-01T23:19:53.142Z"}
CouchDB Response: 201 {"ok":true,"id":"user_1762039120629_khw8hhnp1","rev":"2-c0e6e301f3252c3e603fe6850c243450"}
CouchDB Request: GET http://localhost:5984/adopt-a-street/user_1762039120629_khw8hhnp1 
CouchDB Response: 200 {"_id":"user_1762039120629_khw8hhnp1","_rev":"2-c0e6e301f3252c3e603fe6850c243450","type":"user","name":"Test User","email":"test@example.com","password":"$2b$10$GZCfAOv8plYptiMpYz.91enVdikmc4OsbXXsOLG0BNXyHYeCtgI62","isPremium":false,"points":0,"adoptedStreets":["street_1762039133583_vfrv0ca7n"],"completedTasks":[],"posts":[],"events":[],"profilePicture":null,"cloudinaryPublicId":null,"earnedBadges":[],"stats":{"streetsAdopted":1,"tasksCompleted":0,"postsCreated":0,"eventsParticipated":0,"badgesEarned":0},"createdAt":"2025-11-01T23:18:40.473Z","updatedAt":"2025-11-01T23:19:53.142Z"}
CouchDB Request: GET http://localhost:5984/adopt-a-street/user_1762039120629_khw8hhnp1 
CouchDB Response: 200 {"_id":"user_1762039120629_khw8hhnp1","_rev":"2-c0e6e301f3252c3e603fe6850c243450","type":"user","name":"Test User","email":"test@example.com","password":"$2b$10$GZCfAOv8plYptiMpYz.91enVdikmc4OsbXXsOLG0BNXyHYeCtgI62","isPremium":false,"points":0,"adoptedStreets":["street_1762039133583_vfrv0ca7n"],"completedTasks":[],"posts":[],"events":[],"profilePicture":null,"cloudinaryPublicId":null,"earnedBadges":[],"stats":{"streetsAdopted":1,"tasksCompleted":0,"postsCreated":0,"eventsParticipated":0,"badgesEarned":0},"createdAt":"2025-11-01T23:18:40.473Z","updatedAt":"2025-11-01T23:19:53.142Z"}
CouchDB Request: PUT http://localhost:5984/adopt-a-street/user_1762039120629_khw8hhnp1 Data: {"_id":"user_1762039120629_khw8hhnp1","_rev":"2-c0e6e301f3252c3e603fe6850c243450","type":"user","name":"Test User","email":"test@example.com","password":"$2b$10$GZCfAOv8plYptiMpYz.91enVdikmc4OsbXXsOLG0BNXyHYeCtgI62","isPremium":false,"points":50,"adoptedStreets":["street_1762039133583_vfrv0ca7n"],"completedTasks":[],"posts":[],"events":[],"profilePicture":null,"cloudinaryPublicId":null,"earnedBadges":[],"stats":{"streetsAdopted":1,"tasksCompleted":0,"postsCreated":0,"eventsParticipated":0,"badgesEarned":0},"createdAt":"2025-11-01T23:18:40.473Z","updatedAt":"2025-11-01T23:19:53.142Z"}
CouchDB Response: 201 {"ok":true,"id":"user_1762039120629_khw8hhnp1","rev":"3-4342c65d766bb6a5d7bb35931cee3608"}
Creating document: {
  "_id": "transaction_1762039193187_9ny38pch6",
  "type": "admin_adjustment",
  "user": {
    "userId": "user_1762039120629_khw8hhnp1",
    "name": "Test User"
  },
  "amount": 50,
  "description": "Street adoption",
  "relatedEntity": {
    "entityType": "Street",
    "entityId": "street_1762039133583_vfrv0ca7n",
    "entityName": "Test Street"
  },
  "balanceAfter": 50,
  "createdAt": "2025-11-01T23:19:53.188Z"
}
CouchDB Request: POST http://localhost:5984/adopt-a-street Data: {"_id":"transaction_1762039193187_9ny38pch6","type":"admin_adjustment","user":{"userId":"user_1762039120629_khw8hhnp1","name":"Test User"},"amount":50,"description":"Street adoption","relatedEntity":{"entityType":"Street","entityId":"street_1762039133583_vfrv0ca7n","entityName":"Test Street"},"balanceAfter":50,"createdAt":"2025-11-01T23:19:53.188Z"}
CouchDB Response: 201 {"ok":true,"id":"transaction_1762039193187_9ny38pch6","rev":"1-c3007b5ececd4c65b194614aa355a782"}
CouchDB Request: GET http://localhost:5984/adopt-a-street/user_1762039120629_khw8hhnp1 
CouchDB Response: 200 {"_id":"user_1762039120629_khw8hhnp1","_rev":"3-4342c65d766bb6a5d7bb35931cee3608","type":"user","name":"Test User","email":"test@example.com","password":"$2b$10$GZCfAOv8plYptiMpYz.91enVdikmc4OsbXXsOLG0BNXyHYeCtgI62","isPremium":false,"points":50,"adoptedStreets":["street_1762039133583_vfrv0ca7n"],"completedTasks":[],"posts":[],"events":[],"profilePicture":null,"cloudinaryPublicId":null,"earnedBadges":[],"stats":{"streetsAdopted":1,"tasksCompleted":0,"postsCreated":0,"eventsParticipated":0,"badgesEarned":0},"createdAt":"2025-11-01T23:18:40.473Z","updatedAt":"2025-11-01T23:19:53.142Z"}
CouchDB Request: POST http://localhost:5984/adopt-a-street/_find Data: {"selector":{"type":"badge","isActive":true}}
CouchDB Response: 200 {"docs":[],"bookmark":"nil","warning":"No matching index found, create an index to optimize query time."}
CouchDB Request: GET http://localhost:5984/adopt-a-street/nearby 
CouchDB Error: 404 {"error":"not_found","reason":"missing"}
CouchDB Request: GET http://localhost:5984/ 
CouchDB Error: undefined undefined
CouchDB connection check failed: socket hang up
