Skip to content

bberik/myroof-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

MyRoof. Real Estate: Backend

This project is deployed at Vercel myroof.vercel.app. Backend Server is deployed at AWS EC2 instance using Nginx and Gunicorn

Link to the Frontend Repository

Project Overview

MyRoof is an intuitive web app where users can view and list real estate properties.

Project Architecture

This project is built by following MVC design pattern. (Model/Database: PostgreSQL, View/Frontend: React.js, Controller/Server: Django)

  • The communication between Model and Controller is based on Django's built in support for models and serializers.
  • The communication between Controller and View is via RESTful API endpoints.

Classes

image

API Endpoints

  • GET ("api/) : Properties List View
  • GET ("api/) : Property Detail View
  • POST ("api/create") : Property Create View
  • POST ("api/register") : Create User View
  • POST ("api/login") : Login User View
  • POST ("api/refresh") : Refresh Token Update View
  • GET ("api/my-properties") : Listed Properties View (Requires Authorization)
  • PUT ("api/update-profile") : Edit User View (Requires Authorization)
  • GET ("api/buildings") : Buildings List View

To be implemented

  • PUT ("api/add-fav) : Add Property to favorites View
  • PUT ("api/) : Property Edit View
  • DELETE ("api/") : Property DELETE View
  • POST ("api/contract) : Sign contract View
  • GET ("api/my-contracts") : Get previous and on-going contracts view

User Authorization

Implemented with "djangorestframework-simplejwt" package. Refresh tokens are blacklisted after being rotated.

Run on local environment

To run this project, follow steps below:

  1. Clone this repository
  2. Create virtual environment
  3. Install packages: pip install -r requirements.txt
  4. Create .env file with following code (database connection): NAME= PGUSER= PASSWORD= HOST= PORT=
  5. Run the server: python manage.py runserver