A full stack real estate web application , whith NestJS, ReactJS and MongoDB
-
FE with react in Typescript
- tailwind
- login page with protected routes
- real authentication using credentials and jwt
- listing page with search bar (type in search bar a price/property type to filter the results on the screen)
- Infinite scroll as pagination
- auto logout after token expir
- zustand state management
-
BE with nestJS in Typescript
- authentication using JWT
- REST API routes and guarded routes
- Connection on online MondoDB
-
Mongo db
- local DB using docker
- remote DB with Atlas
- I used RESTApi instead of graphQL
- Adding load indicator while fetching data
- Better manage http request to avoid redundants requests
- I invest a lot of time searching some houses pictures and host them online somewhere, and DB is hosted in Atlas in free account (only one user connection allowed)
- Password is not encrypted, I passed it as clear text in the API, thing that I won't do in Prod level, this is a shortcut for the demo.
- No cache management and ahead of time pictures loading
- I did some shortcut in FE implementation in sync. between FE and BE (I would have use something most robust like Redux toolKit or TanStack Query for Production level project...)
- docker pull mongo:latest
- docker run -d --name mongodb_sps -p 27017:27017 mongo
- docker ps
- docker exec βit mongodb mongosh [can use container_id instead of mongodb]
- db.runCommand({hello:1})
- copy both json file into the container to allow populating the db
- docker cp ./mongo/users.sps.json mongodb:/tmp/users.sps.json [can use container_id instead of mongodb]
- docker cp ./mongo/properties.sps.json mongodb:/tmp/properties.sps.json [can use container_id instead of mongodb]
- docker exec -it mongodb bash [can use container_id instead of mongodb]
- mongoimport --db sps --collection users --file /tmp/users.sps.json --jsonArray
- mongoimport --db sps --collection properties --file /tmp/properties.sps.json --jsonArray
- I use the free plan of mongo atlas which allows only one IP, -->so please send me your IP<-- to allow connection to the DB
- make sure you run with node 18 and above
- git clone [email protected]:ah584d/sps-homework.git
- cd fe
- npm ci
- npm run dev
- open "http://localhost:5173/"
- cd be
- npm ci
- npm run start:dev
- POST http://localhost:3001/auth/login
- POST http://localhost:3001/property
- POST http://localhost:3001/user
- GET http://localhost:3001/user
- GET http://localhost:3001/user/:id
- GET http://localhost:3001/user/email/:email
- GET http://localhost:3001/property
- GET http://localhost:3001/property/:id>
- GET http://localhost:3001/property/user/:id/:pageIndex
- PUT http://localhost:3001/property/:id
- [email protected]/my_pass
- [email protected]/my_pass
- [email protected]/my_pass
- [email protected]/my_pass