feat: Initial commit of backend services and AGENTS.md

This commit is contained in:
William Valentin
2025-10-29 13:12:30 -07:00
commit 999d37babb
25 changed files with 3881 additions and 0 deletions

37
backend/models/Street.js Normal file
View File

@@ -0,0 +1,37 @@
const mongoose = require("mongoose");
const StreetSchema = new mongoose.Schema(
{
name: {
type: String,
required: true,
},
location: {
type: {
type: String,
enum: ["Point"],
required: true,
},
coordinates: {
type: [Number],
required: true,
},
},
adoptedBy: {
type: mongoose.Schema.Types.ObjectId,
ref: "User",
},
status: {
type: String,
enum: ["available", "adopted"],
default: "available",
},
},
{
timestamps: true,
},
);
StreetSchema.index({ location: "2dsphere" });
module.exports = mongoose.model("Street", StreetSchema);