Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-257
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-257
2022-257
Commits
f12776b0
Commit
f12776b0
authored
Oct 11, 2022
by
Sachintha Nipun M.M. it19046594
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT19048642' into 'master'
It19048642 See merge request
!24
parents
8f0789e6
9ff73152
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1006 additions
and
1 deletion
+1006
-1
ML_Backend/app.py
ML_Backend/app.py
+58
-0
ML_Backend/model/GroceryPredictor.pickle
ML_Backend/model/GroceryPredictor.pickle
+0
-0
bussifinder/src/App.js
bussifinder/src/App.js
+2
-0
bussifinder/src/components/Grocery Input/InputDetails.js
bussifinder/src/components/Grocery Input/InputDetails.js
+354
-0
bussifinder/src/components/Grocery Input/LocationDetails.js
bussifinder/src/components/Grocery Input/LocationDetails.js
+111
-0
bussifinder/src/components/Grocery Input/Review.js
bussifinder/src/components/Grocery Input/Review.js
+163
-0
bussifinder/src/components/Grocery Input/ServiceDetailsForm.js
...finder/src/components/Grocery Input/ServiceDetailsForm.js
+285
-0
bussifinder/src/components/InputGroceryDetails.js
bussifinder/src/components/InputGroceryDetails.js
+26
-0
bussifinder/src/components/PropertyType.js
bussifinder/src/components/PropertyType.js
+7
-1
No files found.
ML_Backend/app.py
View file @
f12776b0
...
...
@@ -237,5 +237,63 @@ def pharmacy():
return
jsonify
({
'Error'
:
"Distance to Busstation Missing!"
})
#Grocery
def
predictionGroceryl
(
lst
):
filename
=
'model/GroceryPredictor.pickle'
with
open
(
filename
,
'rb'
)
as
file
:
model
=
pickle
.
load
(
file
)
pred_value
=
model
.
predict
([
lst
])
.
tolist
()
return
pred_value
@
app
.
route
(
'/grocery'
,
methods
=
[
'POST'
,
'GET'
])
def
grocery
():
pred
=
0
if
request
.
method
==
'POST'
:
Trafficflow
=
request
.
json
[
'Trafficflow'
]
Competitors
=
request
.
json
[
'Competitors'
]
Instoreshopping
=
request
.
json
[
'Instoreshopping'
]
Delivery
=
request
.
json
[
'Delivery'
]
Website
=
request
.
json
[
'Website'
]
Sunday
=
request
.
json
[
'Sunday'
]
Monday
=
request
.
json
[
'Monday'
]
Tuesday
=
request
.
json
[
'Tuesday'
]
Wednesday
=
request
.
json
[
'Wednesday'
]
Thursday
=
request
.
json
[
'Thursday'
]
Friday
=
request
.
json
[
'Friday'
]
Saturday
=
request
.
json
[
'Saturday'
]
ParkingArea
=
request
.
json
[
'ParkingArea'
]
if
(
isinstance
(
Trafficflow
,
int
)
and
isinstance
(
Competitors
,
int
)
):
feature_list
=
[]
feature_list
.
append
(
int
(
Trafficflow
))
feature_list
.
append
(
int
(
Competitors
))
feature_list
.
append
(
int
(
Instoreshopping
))
feature_list
.
append
(
int
(
Delivery
))
feature_list
.
append
(
int
(
Website
))
feature_list
.
append
(
int
(
Sunday
))
feature_list
.
append
(
int
(
Monday
))
feature_list
.
append
(
int
(
Tuesday
))
feature_list
.
append
(
int
(
Wednesday
))
feature_list
.
append
(
int
(
Thursday
))
feature_list
.
append
(
int
(
Friday
))
feature_list
.
append
(
int
(
Saturday
))
feature_list
.
append
(
int
(
ParkingArea
))
pred
=
predictionGroceryl
(
feature_list
)
print
(
pred
)
return
jsonify
({
'data'
:
pred
[
0
]})
else
:
if
(
not
isinstance
(
Trafficflow
,
int
)):
return
jsonify
({
'Error'
:
"Traffic flow error!"
})
else
:
return
jsonify
({
'Error'
:
"Compatitor Count error!"
})
if
__name__
==
'__main__'
:
app
.
run
(
debug
=
True
)
\ No newline at end of file
ML_Backend/model/GroceryPredictor.pickle
0 → 100644
View file @
f12776b0
File added
bussifinder/src/App.js
View file @
f12776b0
...
...
@@ -22,6 +22,7 @@ import Pricing from './components/Pricing';
import
SignUp
from
'
./components/Auth/SignUp
'
;
import
SignIn
from
'
./components/Auth/SignIn
'
;
import
BusinessTypePage
from
'
./components/BusinessTypePage
'
;
import
InputGroceryDetails
from
'
./components/InputGroceryDetails
'
;
import
MultipleResult
from
'
./components/MultipleResult
'
;
import
ResultsWOTypes
from
'
./components/ResultsWOTypes
'
;
import
LocationBasedPredict
from
'
./components/LocationBasedPredict
'
;
...
...
@@ -53,6 +54,7 @@ function App() {
<
Route
path
=
"
/signUp
"
element
=
{
<
SignUp
/>
}
/
>
<
Route
path
=
"
/signIn
"
element
=
{
<
SignIn
/>
}
/
>
<
Route
path
=
"
/Service
"
element
=
{
<
BusinessTypePage
/>
}
/
>
<
Route
path
=
"
/inputGrocery
"
element
=
{
<
InputGroceryDetails
/>
}
/
>
<
Route
path
=
"
/multipleResult
"
element
=
{
<
MultipleResult
/>
}
/
>
<
Route
path
=
"
/resultWOTypes
"
element
=
{
<
ResultsWOTypes
/>
}
/
>
<
Route
path
=
"
/Service
"
element
=
{
<
BusinessTypePage
/>
}
/
>
...
...
bussifinder/src/components/Grocery Input/InputDetails.js
0 → 100644
View file @
f12776b0
This diff is collapsed.
Click to expand it.
bussifinder/src/components/Grocery Input/LocationDetails.js
0 → 100644
View file @
f12776b0
import
*
as
React
from
'
react
'
;
import
Grid
from
'
@mui/material/Grid
'
;
import
Typography
from
'
@mui/material/Typography
'
;
import
TextField
from
'
@mui/material/TextField
'
;
import
FormControlLabel
from
'
@mui/material/FormControlLabel
'
;
import
Checkbox
from
'
@mui/material/Checkbox
'
;
import
Map
from
'
./../Map
'
export
default
function
LocationDetails
()
{
return
(
<
React
.
Fragment
>
<
Typography
variant
=
"
h6
"
gutterBottom
>
Location
Selection
<
/Typography
>
<
div
>
<
Map
/>
{
/* <Grid item xs={12} sm={6}>
<TextField
required
id="firstName"
name="firstName"
label="First name"
fullWidth
autoComplete="given-name"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="lastName"
name="lastName"
label="Last name"
fullWidth
autoComplete="family-name"
variant="standard"
/>
</Grid>
<Grid item xs={12}>
<TextField
required
id="address1"
name="address1"
label="Address line 1"
fullWidth
autoComplete="shipping address-line1"
variant="standard"
/>
</Grid>
<Grid item xs={12}>
<TextField
id="address2"
name="address2"
label="Address line 2"
fullWidth
autoComplete="shipping address-line2"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="city"
name="city"
label="City"
fullWidth
autoComplete="shipping address-level2"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
id="state"
name="state"
label="State/Province/Region"
fullWidth
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="zip"
name="zip"
label="Zip / Postal code"
fullWidth
autoComplete="shipping postal-code"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="country"
name="country"
label="Country"
fullWidth
autoComplete="shipping country"
variant="standard"
/>
</Grid>
<Grid item xs={12}>
<FormControlLabel
control={<Checkbox color="secondary" name="saveAddress" value="yes" />}
label="Use this address for payment details"
/>
</Grid> */
}
<
/div
>
<
/React.Fragment
>
);
}
\ No newline at end of file
bussifinder/src/components/Grocery Input/Review.js
0 → 100644
View file @
f12776b0
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
Typography
from
'
@mui/material/Typography
'
;
import
List
from
'
@mui/material/List
'
;
import
ListItem
from
'
@mui/material/ListItem
'
;
import
ListItemText
from
'
@mui/material/ListItemText
'
;
import
Grid
from
'
@mui/material/Grid
'
;
import
{
useLoadScript
,
GoogleMap
,
MarkerF
,
InfoWindow
}
from
"
@react-google-maps/api
"
;
import
{
FaUmbrellaBeach
}
from
'
react-icons/fa
'
;
import
{
AiOutlineWifi
}
from
'
react-icons/ai
'
;
import
{
MdOutlinePool
}
from
'
react-icons/md
'
;
import
{
RiParkingBoxLine
}
from
'
react-icons/ri
'
;
import
{
BsWind
}
from
'
react-icons/bs
'
;
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
;
import
{
addBusiness
}
from
'
./../../features/business
'
;
import
{
BiWorld
}
from
'
react-icons/bi
'
;
import
{
AiOutlineShoppingCart
,
AiFillCalendar
}
from
"
react-icons/ai
"
;
import
{
TbTruckDelivery
}
from
"
react-icons/tb
"
;
export
default
function
Review
()
{
const
businessDetails
=
useSelector
((
state
)
=>
state
.
business
)
const
[
center
,
setCenter
]
=
useState
({
lat
:
businessDetails
&&
businessDetails
.
value
[
0
].
latitude
?
businessDetails
.
value
[
0
].
latitude
:
''
,
lng
:
businessDetails
&&
businessDetails
.
value
[
0
].
longitude
?
businessDetails
.
value
[
0
].
longitude
:
''
,
});
const
[
position
,
setPosition
]
=
useState
({
lat
:
businessDetails
&&
businessDetails
.
value
[
0
].
latitude
?
businessDetails
.
value
[
0
].
latitude
:
''
,
lng
:
businessDetails
&&
businessDetails
.
value
[
0
].
longitude
?
businessDetails
.
value
[
0
].
longitude
:
''
,
});
const
[
zoom
,
setZoom
]
=
useState
(
9
);
const
[
clickedLatLng
,
setClickedLatLng
]
=
useState
(
null
);
const
dispatch
=
useDispatch
();
// useEffect(() => {
// dispatch(addBusiness({ 'type': 'restaurant' }))
// }, []);
useEffect
(()
=>
{
if
(
businessDetails
&&
businessDetails
.
value
.
length
>
0
)
{
console
.
log
(
"
businessDetails
"
,
businessDetails
.
value
)
}
},
[
businessDetails
]);
const
{
isLoaded
}
=
useLoadScript
({
// Enter your own Google Maps API key
googleMapsApiKey
:
"
AIzaSyDzvpMhG1TmXhpoCfPCq-G4snf-R0vSWF4
"
});
return
(
<
React
.
Fragment
>
<
Typography
variant
=
"
h6
"
gutterBottom
>
Summary
<
/Typography
>
{
businessDetails
&&
businessDetails
.
value
[
0
].
type
==
'
Grocery
'
?
<
List
disablePadding
sx
=
{{
paddingInline
:
2
}}
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
AiOutlineShoppingCart
style
=
{{
color
:
'
#ff802f
'
,
fontSize
:
'
18px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="In-Store-Shopping" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
shopping
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
TbTruckDelivery
style
=
{{
color
:
'
#344ab1
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Delivery Service" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
delivery
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
BiWorld
style
=
{{
color
:
'
#4534b1
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="WebSite Availability" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
web
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
RiParkingBoxLine
style
=
{{
color
:
'
#b13434
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Parking Availabily" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
parking
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
AiFillCalendar
style
=
{{
color
:
'
#34b13f
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Available Days" /
>
<
/ListItem
>
<
Typography
display
=
"
inline
"
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
mon
?
`Monday, `
:
``
}
<
/Typography
>
<
Typography
display
=
"
inline
"
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
tue
?
`Tuesday, `
:
``
}
<
/Typography
>
<
Typography
display
=
"
inline
"
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
wedn
?
`Wednesday, `
:
``
}
<
/Typography
>
<
Typography
display
=
"
inline
"
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
thurs
?
`Thursday, `
:
``
}
<
/Typography
>
<
Typography
display
=
"
inline
"
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
fri
?
`Friday, `
:
``
}
<
/Typography
>
<
Typography
display
=
"
inline
"
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
sat
?
`Saturday, `
:
``
}
<
/Typography
>
<
Typography
display
=
"
inline
"
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
sun
?
`Sunday`
:
``
}
<
/Typography
>
<
/List>
:
businessDetails
&&
businessDetails
.
value
[
0
].
type
==
'
restaurant
'
?
<
List
disablePadding
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
ListItemText
primary
=
"
Opening Hours
"
/>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
opening
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
ListItemText
primary
=
"
Closing Hours
"
/>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
closing
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
ListItemText
primary
=
"
Delivery
"
/>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
delivery
==
'
Delivery
'
?
`Available`
:
businessDetails
.
value
[
0
].
serviceDetails
.
delivery
}
<
/Typography
>
<
/ListItem
>
<
/List
>
:
<
div
><
/div>
}
<
Grid
container
spacing
=
{
2
}
>
<
Grid
item
xs
=
{
12
}
>
<
Typography
variant
=
"
h6
"
gutterBottom
sx
=
{{
mt
:
2
,
display
:
'
flex
'
,
alignItems
:
'
center
'
,
gap
:
'
5px
'
}}
>
Location
{
position
&&
(
<
div
style
=
{{
fontSize
:
"
12px
"
,
marginTop
:
'
5px
'
,
color
:
'
#c4c2c0
'
,
fontStyle
:
'
italic
'
}}
>
({
position
.
lat
},
{
position
.
lng
})
<
/div
>
)}
<
/Typography
>
<
div
>
{
isLoaded
?
<
div
>
<
GoogleMap
center
=
{
center
}
zoom
=
{
zoom
}
mapContainerStyle
=
{{
height
:
"
35vh
"
,
}}
>
{
position
&&
<
MarkerF
position
=
{
position
}
/>
}
<
/GoogleMap
>
{
/* Our center position always in state */
}
{
/* <h3>
Center {center.lat}, {center.lng}
</h3> */
}
{
/* Position of the user's map click */
}
{
/* {position && (
<div>
<h3>
Coordinates of the Selected Location:</h3> <span> {position.lat}, {position.lng}</span>
</div>
)} */
}
{
/* Position of the user's map click */
}
{
/* {selectedPlace && <h3>Selected Marker: {selectedPlace.id}</h3>} */
}
<
/div> : <div>Loading...</
div
>
}
<
/div
>
<
/Grid
>
<
/Grid
>
<
/React.Fragment
>
);
}
\ No newline at end of file
bussifinder/src/components/Grocery Input/ServiceDetailsForm.js
0 → 100644
View file @
f12776b0
This diff is collapsed.
Click to expand it.
bussifinder/src/components/InputGroceryDetails.js
0 → 100644
View file @
f12776b0
import
React
from
'
react
'
import
InputDetailsGrocery
from
'
./Grocery Input/InputDetails
'
import
{
Box
}
from
'
@mui/system
'
const
InputGroceryDetails
=
()
=>
{
return
(
<
Box
sx
=
{{
width
:
"
100%
"
,
height
:
"
100%
"
,
backgroundColor
:
'
#E4E6F1
'
,
boxSizing
:
"
border-box
"
,
backgroundImage
:
`url(
${
require
(
'
../images/about-shape-2.svg
'
).
default
}
)`
,
padding
:
"
0px
"
,
backgroundRepeat
:
'
repeat
'
,
backgroundSize
:
'
contain
'
,
}}
>
<
InputDetailsGrocery
/>
<
/Box
>
)
}
export
default
InputGroceryDetails
\ No newline at end of file
bussifinder/src/components/PropertyType.js
View file @
f12776b0
...
...
@@ -126,6 +126,12 @@ const PropertyType = () => {
navigate
(
`/inputHotel`
)
}
//Grocery navigation
const
groceryNavigate
=
()
=>
{
dispatch
(
addBusiness
({
'
type
'
:
'
Grocery
'
}))
navigate
(
'
/inputGrocery
'
);
}
return
(
<
div
>
...
...
@@ -244,7 +250,7 @@ const PropertyType = () => {
<
/Box
>
<
/Zoom
>
<
Zoom
in
=
{
checked
}
style
=
{{
transitionDelay
:
checked
?
'
200ms
'
:
'
0ms
'
}}
>
<
Box
className
=
{
classes
.
typeBox
}
onClick
=
{()
=>
navigateToHInputForm
()}
>
<
Box
className
=
{
classes
.
typeBox
}
onClick
=
{()
=>
groceryNavigate
()}
>
<
div
className
=
{
classes
.
typeClip
}
>
<
div
className
=
{
classes
.
backClip
}
><
/div
>
<
div
className
=
{
classes
.
frontClip
}
><
IoStorefrontOutline
className
=
{
classes
.
iconClip
}
/></
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment