This is a mini project is build on mysql, express, react, nodejs (just to be familar with mysql connection and handling sql queries with express nodejs as backend and react for frontend along with mysql as our database).
This project is based on apartment renting system between owner and tenant, where in owner can lease his / her apartment to tenant on fixed rent with decided period.
- Owner:
- Owner will be able to fill building information - ranging from total floors and rough figure of number of flats on each floor.
- Owner will be able to assign flats / apartment to the desired tenant (registered on site).
- Owner will decide total rent amount, deadline, start date, etc.
- Owner will be able to update rent amount, deadline, and even remove tenants from his / her list once the tenant wishes to leave.
- Tenant:
- Once assigned a apartment, tenant will be able to view all necessary information about owner and building.
Requirements:
- mysql installed.
- nodejs and npm / yarn installed. (any LTS version of nodejs will do, preferably >= v10)
Steps (Make sure mysql is running on your system and installed LTS nodejs and npm / yarn version) :
- To download frontend and backend dependencies:
- cd into root project folder (where all src, public backend folder is present). //change directory
- run "npm install". //all project dependencies will be installed.
- To create database (side by side check db.js commented messages):
- cd into backend/config. //Change directory
- uncomment create database query lines and comment single line in the createConnection function = "database: "ApartmentRent""
- run "node db.js". //Database will be created.
- uncomment rest of the queries along with commented single line for createConnection in step 2.
- run "node db.js". //Required tables will be created.
- Once database and tables are created you can comment those database and table creation queries apart from connect function query and single line in createConnection function = "database: "ApartmentRent"" // Not a compusory step. And can skip if you would like.
- To start project:
- Just frontend:
- run "npm start".
- Just backend:
- run "npm run server".
- Both backend and frontend together: // recommended
- run "npm run dev". // if it results into nodemon / concurrently error - run "npm install nodemon concurrently --save".
- Just frontend: