Fullstack CRUD app for real estate management.
- Get latest config files and Auth0 instructions here: https://github.com/phu0n9/real-estate
- You must start both Kafka and Redis servers to run the application
- Install Redis to test the cache: https://redis.io/topics/quickstart
- Install Kafka to test the message queue and email: https://kafka.apache.org/quickstart
- Get the
application.yaml
andredisson.yaml
files and put them insrc/resources
- Get the
.env
file and put it in the root folder (same level asREADME.md
)
- HouseConfig now reads sample data from
data/gen
folder - House price range is now 200 - 1000 (USD/month)
- There is already a sample
house_1.json
file, but if you want to add more:
// Go to the Node project for house generation and install dependencies
cd src/main/java/eeet2582/realestatemgt/data/gen
npm i
// Modify the code, then run it
node index.js
- Search houses by sending POST request to
api/v1/houses/search/form
- Your search form may look like below (refer to model/house/HouseSearchForm)
- You must pass a list to searched status and house type, if you only want "available" pass a list of one string
- In addition to the search form, you may include params pageNo (starts at 1), pageSize and orderBy (sortBy removed)
- New search only sorts by price for now, if you need other variables tell me
{
"city": "Hanoi",
"district": "Ba Dinh",
"priceFrom": 200,
"priceTo": 1000,
"statusList": [
"available",
"reserved",
"rented"
],
"typeList": [
"apartment",
"serviced",
"street"
],
"query": ""
}
const typeList = ["apartment", "serviced", "street"];
const statusList = ["available", "reserved", "rented"];
- Rewrote Deposit, Meeting, Rental to link with AppUser and House
- Objects that contain custom classes (HouseLocation, LocalDate etc.) now @RequestBody a form of primitives
- Add to Meeting API
"/meetings/search/byDate/{range}"
("today", "week", "month") for current range - Add cache to all requests (Service level)
- Add sample data for all classes via a single file
BootstrapData
- Added get user by name with pagination
- edit kafka meeting
- added more data for front end to test
meeting
,payment
,user
,rental
,deposit
- Add (HouseLocation)
location
variable to House - Overhaul House search functions (now takes HouseSearchForm)
- Old search endpoints are still there, will delete after testing new one
- Change
getFilteredPayments
toget payments by userId
- Updated check auth0Id in Payments
- S3 delete does not work, only posting image to s3 works, error exception handled
- Change update house a little
- Change kafka server value
- Change auth0Id method to find respective userId in the database
- Change
delete House
andaddHouseImage
- Bugs: Update House
- Fixed Post request in default HTTP security
- Change query params in update and post in class
UserController
- remove
Generated.IDENTITY
inUSER
class
- Implement new cleaner Kafka version for serializer
- Add AWS key configuration
- application.yaml and back-end.env are changed, get it through here: https://docs.google.com/document/d/1LAGecNNdEr2tOjjm9eEe6AdkPSyLVQckuLSNnFtcTkQ/edit?usp=sharing
- Fix admin authentication, change .env file
- Added CORS in each controller
- Fix out of bound errors for House pagination
- Finished Oauth2 using Auth0 and comment out all controllers endpoint
- Go to front-end repository to get access token key
Bugs
: Post Users endpoint --> don't test this- Add separate
POST
andPUT
requests usingrequestBody
except for classMeeting
- All emails are now sent from eeet2582.realestatemgt@gmail.com
- Configuration (YAML) files are moved to .gitignore, ask backend team
- Reduce HOUSE_BATCH_SIZE to 200, queries feel faster now (cache limit is still 1000)
- Finish KafKa for booking a meeting
Note
: Turn off any anti-virus for sending email
- Finish Redis cache for House (get + pagination)
- Generate 1M rows for House (50K rows x 20 files)
- Basic cache for House (getOne, upsert, delete)
- House objects live 20 minutes after the first time queried
- Add house data to your local machine by:
- Download the zip file:
- Extract
/house
folder and put the folder inside/src/data
- House update and tested
- How to use Postman for House API: https://docs.google.com/document/d/1xA9813h3P2GNO4l_WNfn-KGI0xK8Q-DQnUJFLb_P2gs/edit?usp=sharing
- All endpoints for Deposit and Meeting work (get all, get one, get by userId or houseId, upsert, delete)
- Add more endpoints for Rental to be searched by userId or houseId
- Can update image in s3 by delete and upload more into the same folder
- Search/sort/pagination with name, type and price
- All endpoints for Rental and Payment work (get all, get one, get and upsert by rentalId, add, delete, update, sort & pagination)
- Weird POSTMAN issue: after posting a new payment, getting all payments will show an ID and not the new Payment object; querying the new payment by ID and Rental still work as expected
- All endpoints for AppUser work (get all, get one, add, delete, update, search, sort & pagination)
- All dates must use "yyyy-MM-dd" and all times must use "HH:mm"
- Some endpoints in UserController have been deleted, please check them out
- Added upload images using S3 bucket
- Change type of attribute
description
in class House - Link to image url: https://realestatemgt.s3.ap-southeast-1.amazonaws.com/dataset/1/1_bathroom.jpg
where 1 is the row id
- Pagination and sort with house and users, search by name with
house
and search by name/phone/email withuser
- Changed folder structure from class-based to function-based
It is not necessary to create a Service for each Entity. A Service can wire multiple Repositories. This reduces the number of Services and makes cascading (for example delete all dependent Rentals when a User is deleted) easier. "Important" entities (User, House, Rental) have their own Service classes.
- Added 5 rows of mock data for all classes, relationships included
- Wrote parsers to parse date and time from strings
- Wrote a parser to deserialize field "rental" (actually an ID string) in
payment.json
into nested Rental objects - Fixed infinite recursion when using GET requests for Rental and Payment due to them referencing each other
- Added manual cascading when deleting User and House: all dependent Deposits, Meetings, and Rentals will be deleted
- Added orphan removal when deleting Rental: all dependent Payments will be deleted