Property_Listing
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v11View latest version
This directory contains the backend API for the property listing website.
index.ts- Main entry point for the API/database- Database schema and queries/routes- API routes for properties and admin functionality
GET /api/properties- Get all propertiesGET /api/properties/with-images- Get all properties with their imagesGET /api/properties/:id- Get a specific property by IDGET /api/properties/:id/with-images- Get a specific property with its imagesGET /api/properties/category/:category- Get properties by categoryGET /api/properties/search- Search properties with filters
POST /api/admin/login- Admin loginPOST /api/admin/logout- Admin logoutPOST /api/admin/properties- Create a new propertyPUT /api/admin/properties/:id- Update a propertyDELETE /api/admin/properties/:id- Delete a propertyPOST /api/admin/properties/:id/images- Add an image to a propertyDELETE /api/admin/images/:id- Delete a property image
Admin routes are protected with a Bearer token authentication. The token is obtained by logging in with valid admin credentials.