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

Basic database setup and testing. #123

Open
wants to merge 400 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
400 commits
Select commit Hold shift + click to select a range
a1d8e99
Merge pull request #27 from mariannebourcier/bugfix/manual-refresh-sh…
mariannebourcier Sep 29, 2022
adee1c5
Merge remote changes to local repo.
sneham-boop Sep 29, 2022
2096565
Add function to check if user can join run.
sneham-boop Sep 29, 2022
cf7ac08
Add function to check if user can join run.
sneham-boop Sep 29, 2022
484b1b9
Use geolocation data to get current position of user; use promise to …
mariannebourcier Sep 29, 2022
4b5ef6d
Disable join button if run cannot be joined.
sneham-boop Sep 29, 2022
e0548bf
Disable join button if run cannot be joined.
sneham-boop Sep 29, 2022
f13c1da
Disable join button if run cannot be joined.
sneham-boop Sep 29, 2022
3c4ca48
Show spinner between joining the run and redirection to profile page.
sneham-boop Sep 29, 2022
18b1f95
Remove unnessesary imports.
sneham-boop Sep 29, 2022
552aaba
Add basic styling for find run page.
sneham-boop Sep 29, 2022
ee43342
Reduce delay for spinner.
sneham-boop Sep 29, 2022
8dd25bc
Add mailgun.
sneham-boop Sep 29, 2022
fe7c102
Remove mailgun.
sneham-boop Sep 29, 2022
55b8f7b
Remove mailgun
sneham-boop Sep 29, 2022
cc93f62
Remove .env file from being tracked.
sneham-boop Sep 30, 2022
3d1edeb
Add hover state to marker, identify on map using id
mariannebourcier Sep 30, 2022
36a6448
Merge pull request #29 from mariannebourcier/component/marker
sneham-boop Sep 30, 2022
76947da
Merge pull request #30 from mariannebourcier/join-runs
mariannebourcier Sep 30, 2022
87f2316
Recenter map; add map parameters; add form fields to run create
mariannebourcier Sep 30, 2022
da899bd
Create hook to get user location
mariannebourcier Oct 1, 2022
6561bb4
Move map component to defaultMap file and reorganize
mariannebourcier Oct 1, 2022
c59e89e
Reroute map component to use defaultMap; add current location hook to…
mariannebourcier Oct 1, 2022
3d6383d
Merge pull request #31 from mariannebourcier/component/userlocation
sneham-boop Oct 1, 2022
25eb8de
Redirect user to login before they can join a run.
sneham-boop Oct 1, 2022
ec64d3d
Fix form id's on RegisterUser component.
sneham-boop Oct 1, 2022
4a215c4
Add more text to description of each run.
sneham-boop Oct 1, 2022
0fae730
Style run to accommodate more text.
sneham-boop Oct 1, 2022
1ddd0e7
Simplify run component by removing bootstrap card.
sneham-boop Oct 1, 2022
08e1ae4
Style join button.
sneham-boop Oct 1, 2022
7254ada
Add form fields relevant to creating a run.
sneham-boop Oct 1, 2022
6e61cbe
Add function to createRun in useAppData hook.
sneham-boop Oct 1, 2022
209ed7c
Add route to create a new run.
sneham-boop Oct 1, 2022
0358e85
Add state to register Run form component.
sneham-boop Oct 1, 2022
9995d5a
Use recoil atom to store user location
mariannebourcier Oct 1, 2022
8c00ecf
Add createRun function to hook to first create a run and then add an …
sneham-boop Oct 1, 2022
d11d984
Delete test.js file
sneham-boop Oct 1, 2022
49b8608
Remove console.logs.
sneham-boop Oct 1, 2022
7882abc
Add coordinates function to recoil state; add marker for current loca…
mariannebourcier Oct 1, 2022
54a29ba
Change default location back to yyz until figure out the coordinates
mariannebourcier Oct 1, 2022
52ef495
Merge pull request #32 from mariannebourcier/join-runs
mariannebourcier Oct 1, 2022
92ca742
Merge pull request #33 from mariannebourcier/component/createrun
mariannebourcier Oct 1, 2022
b4db666
Add function to create new user.
sneham-boop Oct 2, 2022
29757b1
Merge remote master repo. Login user after profile is created.
sneham-boop Oct 2, 2022
afbc3e3
Handle state change in checkboxes for planner/runner role.
sneham-boop Oct 2, 2022
bf1fc4f
Check user us getting created via form.
sneham-boop Oct 2, 2022
cfd4cf5
Add an action button in place of empty runs page for new user.
sneham-boop Oct 2, 2022
6675483
Check action button redirects as expected.
sneham-boop Oct 2, 2022
3fbf169
Add tooltip for action button.
sneham-boop Oct 2, 2022
ce0d6a8
Merge pull request #34 from mariannebourcier/component/userlocation
sneham-boop Oct 2, 2022
2321dd4
Merge pull request #35 from mariannebourcier/create-user
mariannebourcier Oct 3, 2022
01d6348
Remove redundant imports causing unnesessary warnings in console.
sneham-boop Oct 3, 2022
8a294b5
Add form validation to register user
mariannebourcier Oct 3, 2022
56851be
create function to handle form submit to check for form errors
mariannebourcier Oct 3, 2022
9450c88
Add feedback to error form fields
mariannebourcier Oct 3, 2022
8752bca
Show users current location on google map.
sneham-boop Oct 3, 2022
305c288
Add form validation to run creation page; add descriptive error messa…
mariannebourcier Oct 4, 2022
5ce50c7
Use validate state to check for form errors
mariannebourcier Oct 4, 2022
328fdbb
Merge pull request #36 from mariannebourcier/user-location
mariannebourcier Oct 4, 2022
1f89cf7
Merge pull request #37 from mariannebourcier/component/login
sneham-boop Oct 4, 2022
71ea1eb
Create new file for twilio api
mariannebourcier Oct 4, 2022
6e0cbcc
Test twilio
mariannebourcier Oct 4, 2022
76c6cca
Store keys; fix typo
mariannebourcier Oct 4, 2022
0e75836
Add autocomplete component from remote repo.
sneham-boop Oct 4, 2022
c0d5bbe
Add basic bootstrap form component to experiment.
sneham-boop Oct 4, 2022
e2c706d
Add twilio to server file
mariannebourcier Oct 4, 2022
0550222
Write new user message in function; add to server file
mariannebourcier Oct 4, 2022
2d1f0aa
Write additional text messages for users to receive
mariannebourcier Oct 4, 2022
1c974a6
add twilio number to message functions
mariannebourcier Oct 4, 2022
2349610
Keep twilio messages in proper file; remove from server file
mariannebourcier Oct 4, 2022
3da6700
Add send message function to create user post request
mariannebourcier Oct 4, 2022
71d2106
Merge pull request #38 from mariannebourcier/api/twilio
sneham-boop Oct 4, 2022
6df5eb5
Add signin form required fields
mariannebourcier Oct 4, 2022
43c0583
Fix alt error message in run page
mariannebourcier Oct 4, 2022
5e74c95
Add AutoComplete component in RegisterRun form.
sneham-boop Oct 4, 2022
8ad260f
Change createRun function in hook to accept new data.
sneham-boop Oct 4, 2022
5210688
Update post route for new runs to accept new data.
sneham-boop Oct 4, 2022
64c6ee8
Use interface to handle form data; change onclick events of form
mariannebourcier Oct 5, 2022
e9edd22
Change state function for clarity
mariannebourcier Oct 5, 2022
05acbbb
Merge pull request #39 from mariannebourcier/location-autocomplete
mariannebourcier Oct 5, 2022
da927de
Add sample tooltip when hovering on map marker.
sneham-boop Oct 5, 2022
362853f
Display dynamic data for run on marker tooltip.
sneham-boop Oct 5, 2022
edf17b0
Format DefaultMap component.
sneham-boop Oct 5, 2022
fee4ed9
Add run id to show on run component on available runs.
sneham-boop Oct 5, 2022
d6ee0e1
Add run id to show on run component on available runs.
sneham-boop Oct 5, 2022
65992c9
Hover to actual run when clicking on map marker.
sneham-boop Oct 5, 2022
448ec71
Style id showing on the side of run name in component.
sneham-boop Oct 5, 2022
38099d8
Make markers slightly larger.
sneham-boop Oct 5, 2022
c7db26f
Add a variety of distance seed data to db and update getAllRuns funct…
sneham-boop Oct 5, 2022
85a102a
Update marker tooltip to show dynamic distance data for available runs.
sneham-boop Oct 5, 2022
7137577
Update getAllRuns to pull date in the correct format.
sneham-boop Oct 5, 2022
57e28be
Verify run date is correct on available runs page.
sneham-boop Oct 5, 2022
1ee7878
Refactor handlechange handlesubmit functions; fix bugs in register form
mariannebourcier Oct 5, 2022
59dad6a
Verify run date is correct on planned and attended runs.
sneham-boop Oct 5, 2022
67cf63c
Merge branch 'master' into component/login
mariannebourcier Oct 5, 2022
7ff0e43
Merge pull request #41 from mariannebourcier/component/login
mariannebourcier Oct 5, 2022
c7bb7e5
Merge branch 'master' into tooltip/map-marker
mariannebourcier Oct 5, 2022
b9f0b17
Merge pull request #40 from mariannebourcier/tooltip/map-marker
mariannebourcier Oct 5, 2022
8b91111
Change datatype of time field to time & extract time in correct format.
sneham-boop Oct 5, 2022
aab20d9
Change useState to single state interface; add handleChange and handl…
mariannebourcier Oct 5, 2022
905dbc4
Extract time in correct format for planner.
sneham-boop Oct 5, 2022
6cc1bea
Change date and time input format in state interface
mariannebourcier Oct 5, 2022
4467d95
Add condition to check type of run while rendering time of run.
sneham-boop Oct 5, 2022
22b6196
Add tooltip for scheduled runs to show date.
sneham-boop Oct 5, 2022
f585593
Remove id marker for rendering planned runs.
sneham-boop Oct 5, 2022
cf62f94
Add name attribute to form control fields
mariannebourcier Oct 5, 2022
d5f05fa
Fix distance selector input field
mariannebourcier Oct 5, 2022
487ca15
Change form field onchange to handlechange func
mariannebourcier Oct 5, 2022
d093c82
Control display of time property for a run attended vs planned.
sneham-boop Oct 5, 2022
95cdf87
Pull and render event address for attended runs as well. On profile.
sneham-boop Oct 5, 2022
3450e0c
Merge pull request #42 from mariannebourcier/bug/run-info-format
mariannebourcier Oct 6, 2022
796eb7b
Change form control for datepicker
mariannebourcier Oct 6, 2022
44e0368
Send data object to database from run form
mariannebourcier Oct 6, 2022
fcf5b7b
Merge branch 'master' into component/registerrun
mariannebourcier Oct 6, 2022
05c16e9
Merge pull request #43 from mariannebourcier/component/registerrun
mariannebourcier Oct 6, 2022
edeeec9
Remove duplicate state and function declaration.
sneham-boop Oct 6, 2022
24925d7
Add logo to homepage and navigation.
sneham-boop Oct 6, 2022
1b4bc78
Make buttons for home page and style them.
sneham-boop Oct 6, 2022
335d359
Change font for navigation.
sneham-boop Oct 6, 2022
f469f49
Change button sizes on homepage.
sneham-boop Oct 7, 2022
169088e
Add favicon icon for tab.
sneham-boop Oct 7, 2022
bed09c2
Add padding to logo on homepage.
sneham-boop Oct 7, 2022
1525740
Add padding to logo on homepage.
sneham-boop Oct 7, 2022
a93741c
Add padding to logo on homepage.
sneham-boop Oct 7, 2022
ccc223d
Debug register run form component; handlesubmit function; add status …
mariannebourcier Oct 7, 2022
de53bea
Add status component to register user form; fix typo; delete comments…
mariannebourcier Oct 7, 2022
7245528
Fix validation in register user form
mariannebourcier Oct 7, 2022
67b61d9
fix component grammar typo
mariannebourcier Oct 7, 2022
5913294
Merge pull request #44 from mariannebourcier/style/homepage
mariannebourcier Oct 7, 2022
9f058e9
Add styling to map section of find run page.
sneham-boop Oct 7, 2022
40b3ea0
Add styling to showruns section on find run page.
sneham-boop Oct 7, 2022
e18d6d5
Add styling to showruns section on find run page.
sneham-boop Oct 7, 2022
27831e0
Merge pull request #46 from mariannebourcier/style/FindRun-page
sneham-boop Oct 7, 2022
0038afd
Merge branch 'master' into component/registerrun
mariannebourcier Oct 7, 2022
6cca542
Merge pull request #45 from mariannebourcier/component/registerrun
mariannebourcier Oct 7, 2022
c22041c
fix typo in acct status
mariannebourcier Oct 7, 2022
83b87dc
Style join button on find runs page.
sneham-boop Oct 7, 2022
422a761
Add bottom padding to pages showing runs-profile and find.
sneham-boop Oct 7, 2022
8b316d6
Use only one css file to style all forms-signin/register user/registe…
sneham-boop Oct 7, 2022
5272e7d
Center all forms.
sneham-boop Oct 7, 2022
3172b9c
Change color and fonts on forms.
sneham-boop Oct 7, 2022
9c668a9
Fix border for homepage.
sneham-boop Oct 7, 2022
27777a3
Fix profile header width and margins.
sneham-boop Oct 7, 2022
6b4c283
Fix checker state to send right value to db
mariannebourcier Oct 7, 2022
a85f8d4
Fix gap between runs on profile page.
sneham-boop Oct 7, 2022
9c34644
Fix syntax errors.
sneham-boop Oct 7, 2022
54de71d
Merge pull request #47 from mariannebourcier/style/FindRun-page
sneham-boop Oct 7, 2022
3ffc962
Fix twilio phone number to add regional number
mariannebourcier Oct 7, 2022
5c2f061
Add ShowRunInfo & RouteMap components from test branch.
sneham-boop Oct 7, 2022
9fff27c
Add route for ShowRunInfo component in app router.
sneham-boop Oct 7, 2022
753adc6
Fix bugs with data, checkbox and file rendering
mariannebourcier Oct 7, 2022
402b4c3
Merge branch 'master' into component/runform
mariannebourcier Oct 7, 2022
8540a07
Merge pull request #48 from mariannebourcier/component/runform
mariannebourcier Oct 7, 2022
2297c47
Add route for ShowRunInfo component in app router.
sneham-boop Oct 7, 2022
221b64f
Add route for ShowRunInfo component in app router.
sneham-boop Oct 7, 2022
df5a6c5
Fix minor bugs.
sneham-boop Oct 7, 2022
f35b48b
Fix minor bugs.
sneham-boop Oct 7, 2022
83f401b
Merging remote master branch
sneham-boop Oct 8, 2022
c682ed7
Show A to B route in modal.
sneham-boop Oct 8, 2022
b1ada7f
Add hover color to nav links
mariannebourcier Oct 8, 2022
ef83d53
Incorporate info button on run component to trigger route modal.
sneham-boop Oct 8, 2022
c69e52f
Style modal.
sneham-boop Oct 8, 2022
9940f6f
Style modal.
sneham-boop Oct 8, 2022
fe525a6
Add location latitude and longitude to run queries for getting runner…
sneham-boop Oct 8, 2022
a5d4139
Show route for lat and lon in db. Single to, dynamic from based on run.
sneham-boop Oct 8, 2022
a07bff8
Add to location coords to db schema and seed data.
sneham-boop Oct 8, 2022
3759548
Add to location coords to db schema and seed data.
sneham-boop Oct 8, 2022
77c8d99
Confirm computed route is visible in run info modal.
sneham-boop Oct 8, 2022
afc5bc6
Pull event time to show in run info modal.
sneham-boop Oct 8, 2022
bba594f
Change the order on information shown on Run component.
sneham-boop Oct 8, 2022
a4a5c14
Change name of time to event_time for receiving runs data.
sneham-boop Oct 8, 2022
b0c0dda
Pull 'to' location data for available runs.
sneham-boop Oct 8, 2022
6cc163f
Show event time on run modal
sneham-boop Oct 8, 2022
716bfe1
Add transition to hover state; make full nav height
mariannebourcier Oct 8, 2022
644452a
Add to addresses for form entry.
sneham-boop Oct 8, 2022
9ccac8e
Verify that new location seed data is showing on runs component.
sneham-boop Oct 8, 2022
fc61b07
Match variable names for to locations in creat run route.
sneham-boop Oct 8, 2022
4779045
Verify new run is created with from and to locations.
sneham-boop Oct 8, 2022
fca217a
Add styling for run component.
sneham-boop Oct 8, 2022
382cf52
Add underline hover effect to homepage buttons
mariannebourcier Oct 8, 2022
f93108c
Add some styling to profile
mariannebourcier Oct 8, 2022
dfa0cee
Style register run form.
sneham-boop Oct 8, 2022
a251e09
Style sign-in form.
sneham-boop Oct 8, 2022
c2d5495
Make text on run component bold.
sneham-boop Oct 8, 2022
639cb38
Make text on run component bold.
sneham-boop Oct 9, 2022
8b0dd99
Clean up Autocomplete component.
sneham-boop Oct 9, 2022
e1fc844
Clean up components.
sneham-boop Oct 9, 2022
d388317
Add section from find runs page that had disappeared.
sneham-boop Oct 9, 2022
effcf0b
Move navbar links to right; slightly enlarge logo
mariannebourcier Oct 9, 2022
fa3aa8a
Change default profile photo
mariannebourcier Oct 9, 2022
152f8b0
Move homepage nav links to right and resize
mariannebourcier Oct 9, 2022
0dd477a
Add modal for planner runs and place on profile for now
mariannebourcier Oct 9, 2022
b8b2556
Merge pull request #50 from mariannebourcier/feature/run-info-component
mariannebourcier Oct 9, 2022
a50012a
Merge pull request #51 from mariannebourcier/bug/auto-complete
mariannebourcier Oct 9, 2022
6104aa0
Merge pull request #49 from mariannebourcier/styling/navbar
mariannebourcier Oct 9, 2022
c9bb42b
Create modal for planner info window
mariannebourcier Oct 9, 2022
9165081
Merge pull request #52 from mariannebourcier/styling/navbar
mariannebourcier Oct 9, 2022
69dbe8e
Readd form validation to register user form
mariannebourcier Oct 9, 2022
54bec2a
Readd form validation for run creation form
mariannebourcier Oct 9, 2022
d27bba5
Switch to broswer validation for form
mariannebourcier Oct 9, 2022
d095ae6
Clean up forms; use browser validation
mariannebourcier Oct 9, 2022
d978541
Remove planner info from profile
mariannebourcier Oct 9, 2022
2880300
Add logo to joining status component/make it variable.
sneham-boop Oct 9, 2022
b05b19c
Pass text as props to change text on status spinner.
sneham-boop Oct 9, 2022
d160336
Fix bug for width of description affecting layout of run component.
sneham-boop Oct 9, 2022
30c34e4
Fix font size for joining status spinner.
sneham-boop Oct 9, 2022
bd25a20
Fix font size for joining status spinner.
sneham-boop Oct 9, 2022
5f47285
Make profile header responsive for smartphones
mariannebourcier Oct 9, 2022
7e434a0
Merge pull request #53 from mariannebourcier/bugfix/runs-refresh-planner
sneham-boop Oct 9, 2022
c6ef67d
Runs containers responsive
mariannebourcier Oct 9, 2022
adf602f
change profile photo size
mariannebourcier Oct 9, 2022
8db466f
Delete unnecessary line
mariannebourcier Oct 9, 2022
3a7696b
Remove some comments
mariannebourcier Oct 9, 2022
be553bc
Fix logo height.
sneham-boop Oct 10, 2022
d2feea7
Make home page responsive - 600px width.
sneham-boop Oct 10, 2022
3983c80
Make home page responsive - multiple widths.
sneham-boop Oct 10, 2022
92189d3
Merge branch 'master' into fixes/various
mariannebourcier Oct 10, 2022
13b191f
Merge pull request #55 from mariannebourcier/fix/logo-height
mariannebourcier Oct 10, 2022
215b388
Merge pull request #54 from mariannebourcier/fixes/various
mariannebourcier Oct 10, 2022
9f4bc4b
Remove unnessessary variable.
sneham-boop Oct 10, 2022
df7283f
Merge pull request #56 from mariannebourcier/bugfix/remove-variables
sneham-boop Oct 10, 2022
80ffc6c
Change all buttons to match styling
mariannebourcier Oct 11, 2022
60525a0
Change seed data; clean up server file
mariannebourcier Oct 12, 2022
4477c02
Clean up routes file
mariannebourcier Oct 12, 2022
4a6bb40
Remove unused folder
mariannebourcier Oct 12, 2022
07163b8
Change css files path and reorganize folder
mariannebourcier Oct 12, 2022
092bcfc
Reaarange css files
mariannebourcier Oct 12, 2022
6554ab9
Make all files jsx format
mariannebourcier Oct 12, 2022
4d1f6cb
Move images to their own folder and rewrite paths
mariannebourcier Oct 12, 2022
89eb666
Move map components to their own folder and change paths
mariannebourcier Oct 12, 2022
fa5f640
Organize components so they have their own folder
mariannebourcier Oct 12, 2022
a85bd51
Remove unused files
mariannebourcier Oct 12, 2022
94c06f2
Clean hook files
mariannebourcier Oct 12, 2022
f76e9f2
Clean style files
mariannebourcier Oct 12, 2022
e0eacf6
Remove unused packages in front-end, clean files
mariannebourcier Oct 12, 2022
5ecf701
Merge pull request #57 from mariannebourcier/cleanup
sneham-boop Oct 12, 2022
f09ae3b
Change button styles to match other buttons.
sneham-boop Oct 12, 2022
c8994ef
Add screenshots for readme file.
sneham-boop Oct 12, 2022
0273c7f
Delete .DS_Store
sneham-boop Oct 12, 2022
616f883
Edit readme file
mariannebourcier Oct 12, 2022
1873fdd
merging
mariannebourcier Oct 12, 2022
4ce91d6
Edit readme and add pictures
mariannebourcier Oct 12, 2022
3fc899e
Merge pull request #58 from mariannebourcier/readme
sneham-boop Oct 12, 2022
0c5d622
Add image to doc file
mariannebourcier Oct 12, 2022
9c6ea51
Merge pull request #59 from mariannebourcier/readme
mariannebourcier Oct 12, 2022
9ebaaa9
Add new img to readme file
mariannebourcier Oct 12, 2022
382fbd0
Merge pull request #60 from mariannebourcier/readme
mariannebourcier Oct 12, 2022
516a22b
Delete file
mariannebourcier Oct 12, 2022
d1b99da
Readd file
mariannebourcier Oct 12, 2022
2c0e58b
Merge pull request #61 from mariannebourcier/readme
mariannebourcier Oct 12, 2022
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
115 changes: 91 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,113 @@
# React + Express No-Fluff Boilerplate
# Welcome to WeRun
## Final Project for Lighthouse Labs
### Created by Sneha Mahajan (@sneham-boop) and Marianne Bourcier (@mariannebourcier)

A boilerplate project for anyone interested in making a project that uses React and Express.
WeRun is a single page application where users can find running events near them or create new running events for others to join. The goal of this app is to make running more fun and bring together the runners community by having them join events in an interactive way.
This app uses React and Bootstrap on the front-end and Express, PostgreSQL and Node on the back-end. Multiple packages and APIS were used to make the user experience smoother, such as Recoil, Autocomplete and Google Maps. Twilio is currently being used to send users important information via text messaging.

This repository is a bootleg of @NimaBoscarino's [React Rails Boilerplate](https://github.com/NimaBoscarino/react-rails-boilerplate). It uses the same React app, but replaces the Rails server with an Express server.
## Screenshots

Note! This boilerplate has _no fluff_! That means that there's nothing set up for you to do authentication stuff, there's no Redux stuff, and there's no React Router stuff. On the Express end, there is no session storage or database connection.
!["homepage"](https://github.com/mariannebourcier/werun/blob/master/docs/images/homepage.png?raw=true)
This screenshot shows the homepage for WeRun.

The main important bit is that the React project has `proxy` set to `localhost:8080` in the `package.json` file, and that the Express app listens to port 8080 in `server.js`. Take a look!
!["map"](https://github.com/mariannebourcier/werun/blob/master/docs/images/joinARun.png?raw=true)
This screenshot shows a map that centers on the user's current location to allow them to find runs near them more easily.

You can (and perhaps should) rename the directories `express-back-end` and `react-front-end` if you want-- The name doesn't matter.
<img src="https://github.com/mariannebourcier/werun/blob/master/docs/images/markerHoverInfo.png?raw=true" alt="marker-hover" width="50%">

## Running the projects
This screenshot shows the marker for a run and details of the run.

You need **TWO** terminal windows/tabs for this (or some other plan for running two Node processes).
!["run-join"](https://github.com/mariannebourcier/werun/blob/master/docs/images/joiningStatus.png?raw=true)
This screenshot shows what happens when a user hits the join button for a run. The user will also receive a text message confirming their attendance to the event.

In one terminal, `cd` into `react-front-end`. Run `npm install` or `yarn` to install the dependencies. Then run `npm start` or `yarn start`, and go to `localhost:3000` in your browser.
!["available-runs"](https://github.com/mariannebourcier/werun/blob/master/docs/images/availableRuns.png?raw=true)
This screenshot shows which runs are available to join.

In the other terminal, `cd` into `express-back-end`. Run `npm install` or `yarn` to install the dependencies, then `npm start` or `yarn start` to launch the server.
!["createrun"](https://github.com/mariannebourcier/werun/blob/master/docs/images/createRunAutocomplete.png?raw=true)
This screenshot shows the run creation page where users can find the exact location for their run.

In the browser, you can click on the button and see the data get loaded.
!["run"](https://github.com/mariannebourcier/werun/blob/master/docs/images/runCreated.png?raw=true)
This screenshot shows the new run that was created under the user's profile planned tab.

If this doesn't work, please message me!
!["run-details"](https://github.com/mariannebourcier/werun/blob/master/docs/images/runCreatedDetails.png?raw=true)
This screenshot shows the new run's additional details such as the exact route, time and date.

## Next steps
!["profile"](https://github.com/mariannebourcier/werun/blob/master/docs/images/fullProfile.png?raw=true)
This screenshot shows the user's profile with their running statistics as well as a planned and attended tab for them to keep track of their events.

From here, you can start working on your project!
<img src="https://github.com/mariannebourcier/werun/blob/master/docs/images/signIn.png?raw=true" width="50%" alt="signin">

As soon as the dependencies are installed, your Express server can serve JSON and static assets (like images) in response to API calls from the React app. You can get started on developing your React app, routing plan, etc. right away! Any request that isn't handled by React is passed on to the Express server. That means that you can call a route like `/api/users` from React using `fetch`, `axios`, or something else, and Express will receive it as though they originated from the same app. For routing, best practice is to namespace all of your data routes to `/api`, so that they don't clash with other routing schemes, like React Router.
This screenshot shows the sign in page.

At some point, you'll likely want to install and configure a database driver for Postgres or MongoDB-- Refer to past projects for hints on how to do this.
<img src="https://github.com/mariannebourcier/werun/blob/master/docs/images/signUp.png?raw=true" width="50%" alt="signin">

And don't forget to update the README!
This screenshot shows the sign up page.

## Example Projects

You might want to look at examples of projects that have used this boilerplate for hints on how to extend it. Here are a few:
## Dependencies
### Front-End:
- axios
- bootstrap
- dotenv
- google-map-react
- react
- react-bootstrap
- react-datepicker
- react-dom
- react-google-autocomplete
- react-router-dom
- react-scripts
- recoil
- recoil-persist

* [Later Cart](https://github.com/bonitac/later-cart)
* [Buddi.io](https://github.com/Danny-Tran/buddi.io)
### Back-end:
- bcryptjs
- body-parser
- cookie-session
- dotenv
- express
- nodemon
- pg
- twilio

If you'd like your project added to the list, please shoot me a message.
## Getting Started
1. Git clone project.

## Contact
### Front-End:
1. Open the react-front-end folder using the ```cd react-front-end``` command in the terminal.
2. Install all dependencies using ```npm install``` in the terminal.
3. Type the ```npm start``` command.

### Database:
1. Create a .env file in the root of the directory like the .env.example file and add your own database credentials for DB_USER, DB_PASS & DB_NAME
2. Next, we will need to create the database itself. Start PostgreSQL by using the ```psql``` command in your CLI.
3. Create the database using ```CREATE DATABASE your-db-name;``` command, but make sure to use the database name you used for the DB_NAME variable in the .env file.
4. Add tables to the database by typing ```\i db/schema/01_schema.sql``` in the terminal.
5. Add seed data to the database by typing ```\i db/seeds/01_seeds.sql``` in the terminal.

If the database credentials are setup properly, you should be able to connect to the db using \c your-db-name
The database must be initialized with new tables and some seed data next.

A few errors that can occur while setting up a PostgreSQL database:
Role mismatch: Check existing roles for your machine with \du. If your-role you used in the .env file does not exist, it will not show up and you will have to create one with the following command CREATE ROLE your-role WITH SUPERUSER;. Note that your current role must be superuser to be able to create a new role.
Password mismatch: Check how you have set up psql on your machine to sort this one.
Missing .env file: You need a .env file with your own credentials to be able to connect to the database. Use the .env.example file to create the .env file.

### Back-end:
1. Open the express-back-end folder using the ```cd express-back-end``` command in the terminal.
2. Install all dependencies using ```npm install``` in the terminal.
3. Type the ```npm start``` command.




### Future Features
- A button on the planner tab to notify runners of any changes related to the running event, such as cancelation or time change.
- A way for runners to record and track their time, possibly using an API from Fitbit, Strava or Apple Health.
- Allowing users to change their profile picture.

### Known Issues
- The profile picture is a static image from the server.
- The location selection for runs does not calculate automatically the distance between point A and point B yet.
- This application hasn't been tested on other browsers besides Google Chrome yet.

Please contact me on Slack (@garrettgsb) or Nima at `[email protected]` if you have any questions, requests, or feedback, or post an issue to this repo. If you are using the boilerplate, I'd love to hear from you as well!
Binary file added docs/.DS_Store
Binary file not shown.
Binary file added docs/images/.DS_Store
Binary file not shown.
Binary file added docs/images/ProfileDash.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 docs/images/availableRuns.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 docs/images/createRunAutocomplete.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 docs/images/fullProfile.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 docs/images/homepage.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 docs/images/joinARun.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 docs/images/joiningStatus.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 docs/images/kananaskis-run-info.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 docs/images/kananaskisRun.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 docs/images/markerHoverInfo.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 docs/images/runCreated.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 docs/images/runCreatedDetails.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 docs/images/signIn.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 docs/images/signUp.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 express-back-end/.DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions express-back-end/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DB_HOST=localhost
DB_USER=
DB_PASS=
DB_NAME=your_db_name
DB_PORT=5432
TWILIO_ACCTNUM=your_twilio_acct_num
TWILIO_TOKEN=your_twilio_token
TWILIO_PHONENUM=your_phone_number
105 changes: 105 additions & 0 deletions express-back-end/db/queries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
-- users
-- Get all users
SELECT * FROM users;

-- Get user by email
SELECT * FROM users
WHERE users.email = '[email protected]';

-- Get all runners
SELECT * FROM users
WHERE users.runner = TRUE;

-- Get all planners
SELECT * FROM users
WHERE users.planner = TRUE;

-- Create a new user
INSERT INTO users (name, email, password, phone, gender, age, planner, runner)
VALUES ('Jane Doe','[email protected]','password','111-111-1111','F',21,TRUE,TRUE);



-- runs
-- Get all runs - past and future
SELECT runs.id, runs.name, runs.description, runs.location, runs.time, runs.date, runs.planner_id
FROM runs;

-- Get all runs - past
SELECT runs.name, runs.description, runs.location, runs.time, runs.date
FROM runs
WHERE runs.date < CURRENT_DATE;

-- Get all runs - future
SELECT runs.id, runs.name, runs.description, runs.location, runs.time, runs.date
FROM runs
WHERE runs.date >= CURRENT_DATE;

-- Get specific run based on id
SELECT runs.id, runs.name, runs.description, runs.location, runs.time, runs.date
FROM runs
WHERE runs.id = 1;

-- Get all runs for a specific planner
SELECT runs.id, users.id AS planner_id, runs.name, runs.description, runs.distance, runs.date,
(CASE WHEN runs.date >= CURRENT_DATE THEN TRUE
ELSE FALSE
END) AS future_run
FROM runs
JOIN users ON runs.planner_id = users.id
WHERE runs.planner_id = 1;

-- Get all runs for a specific user - planned or participated in NOT FINISHED SO FAR
-- SELECT users.id AS user_id, runs.id AS run_id, runs.name, runs.description, runs.distance, runs.date, users_runs.time, users_runs.rating,
-- (CASE WHEN runs.date >= CURRENT_DATE THEN TRUE
-- ELSE FALSE
-- END) AS future_run,
-- (CASE WHEN (users.planner = TRUE AND users.runner = TRUE AND users.id = runs.planner_id AND users_runs.runner_id = users.id) THEN 'B'
-- WHEN (users.planner = TRUE AND users.runner = FALSE AND users.id = runs.planner_id) THEN 'P'
-- WHEN (users.planner = TRUE AND users.runner = TRUE AND users_runs.runner_id = users.id) THEN 'R'
-- WHEN (users.planner = FALSE AND users.runner = TRUE AND users_runs.runner_id = users.id) THEN 'R'
-- ELSE 'NA'
-- END) AS planned_run_both
-- FROM users
-- FULL OUTER JOIN runs ON users.id = runs.planner_id
-- FULL OUTER JOIN users_runs ON users.id = users_runs.runner_id
-- GROUP BY users.id, runs.id, users_runs.id
-- ORDER BY users.id;

-- Create a run
INSERT INTO runs (name, description, location, distance, time, date, planner_id)
VALUES ('Aberfoyle Park','Great running space full of trees.','212, Aberfoyle St., Aberfoyle, ON, L8T 8T5',5,'10:00:00','2022-05-23',1);



-- users_runs
-- Get all runs for a specific runner
SELECT runs.id, users.id AS user_id, runs.name, runs.description, runs.distance, runs.date, users_runs.time, users_runs.rating,
(CASE WHEN runs.date >= CURRENT_DATE THEN TRUE
ELSE FALSE
END) AS future_run
FROM users_runs
JOIN runs ON runs.id = users_runs.run_id
JOIN users ON users_runs.runner_id = users.id
WHERE users_runs.runner_id = 1;

-- Join a run - only future runs
INSERT INTO users_runs (time, rating, runner_id, run_id)
SELECT 0, 0, 1, 4
WHERE
EXISTS (
-- only future runs can be joined
SELECT *
FROM runs
WHERE runs.id = 4 AND runs.date >= CURRENT_DATE
LIMIT 1
) AND
NOT EXISTS (
-- runs can only be joined once
SELECT *
FROM users_runs
WHERE users_runs.run_id = 4 AND users_runs.runner_id = 1
LIMIT 1
)
RETURNING *;

42 changes: 42 additions & 0 deletions express-back-end/db/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
-- Reset database
-- \i db/schema.sql
-- \i db/seeds.sql
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS runs CASCADE;
DROP TABLE IF EXISTS users_runs CASCADE;

CREATE TABLE users (
id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
phone VARCHAR(255),
gender VARCHAR(255),
age INTEGER,
planner BOOLEAN,
runner BOOLEAN
);

CREATE TABLE runs (
id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(255) NOT NULL,
description VARCHAR(255) NOT NULL,
location VARCHAR(255) NOT NULL,
distance INTEGER NOT NULL,
time TIME NOT NULL,
date DATE NOT NULL,
planner_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
latitude DECIMAL(8,6) NOT NULL,
longitude DECIMAL(9,6) NOT NULL,
location_to VARCHAR(255) NOT NULL,
latitude_to DECIMAL(8,6) NOT NULL,
longitude_to DECIMAL(9,6) NOT NULL
);

CREATE TABLE users_runs (
id SERIAL PRIMARY KEY NOT NULL,
time INTEGER NOT NULL,
rating INTEGER,
runner_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
run_id INTEGER REFERENCES runs(id) ON DELETE CASCADE
);
37 changes: 37 additions & 0 deletions express-back-end/db/seeds.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
-- users
INSERT INTO users (name, email, password, phone, gender, age, planner, runner)
VALUES ('Jane Doe','[email protected]','$2a$10$r9wYh1lcViQBfeIF13wUs.JSD7jdk.l0XLlBdySc.3FW/Z8dM2Z2e','111-111-1111','F',21,TRUE,TRUE),
('John Doe','[email protected]','$2a$10$r9wYh1lcViQBfeIF13wUs.JSD7jdk.l0XLlBdySc.3FW/Z8dM2Z2e','222-222-2222','M',22,FALSE,TRUE),
('Bob Roberts','[email protected]','$2a$10$r9wYh1lcViQBfeIF13wUs.JSD7jdk.l0XLlBdySc.3FW/Z8dM2Z2e','333-333-3333','M',23,TRUE,FALSE),
('Lilly Smith','[email protected]','$2a$10$r9wYh1lcViQBfeIF13wUs.JSD7jdk.l0XLlBdySc.3FW/Z8dM2Z2e','444-444-4444','F',24,FALSE,TRUE);

-- runs
INSERT INTO runs (name, description, location, distance, time, date, planner_id, latitude, longitude, location_to, latitude_to, longitude_to)
VALUES ('Aberfoyle Park','Great running space full of trees. You need the dark in order to show the light. These things happen automatically. All you have to do is just let them happen. You gotta think like a tree.','212, Aberfoyle St., Aberfoyle, ON, L8T 8T5',2,'10:00:00','2022-05-23', 1, 43.952347, -79.431323, '212, Aberfoyle St., Aberfoyle, ON, L8T 8T5', 43.972347, -79.531323),
('Seaside Park','Beautiful view of the sea. We will lay all these little funky little things in there. Pretend you are water. Just floating without any effort. Having a good day. All kinds of happy little splashes.','213, Seaside St., Seaside, BC, K8L 8Y5',10,'10:00:00','2022-12-23', 1, 49.312464, -123.143101, '213, Seaside St., Seaside, BC, K8L 8Y5', 49.254969,-123.2037175),
('Mountain Park','See mountains while you run. Maybe there is a little something happening right here. Think about a cloud. Just float around and be there. It looks so good, I might as well not stop.','412, Mountain St., Mountain, AB, O5Y 8F7',5,'09:00:00','2022-08-12',3, 50.979643, -114.098084, '412, Mountain St., Mountain, AB, O5Y 8F7', 50.979643, -114.098084),
('Hidden Park','Quaint area far from the city hustle and bustle. Let your heart be your guide. Everything is not great in life, but we can still find beauty in it.','432, Hidden St., Hidden, QC, W4R 5T8',5,'08:00:00','2022-11-10',3, 45.499262,-73.570682, '432, Hidden St., Hidden, QC, W4R 5T8', 45.5118111,-73.695578),
('New Park','New surroundings. The light is your friend. Preserve it. Every single thing in the world has its own personality - and it is up to you to make friends with the little rascals.','432, New St., New, QC, W4R 5T8',10,'08:00:00','2022-8-10',3, 45.501836, -73.593265, '432, New St., New, QC, W4R 5T8', 45.501836, -73.593265 ),
('Gargoyle Park','Great running space full of trees. I spend a lot of time walking around in the woods and talking to trees, and squirrels, and little rabbits and stuff. Just let these leaves jump.','212, Gargoyle St., Gargoyle, ON, L8T 8T5',5,'10:00:00','2023-11-23',1, 43.696061, -79.354618, '212, Gargoyle St., Gargoyle, ON, L8T 8T5', 43.6465479,-79.603766),
('Bench Park','Beautiful view of the sea. Have fun with it. Everyone is going to see things differently - and that is the way it should be.','213, Bench St., Bench, BC, K8L 8Y5',5,'10:00:00','2023-12-23',1,49.313020, -124.212467, '213, Bench St., Bench, BC, K8L 8Y5', 49.1735987,-124.0967019 ),
('Kananaskis Park','See mountains while you run. Just go out and talk to a tree. Make friends with it. All you have to do is let your imagination go wild.','412, Little Lougheed, Kananaskis, AB, O5Y 8F7',5,'09:00:00','2023-08-12',3,50.953012, -115.315435, '514, Little Lougheed, Kananaskis, AB, O5Y 8F7', 50.8899495,-115.3338652 ),
('Forillon Park','Quaint area far from the city hustle and bustle. Go out on a limb - that is where the fruit is. Be brave. There is immense joy in just watching - watching all the little creatures in nature.','432, Greens St., Greens, QC, W4R 5T8',5,'08:30:00','2023-11-10',3,48.815195, -64.271882, '432, Greens St., Greens, QC, W4R 5T8', 48.7938742,-64.2611792 ),
('Sentier des Dunes','New surroundings. That is when you can experience true joy, when you have no fear. We will paint one happy little tree right here. Be so very light. Be a gentle whisper.','432, Blue St., Quebec, QC, W4R 5T8',2,'08:00:00','2023-8-10',3, 46.998819, -71.191848, '432, Blue St., Quebec, QC, W4R 5T8', 48.1593378,-69.6794241),
('Gibbons Park','Great running space full of trees. You have got to learn to fight the temptation to resist these things. Just let them happen. Work that paint. Just beat the devil out of it.','212, Smile St., London, ON, L8T 8T5',10,'10:00:00','2023-05-23',1, 42.998326, -81.259929, '212, Smile St., London, ON, L8T 8T5', 42.9649031,-81.3579601),
('Wild Side Trail','Beautiful view of the sea. We spend so much of our life looking - but never seeing. This is your world, whatever makes you happy you can put in it. Go crazy. Use absolutely.','213, Wild St., Wild, BC, K8L 8Y5',5,'10:15:00','2023-12-23',1, 49.266271, -126.055370, '213, Wild St., Wild, BC, K8L 8Y5', 49.2662579,-126.0752572),
('Old Fort Point','See mountains while you run. It is so important to do something every day that will make you happy. Maybe there is a happy little waterfall happening over here. These things happen.','412, Dog St., Jasper, AB, O5Y 8F7',2,'09:00:00','2023-08-12',3, 52.871019, -118.061465, '412, Dog St., Jasper, AB, O5Y 8F7', 52.8789656,-118.1053982),
('Promenade de la Gorge Magog','Quaint area far from the city hustle and bustle. Let us make a nice big leafy tree. Almost everything is going to happen for you automatically - you do not have to spend any time.','432, High St., Sherbrooke, QC, W4R 5T8',5,'08:00:00','2023-11-10',3, 45.401880, -71.899518, '432, High St., Sherbrooke, QC, W4R 5T8', 45.4158576,-71.9524829 ),
('Third Vault Falls','Let us make a nice big leafy tree. Almost everything is going to happen for you automatically - you do not have to spend any time working or worrying.We have a fantastic little sky!','432, 114 St., Bay of Fundy, NB, W4R 5T8',2,'08:00:00','2023-12-10',3, 45.617307, -65.024755, '432, 114 St., Bay of Fundy, NB, W4R 5T8', 45.6247906,-65.0960219);


-- users_runs
INSERT INTO users_runs (time, rating, runner_id, run_id)
VALUES (45, 4, 1, 1),
(60, 5, 2, 1),
(0, 0, 1, 2),
(0, 0, 2, 2),
(0, 0, 4, 2),
(89, 5, 1, 3),
(0, 0, 2, 4),
(0, 0, 4, 4);

Loading