Basic real estate property listing UI with add, edit, and delete.
- Node.js 18+ and npm
- Backend API running (ASP.NET Core) on
https://localhost:7014
-
Install dependencies:
npm install
-
Start the dev server:
npm start
-
Open
http://localhost:3000in your browser.
-
The API base URL is defined in
src/api.jsasAPI_BASE. -
If your backend runs on a different port/host, update it there. Example:
// src/api.js const API_BASE = 'https://localhost:7014/api';
- List properties with price/bed/bath and description
- Add new property
- Edit existing property
- Delete property
src/App.js: main page wiring list + formsrc/api.js: API client wrappers (fetch, create, update, delete)src/components/PropertyList.js: list viewsrc/components/PropertyForm.js: add/edit form
- CORS enabled for
http://localhost:3000 - Endpoints:
GET /api/propertiesGET /api/properties/{id}POST /api/propertiesPUT /api/properties/{id}DELETE /api/properties/{id}
-
SSL errors when calling the API:
-
Trust the ASP.NET Core dev certificate:
dotnet dev-certs https --trust
-
Or open
https://localhost:7014/swaggeronce and accept the cert.
-
-
CORS error:
- Ensure the backend allows origin
http://localhost:3000in CORS policy.
- Ensure the backend allows origin
-
API not reachable:
- Verify the API port matches
API_BASEinsrc/api.js.
- Verify the API port matches
Use the provided backend script to create the database, table, and seed sample data.
-
Confirm the database name in backend
appsettings.json:{ "ConnectionStrings": { "DefaultConnection": "Server=DESKTOP-JF8AB6O;Database=PropertyListDemoDb;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" } }The script uses
PropertyListDemoDbautomatically. -
Run the script using SQL Server tools (SSMS or sqlcmd):
-
SSMS: open and execute
PropertyListDemo/Scripts/seed_properties.sql. -
sqlcmd:
sqlcmd -S DESKTOP-JF8AB6O -E -i "..\\PropertyListDemo\\Scripts\\seed_properties.sql"
Notes:
-Sshould match your SQL Server instance.-Euses Windows auth; use-U user -P passfor SQL auth.
-
-
Verify data:
USE PropertyListDemoDb; SELECT TOP 10 * FROM dbo.Properties;
-
Start backend and frontend after seeding. The UI will display the seeded properties.
npm start: start dev servernpm run build: production build tobuild/npm test: run tests