carantes / property-finder

This is an educational side project, the goal is to replicate a property finder app like Blocket, Realtor, PropertyFinder.ae etc.
1 stars 0 forks source link

Property Finder Educational Side Project

Summary

This is an educational side project where I am trying to replicate a real world marketplace app, like Blocket, Realtor or PropertyFinder, where users can buy and sell used apartments. The idea is to create a very simple initial version of it and iterate over the time adding new features and use cases, documentating the process and enabling discussions about scalability, availability and performance.

Functional Requirements

Non-Functional

High-Level System Design

Alt text

API Design

Method Endpoint Access Description Return
POST /api/v1/accounts/register Public Register a new user account in the app 200, 4xx
POST /api/v1/auth/login Public Authenticate the user, create cookies and return user info 200, 401
GET /api/v1/auth/me Protected Validate session and get user info 200, 401
POST /api/v1/auth/logout Protected Logout existing the user, remove cookies 200, 401
POST /api/v1/properties Protected Create a new property 201, 4xx
GET /api/v1/properties/<id> Protected Return details from a single property 200, 404
PUT /api/v1/properties/<id> Protected Update one existing property 200, 404
DELETE /api/v1/properties/<id> Protected Delete one existing property 200, 404
GET /api/v1/properties/search?q=<keyword> Protected Full-text search on indexed properties 200

Database Schema

Alt text

User Authentication Flow

Alt text

Use cases

  1. User Sign-in in the app
  2. Authenticated user perform an API call to protected resources using a valid access token
  3. Authenticated user perform an API call to protected resources using an expired/invalid access token
  4. Authenticated user perform an API call with both Access and Refresh Token expired

Implementation details

The Monorepo

CI & CD

I am using Github Actions with a standard pipeline definition for NX monorepos. Only CI for now but I have plans to setup the CD at some point to deploy the app to staging and run E2E tests.

Alt text

Backend

Alt text

Frontend

TBD

Testing strategy

TBD

Deployment

TBD

Local Development

Start the app

You can run all services by starting the docker-compose

docker-compose up

Lint and Tests

nx run-many -t lint test