Skip to content

Commit

Permalink
Merge pull request #20 from GSG-G10/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Mu7ammadAbed authored Oct 28, 2021
2 parents 3b178fb + 98fdfa8 commit badf1bd
Show file tree
Hide file tree
Showing 46 changed files with 732 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"airbnb-base"
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.env
package-lock.json
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"git.ignoreLimitWarning": true,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
91 changes: 90 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,90 @@
# Housy
# Real Estate
Real Estate is an App that facilitates to access and rent or buy available homes.

## Team Members :busts_in_silhouette::-
1. Mohammed haroon
2. MOhammed salah
3. Ameera Abed Alnaser Khalil
4. Elham Fadel



# Main problem 🌚:
The problem is that in popular areas a person should go to the site and see the house or the real estate that he want to buy and he should employ a broker to find him a house and this process costs a lot of time and effort.

# Solution 💡:
A site that is a real estate broker to facilitate communication and negotiation between the seller and the buyer, saving them time and effort on the buyer by providing images, real price and more details, place, so he will know which place will select.

# User stories 📖:

* ##### AS a USER I can :
1. see a group of houses or real estate with more details (Home page).
4. see specific information about any house.
5. add houses to my favorite list.
6. AS a USER want to search by different locations, prices, and the number of rooms in the house

* #### AS a agent I can :
1. Sign up for the app.
2. login in to the app.
3. able to hosting the house or room.
4. need control panel to manage my houses.

* #### AS a admin I can :
1. approve estate
2. delete any estate
3. delete user
4. add anouter admin



# User Journey ✈️:

* As a user, I can see all available houses that can rent, search to find houses, appointment booking and I can add any liked house to my favorite list from my favorite list, inside my profile I have my information and control panel for my own houses available to rent.


* As a host ,I can see all my houses and add new house to renting ,i can edit my profile and my houses information .




# Prototype
![](https://i.imgur.com/8FiBXmn.png)


# DB schema

![](https://i.imgur.com/sF5ZjzT.png)

## Technologies 💻:-
**BackEnd**: Node JS & Express JS.
**FrontEnd**: React JS,Material Ui.
**Database**: PostgreSQL.

## How to Launch App Locally :
* clone repo:
```git clone https://github.com/GSG-G10/Housy.git && cd Housy```
* Run `npm i` to install the packages for the app as general.
* Run `cd client` and `npm i` to install the packages for the client.


### Database Setup 📋
* Make sure you have installed PostgreSQL and psql
```
CREATE DATABASE {database name};
CREATE USER {user name} WITH superuser password {password}
ALTER DATABASE {database name} OWNER TO {user name};
```
* Run the following command in the database pgcli terminal
`\i server/database/config/build.sql` .


### Start the App :-


To run Server, In your terminal Type:

* `npm run dev` then you should be able to go to [localhost](http://localhost:5000/)
To run client-side, In your terminal Type:
* `cd client` => `npm start` then you will be able to run [localhost](http://localhost:3000/)
Now you can view the app live in the Browser!

26 changes: 26 additions & 0 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"root": true,
"extends": [
"plugin:react/recommended",
"airbnb",
"plugin:react/jsx-runtime"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
}
}
23 changes: 23 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
package-lock.json
# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
56 changes: 56 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "client",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:5000",
"dependencies": {
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@mui/material": "^5.0.4",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"axios": "^0.23.0",
"eslint-config-react-app": "^6.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.4.1"
}
}
Binary file added client/public/favicon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Housy</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

</body>
</html>
Binary file added client/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions client/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
8 changes: 8 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function App() {
return (
<div className="App" />

);
}

export default App;
Empty file added client/src/components/index.js
Empty file.
5 changes: 5 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
12 changes: 12 additions & 0 deletions client/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);

Empty file added client/src/pages/index.js
Empty file.
43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "housy",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "cross-env NODE_ENV=production node server",
"dev": "cross-env NODE_ENV=development nodemon server",
"test": "cross-env NODE_ENV=test jest",
"build:db": "cross-env NODE_ENV=development node server/database/config"
},
"repository": {
"type": "git",
"url": "git+https://github.com/GSG-G10/Housy.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/GSG-G10/Housy/issues"
},
"homepage": "https://github.com/GSG-G10/Housy#readme",
"dependencies": {
"bcrypt": "^5.0.1",
"compression": "^1.7.4",
"cookie-parser": "^1.4.5",
"cross-env": "^7.0.3",
"env2": "^2.2.2",
"express": "^4.17.1",
"joi": "^17.4.2",
"jsonwebtoken": "^8.5.1",
"pg": "^8.7.1"
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.25.2",
"jest": "^27.3.1",
"nodemon": "^2.0.14",
"pre-commit": "^1.2.2",
"supertest": "^6.1.6"
}
}
30 changes: 30 additions & 0 deletions server/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const express = require('express');
const { join } = require('path');
const compression = require('compression');
const cookieParser = require('cookie-parser');
const { notFoundError, serverError } = require('./controllers/errors');
const router = require('./routes');

const { env: { PORT, NODE_ENV } } = process;

const app = express();

app.set('port', PORT || 5000);

app.use(express.urlencoded({ extended: false }));
app.use(express.json());
app.use(compression());
app.use(cookieParser());
app.disable('x-powered-by');
app.use('/api/v1/', router);

if (NODE_ENV === 'production') {
app.use(express.static(join(__dirname, '..', 'client', 'build')));
app.get('*', (req, res) => {
res.sendFile(join(__dirname, '..', 'client', 'build', 'index.html'));
});
}
router.use(notFoundError);
router.use(serverError);

module.exports = app;
Empty file.
4 changes: 4 additions & 0 deletions server/controllers/errors/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const notFoundError = require('./notFoundError');
const serverError = require('./serverError');

module.exports = { serverError, notFoundError };
6 changes: 6 additions & 0 deletions server/controllers/errors/notFoundError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable no-unused-vars */
const notFoundError = (req, res, next) => {
res.status(404).json({ message: 'Page Not Found' });
};

module.exports = notFoundError;
Loading

0 comments on commit badf1bd

Please sign in to comment.