Skip to content

prince-thind-private/cse445

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rental Management System

A website where the owner of a PG/Rent business can efficiently handle all activities related to rent mangement

How to run

From the root of the project type the following in your terminal:

1. npm run initialize
2. npm start

Database Seeding

MongoDB database can be seeded with the default test values using the script found in api/utils/seedDB.js. Alternatively, run the following from project root:

cd api
npm run seed

In order to delete all previous data and "reseed", then use:

cd api
npm run reseed

Default username and password for testing:

username: abc

password: 123

LINK

LINK

Technologies

  1. Vite - Bundler
  2. PropTypes - For React typing
  3. React - Main Frontend Framework
  4. Redux - state management
  5. React-Routes - frontend routing
  6. ExpressJS - backend rest API
  7. MongoDB/Mongoose - Database management
  8. MUI - For Icons and UI
  9. JWT - for authentication

Development Tools

  1. Redux Dev Tools: Firefox | Chrome

  2. React Dev Tools: Firefox | Chrome

  3. Nodemon: to restart api server whenever a change occurs.

  4. eslint: To check for linting errors.

  5. prettier: To check for styling errors.

  6. Husky: To ensure non-styled/linted does not get into a commmit.

  7. Concurrently: To run client and server code concurrently

Helpful Resources

  1. Git

    1. Basics (read atleast the first two chapters)
    2. Commits and Branches (interactive tutorial)
  2. Javascript

    1. The Modern JavaScript Tutorial
  3. JWT

    1. Intro Video (a short intro on what jwt really is)
    2. Implementation in NodeJS (a longer practical implementation of jwt stuff from the same author)

Client Side Structure:

Motivation for the client side structure comes from this Video. This structure can be found here.

API Side Structure

Most of the structure has been generated by the express-generator package:

npx express-generator --no-view api

an example of .env is also provided under ./api, a copy of this file on google drive for colloboration purposes can be requested from me Here. This has not been put in the github repository for obvious security reasons.

  • API specs are located in api/api-specs.xlsx

  • Format of all errors from server:

{
   "code":"code"
   "message":"message"
}

API entities:

  • user: The logged in user or owner of the PG

  • room: A room contains references to tenants and transactions

  • tenant: A tenant "occupies" a room and contains information like phone number, aadhar card etc.

  • transaction: A money transfer, transactions are bound to rooms and not to users. A positive balance: The tenant has to pay the PG owner.

Other Recommended Stuff

  1. Linux - So you don't face nodemon and other stupid windows errors.

  2. Latest npm and lts version of node: To ensure stuff doesn't break due to strange version errors.