Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #20

Merged
merged 68 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
64cac6e
create file sturcture
muhammadharoun Oct 25, 2021
f39aa41
remove env2 module & unnecessary comments & change title & remove REA…
muhammadharoun Oct 25, 2021
0b3fdac
Merge pull request #19 from GSG-G10/8-file-structure
ElhamFadel Oct 25, 2021
6dbff3a
create server express and remove .vscode from env #5
Oct 25, 2021
053aedd
create tables housy database #4
ElhamFadel Oct 25, 2021
4f04711
connection database & change scripts in pakage json #4
ElhamFadel Oct 25, 2021
9aabdc5
build file for test proccess #8
ElhamFadel Oct 25, 2021
6f74017
prepare build file #4
ElhamFadel Oct 25, 2021
ffb62ec
create readme
muhammadharoun Oct 25, 2021
6e95003
change user stories
muhammadharoun Oct 25, 2021
1b5cda9
remove unnessary code
ElhamFadel Oct 25, 2021
916d6df
authentication tokent & create it #9
ElhamFadel Oct 25, 2021
836cda1
get info user from req object #9
ElhamFadel Oct 25, 2021
dc4e28a
remove location from agent with rename entites
ElhamFadel Oct 25, 2021
57da083
Merge pull request #22 from GSG-G10/4-setup-database
Mu7ammadAbed Oct 25, 2021
0ddb4c0
Merge pull request #23 from GSG-G10/3-readme
Mu7ammadAbed Oct 25, 2021
c01fe18
creat-fack-data
ameera-abed Oct 25, 2021
b4dd3ce
handle error 404, 500 , and set setting for production #5
Oct 25, 2021
9205054
remove line comment
ElhamFadel Oct 26, 2021
3dd27b5
status for create #9
ElhamFadel Oct 26, 2021
bb096c2
resolve error #5
ElhamFadel Oct 26, 2021
2ca5d96
Merge pull request #21 from GSG-G10/5-create-server
Mu7ammadAbed Oct 26, 2021
65575af
update-fack-data
ameera-abed Oct 26, 2021
3049131
GET | /users/:userId/estates
muhammadharoun Oct 26, 2021
53fd034
Merge branch 'development' of https://github.com/GSG-G10/Housy into 1…
muhammadharoun Oct 26, 2021
d1017e2
update-fack-data
ameera-abed Oct 26, 2021
7f41bf3
sign
ElhamFadel Oct 26, 2021
0afc69e
update-fack-data
ameera-abed Oct 26, 2021
dab02e4
Update server/database/config/imagesFackData.sql
Mu7ammadAbed Oct 26, 2021
02cca9b
authentication function #9
ElhamFadel Oct 26, 2021
4650057
Merge pull request #26 from GSG-G10/fackData
Mu7ammadAbed Oct 26, 2021
9078e63
remove sign code #9
ElhamFadel Oct 26, 2021
d282559
Merge branch 'development' of https://github.com/GSG-G10/Housy into d…
ElhamFadel Oct 26, 2021
3a04dba
create end point to get all users #17
Oct 26, 2021
44a0802
edit promies to async await #17
Oct 26, 2021
2818cea
create end point to log out #16
Oct 26, 2021
4810039
Merge branch 'development' of https://github.com/GSG-G10/Housy into 1…
muhammadharoun Oct 27, 2021
57615cf
edit require Router #16
Oct 27, 2021
a359212
prepar setting data base test and testing for endpoint /users #17
Oct 27, 2021
c391398
fix function
muhammadharoun Oct 27, 2021
5fb3b58
create test
muhammadharoun Oct 27, 2021
21930ac
change test to async/await #17
Oct 27, 2021
68b7707
convert test to async await
muhammadharoun Oct 27, 2021
ae9944e
Merge pull request #29 from GSG-G10/17-get-users
Mu7ammadAbed Oct 27, 2021
15f0d50
move jest to devDependencies
muhammadharoun Oct 27, 2021
48e558c
Merge branch 'development' of https://github.com/GSG-G10/Housy into 1…
muhammadharoun Oct 27, 2021
cfc8e2c
Merge branch 'development' of github.com:GSG-G10/Housy into 14-userId…
Mu7ammadAbed Oct 27, 2021
08fa33f
remove cross module, edit project name, edit test and remove unnecess…
Mu7ammadAbed Oct 27, 2021
671607c
Merge branch 'development' of github.com:GSG-G10/Housy into 16-logout
Mu7ammadAbed Oct 27, 2021
f0729c4
edit project name
Mu7ammadAbed Oct 27, 2021
b2c9907
add more test
muhammadharoun Oct 27, 2021
a0df53a
authentciation
ElhamFadel Oct 27, 2021
4af8fce
solve conflict
muhammadharoun Oct 27, 2021
c25e9e8
Merge pull request #30 from GSG-G10/16-logout
ElhamFadel Oct 27, 2021
be7e1b6
Merge branch 'development' into 9-auth
ElhamFadel Oct 27, 2021
6db88ea
restore fake date
Mu7ammadAbed Oct 27, 2021
cd81e76
move middlewares to outside te controller folder
Mu7ammadAbed Oct 27, 2021
3d0e7c3
Merge pull request #24 from GSG-G10/9-auth
ElhamFadel Oct 27, 2021
3b8d2f8
put if condition inside try
muhammadharoun Oct 27, 2021
31e6f65
change tests
muhammadharoun Oct 27, 2021
3e04a6c
slove conflect
muhammadharoun Oct 27, 2021
0fcc0c5
remove some comments
muhammadharoun Oct 27, 2021
71110ad
add toEqual for last test
muhammadharoun Oct 27, 2021
1c56f7c
Merge pull request #27 from GSG-G10/14-userId-estates-route
Mu7ammadAbed Oct 27, 2021
5dfa82b
Merge branch 'development' of https://github.com/GSG-G10/Housy into d…
ElhamFadel Oct 27, 2021
7cd0d0a
resolve all changes requirment
ElhamFadel Oct 27, 2021
5f2fd2f
fix eslint and userEstateModule
Mu7ammadAbed Oct 28, 2021
98fdfa8
Create build:db script
Mu7ammadAbed Oct 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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