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
abd8701c
Commit
abd8701c
authored
Nov 13, 2022
by
it19048642@my.sllit.lk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grocery comparison feature
parent
9d1c9166
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
656 additions
and
9 deletions
+656
-9
Backend/.env
Backend/.env
+1
-1
bussifinder/src/App.js
bussifinder/src/App.js
+2
-0
bussifinder/src/components/Grocery Input/InputDetails.js
bussifinder/src/components/Grocery Input/InputDetails.js
+22
-6
bussifinder/src/components/Grocery Input/MultipleResultG.js
bussifinder/src/components/Grocery Input/MultipleResultG.js
+550
-0
bussifinder/src/components/MultipleResult.js
bussifinder/src/components/MultipleResult.js
+5
-0
bussifinder/src/components/Results.js
bussifinder/src/components/Results.js
+76
-2
No files found.
Backend/.env
View file @
abd8701c
API_KEY_SECRET = 'AIzaSy
DzvpMhG1TmXhpoCfPCq-G4snf-R0vSWF4
'
API_KEY_SECRET = 'AIzaSy
C_mV5GkYx8ULNDqXgwBobTczkM7j6T0uc
'
JWT_SECRET = cb6969137082baf1baeeed271a270ae29dde0c6f5775e9508e808965405c99b5
BASE_URL = http://localhost:3000/
HOST=smtp.gmail.com
...
...
bussifinder/src/App.js
View file @
abd8701c
...
...
@@ -27,6 +27,7 @@ import InputGroceryDetails from './components/InputGroceryDetails';
import
MultipleResult
from
'
./components/MultipleResult
'
;
import
ResultsWOTypes
from
'
./components/ResultsWOTypes
'
;
import
LocationBasedPredict
from
'
./components/LocationBasedPredict
'
;
import
MultipleResultG
from
'
./components/Grocery Input/MultipleResultG
'
const
store
=
configureStore
({
reducer
:
{
...
...
@@ -61,6 +62,7 @@ function App() {
<
Route
path
=
"
/resultWOTypes
"
element
=
{
<
ResultsWOTypes
/>
}
/
>
<
Route
path
=
"
/Service
"
element
=
{
<
BusinessTypePage
/>
}
/
>
<
Route
path
=
"
/locationBasedPredict
"
element
=
{
<
LocationBasedPredict
/>
}
/
>
<
Route
path
=
"
/multipleResultG
"
element
=
{
<
MultipleResultG
/>
}
/
>
<
/Route
>
<
/Routes
>
<
Footer
/>
...
...
bussifinder/src/components/Grocery Input/InputDetails.js
View file @
abd8701c
...
...
@@ -85,13 +85,21 @@ export default function InputDetails() {
"
longitude
"
:
businessDetails
.
value
[
0
].
longitude
}
API
.
post
(
'
grocery/grocerycompetitor
'
,
body
).
then
((
competResult
)
=>
{
const
competitorsCount
=
competResult
.
data
.
CompetitorCount
API
.
post
(
'
grocery/grocerycompetitor
'
,
body
).
then
((
competResult
)
=>
{
const
competitorsCount
=
competResult
.
data
.
CompetitorCount
API
.
post
(
'
grocery/grocerytraffci
'
,
body
).
then
((
trafficResult
)
=>
{
const
trafficSum
=
trafficResult
.
data
.
TraffciSummation
API
.
post
(
'
grocery/grocerytraffci
'
,
body
).
then
((
trafficResult
)
=>
{
console
.
log
(
"
tree--->
"
,
trafficResult
)
var
trafficSum
;
if
(
!
trafficResult
.
data
.
TraffciSummation
){
trafficSum
=
0
}
else
{
trafficSum
=
trafficResult
.
data
.
TraffciSummation
}
console
.
log
(
"
comp:
"
,
competitorsCount
,
"
traffic:
"
,
trafficSum
)
console
.
log
(
"
comp:
"
,
competitorsCount
,
"
traffic:
"
,
trafficSum
)
let
groceryModelReq
=
{
"
Trafficflow
"
:
trafficSum
,
...
...
@@ -112,14 +120,22 @@ export default function InputDetails() {
let
locationFeatures
=
{
trafficSum
:
trafficSum
,
competitorsCount
:
competitorsCount
,
Instoreshopping
:
businessDetails
.
value
[
0
].
serviceDetails
.
shopping
?
"
available
"
:
"
unavalable
"
,
Delivery
:
businessDetails
.
value
[
0
].
serviceDetails
.
delivery
?
"
available
"
:
"
unavalable
"
,
Website
:
businessDetails
.
value
[
0
].
serviceDetails
.
web
?
"
available
"
:
"
unavalable
"
,
Parking
:
businessDetails
.
value
[
0
].
serviceDetails
.
parking
?
"
available
"
:
"
unavalable
"
}
console
.
log
(
groceryModelReq
)
axios
.
post
(
'
http://127.0.0.1:5000/grocery
'
,
groceryModelReq
)
.
then
(
function
(
GroceryResult
)
{
console
.
log
(
"
Prediction
"
,
GroceryResult
.
data
)
dispatch
(
addBusiness
({
...
businessDetails
.
value
[
0
],
locationFeatures
:
locationFeatures
,
ml_result
:
GroceryResult
.
data
.
data
}))
navigate
(
`/result`
)
if
(
businessDetails
.
value
.
length
>
1
)
{
navigate
(
`/multipleResultG`
)
}
else
{
navigate
(
`/result`
)}
handleClose
()
}).
catch
((
error
)
=>
{
console
.
log
(
"
error:
"
,
error
)
...
...
bussifinder/src/components/Grocery Input/MultipleResultG.js
0 → 100644
View file @
abd8701c
This diff is collapsed.
Click to expand it.
bussifinder/src/components/MultipleResult.js
View file @
abd8701c
...
...
@@ -186,6 +186,11 @@ const MultipleResult = () => {
dispatch
(
addBusiness
({
'
type
'
:
'
restaurant
'
}))
navigate
(
'
/inputHotel
'
);
}
else
if
(
businessDetails
.
value
[
businessDetails
.
value
.
length
-
1
].
type
==
'
grocery
'
)
{
dispatch
(
addBusiness
({
'
type
'
:
'
grocery
'
}))
navigate
(
'
/inputGrocery
'
);
}
}
...
...
bussifinder/src/components/Results.js
View file @
abd8701c
...
...
@@ -49,7 +49,9 @@ import {HiShoppingBag} from 'react-icons/hi';
import
{
RiRestaurantFill
}
from
'
react-icons/ri
'
;
import
{
MdOutlineDeliveryDining
}
from
'
react-icons/md
'
;
import
{
AiOutlineClockCircle
}
from
'
react-icons/ai
'
;
import
{
BiWorld
}
from
'
react-icons/bi
'
;
import
{
AiOutlineShoppingCart
,
AiFillCalendar
}
from
"
react-icons/ai
"
;
import
{
TbTruckDelivery
}
from
"
react-icons/tb
"
;
import
{
jsPDF
}
from
"
jspdf
"
;
ChartJS
.
register
(
...
...
@@ -288,6 +290,10 @@ const Results = () => {
dispatch
(
addBusiness
({
'
type
'
:
'
restaurant
'
}))
navigate
(
'
/inputHotel
'
);
}
else
if
(
businessDetails
.
value
[
businessDetails
.
value
.
length
-
1
].
type
==
'
Grocery
'
)
{
dispatch
(
addBusiness
({
'
type
'
:
'
Grocery
'
}))
navigate
(
'
/inputGrocery
'
);
}
}
...
...
@@ -334,6 +340,29 @@ const doc = new jsPDF();
doc
.
text
(
`Final Prediction :
${
businessDetails
.
value
[
0
].
ml_result
}
%`
,
20
,
110
);
doc
.
save
(
"
Report.pdf
"
);
}
else
if
(
businessDetails
.
value
[
0
].
type
==
'
Grocery
'
){
doc
.
setFontSize
(
22
);
doc
.
setFont
(
"
courier
"
,
"
bolditalic
"
);
doc
.
text
(
"
Grocery Success Percentage Prediction
"
,
105
,
8
,
null
,
null
,
"
center
"
);
doc
.
setFont
(
"
helvetica
"
,
"
normal
"
);
doc
.
setFontSize
(
16
);
doc
.
text
(
`Type :
${
businessDetails
.
value
[
0
].
type
}
`
,
20
,
30
);
doc
.
setFont
(
"
helvetica
"
,
"
normal
"
);
doc
.
setFontSize
(
16
);
doc
.
text
(
`Type :
${
businessDetails
.
value
[
0
].
type
}
`
,
20
,
30
);
doc
.
text
(
`Latitude :
${
businessDetails
.
value
[
0
].
latitude
}
`
,
20
,
40
);
doc
.
text
(
`Longitude :
${
businessDetails
.
value
[
0
].
longitude
}
`
,
20
,
50
);
doc
.
text
(
`Traffic Summation :
${
businessDetails
.
value
[
0
].
locationFeatures
.
trafficSum
}
`
,
20
,
60
);
doc
.
text
(
`In-Store-Shopping :
${
businessDetails
.
value
[
0
].
locationFeatures
.
Instoreshopping
}
`
,
20
,
70
);
doc
.
text
(
`Delivery :
${
businessDetails
.
value
[
0
].
locationFeatures
.
Delivery
}
`
,
20
,
80
);
doc
.
text
(
`Website :
${
businessDetails
.
value
[
0
].
locationFeatures
.
Website
}
`
,
20
,
90
);
doc
.
text
(
`Competitors Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
competitorsCount
}
`
,
20
,
100
);
doc
.
setFont
(
"
helvetica
"
,
"
bold
"
);
doc
.
text
(
`Final Prediction :
${
businessDetails
.
value
[
0
].
ml_result
}
%`
,
20
,
110
);
doc
.
save
(
"
Report.pdf
"
);
}
...
...
@@ -494,7 +523,52 @@ const doc = new jsPDF();
<
/Box
>
<
/Box
>
<
/Box
>
:
:
businessDetails
&&
businessDetails
.
value
[
0
].
type
==
'
Grocery
'
?
<
Box
sx
=
{{
width
:
"
100%
"
,
height
:
"
100%
"
,
display
:
"
flex
"
,
justifyContent
:
"
space-between
"
,
alignItems
:
"
center
"
,
gap
:
"
20px
"
,
boxSizing
:
"
border-box
"
,
}}
>
<
Box
className
=
{
classes
.
featuresBoxFlex
}
>
<
div
className
=
{
classes
.
featureTitleTxt
}
>
Grocery
Location
Based
Features
<
/div
>
<
Box
className
=
{
classes
.
featuresBox
}
>
<
Grow
in
=
{
checked
}
style
=
{{
transformOrigin
:
'
0 0 0
'
}}
{...(
checked
?
{
timeout
:
500
}
:
{})}
>
<
div
className
=
{
classes
.
features
}
><
GiPathDistance
style
=
{{
color
:
'
#df5e52
'
,
fontSize
:
'
20px
'
}}
/>Competitors Count - {businessDetails.value
[
0
]
.locationFeatures.competitorsCount}</
div
>
<
/Grow
>
<
Grow
in
=
{
checked
}
style
=
{{
transformOrigin
:
'
0 0 0
'
}}
{...(
checked
?
{
timeout
:
800
}
:
{})}
>
<
div
className
=
{
classes
.
features
}
><
HiShoppingBag
style
=
{{
color
:
'
#2f9f48
'
,
fontSize
:
'
20px
'
}}
/>Traffic around the area - {businessDetails.value
[
0
]
.locationFeatures.trafficSum}</
div
>
<
/Grow
>
<
/Box
>
<
/Box
>
<
Box
className
=
{
classes
.
featuresBoxFlex
}
>
<
div
className
=
{
classes
.
featureTitleTxt
}
>
Service
Based
Features
<
/div
>
<
Box
className
=
{
classes
.
featuresBox
}
>
<
Grow
in
=
{
checked
}
style
=
{{
transformOrigin
:
'
0 0 0
'
}}
{...(
checked
?
{
timeout
:
1100
}
:
{})}
>
<
div
className
=
{
classes
.
features
}
><
AiOutlineShoppingCart
style
=
{{
color
:
'
#ce7c39
'
,
fontSize
:
'
20px
'
}}
/>In-store shopping - {businessDetails.value
[
0
]
.locationFeatures.Instoreshopping}</
div
>
<
/Grow
>
<
Grow
in
=
{
checked
}
style
=
{{
transformOrigin
:
'
0 0 0
'
}}
{...(
checked
?
{
timeout
:
1400
}
:
{})}
>
<
div
className
=
{
classes
.
features
}
><
TbTruckDelivery
style
=
{{
color
:
'
#df5e52
'
,
fontSize
:
'
20px
'
}}
/>Delivery - {businessDetails.value
[
0
]
.locationFeatures.Delivery}</
div
>
<
/Grow
>
<
Grow
in
=
{
checked
}
style
=
{{
transformOrigin
:
'
0 0 0
'
}}
{...(
checked
?
{
timeout
:
1400
}
:
{})}
>
<
div
className
=
{
classes
.
features
}
><
BiWorld
style
=
{{
color
:
'
#e2da5f
'
,
fontSize
:
'
20px
'
}}
/> Website - {businessDetails.value
[
0
]
.locationFeatures.Website}</
div
>
<
/Grow
>
<
Grow
in
=
{
checked
}
style
=
{{
transformOrigin
:
'
0 0 0
'
}}
{...(
checked
?
{
timeout
:
1400
}
:
{})}
>
<
div
className
=
{
classes
.
features
}
><
RiParkingBoxLine
style
=
{{
color
:
'
#e2da5f
'
,
fontSize
:
'
20px
'
}}
/> Parking - {businessDetails.value
[
0
]
.locationFeatures.Parking}</
div
>
<
/Grow
>
<
/Box
>
<
/Box
>
<
/Box
>
:
<
div
>
<
/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