Compare commits

..

7 Commits

Author SHA1 Message Date
8e1ead37e6 Allowing proxying for secure cookies. 2022-04-09 18:46:18 -05:00
450fcfeb5a Server start command fixed.
Environment variable encapsulated within quotes.
2022-04-09 15:56:31 -05:00
f65fbd70aa Fixed unset mongodb uri environment variable. 2022-04-08 13:26:31 -05:00
Arjun Sahni
1c704cb606
Merge pull request #10 from csc309-winter-2022/develop
Develop
2022-04-07 23:01:46 -04:00
Arjun Sahni
24f085e17a
Update README.md 2022-04-05 21:59:20 -04:00
fdbd372430 Merge branch 'main' of https://github.com/csc309-winter-2022/team58 2022-04-05 20:54:46 -05:00
Piyush Sharma
096eadce13
Update README.md 2022-04-05 21:45:01 -04:00
6 changed files with 20 additions and 8 deletions

1
.gitignore vendored
View File

@ -165,3 +165,4 @@ dist
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,node # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,node
**/server/public/**

View File

@ -4,13 +4,13 @@ Sports Matcher is an application that allows users to connect with other athlete
**Built Using** **Built Using**
It is built using the React framework and the Material UI and React Bootstrap libraries. It is built using the React framework and React Bootstrap library. It uses MongoDB for the database, Express for the server, and Axios for requests.
**Instructions** **Instructions**
To use Sports Matcher, navigate to the sports-matcher directory in the repository and run the commands `npm i` and `npm start` in order. This should launch a localhost window in your browser which shows the homepage. To use Sports Matcher, please go to https://hidden-bayou-86321.herokuapp.com
From here you can Sign In to your account using the username "admin" and password "admin" OR using the username "user" and password "user" as specified in the handout. From here you can Sign In or Sign Up.
Signing in as 'admin' will take you to the admin page. You will be able to see a list of current matches, users and suspended users. You will need to click the appropriate button for the correct table to appear. Signing in as 'admin' will take you to the admin page. You will be able to see a list of current matches, users and suspended users. You will need to click the appropriate button for the correct table to appear.
@ -18,4 +18,14 @@ Every page has a navbar at the top. There is a chat and profile icon. Clicking o
**Functionality**
Our app has a fully functioning backend which supports the CRUD functionality for the following entites
1. We have a User entity which has the following attributes: Name, Email and Password, Sports and levels, Griends, Auth level, and suspended status
2. We have a Match which supports the following attributes: Players, Date, Sport and skill, and Location
We also support searching the database for the above entites.
1. Matches can be searched for. They can be sorted and filtered based on location, friends, skill level and date.
2. Users can also be searched for

View File

@ -18,7 +18,7 @@
}, },
"scripts": { "scripts": {
"start": "NODE_ENV='development' REACT_APP_API_HOST='http://localhost:5000' react-scripts start", "start": "NODE_ENV='development' REACT_APP_API_HOST='http://localhost:5000' react-scripts start",
"build": "../scripts/build.py", "build": "python3 ../scripts/build.py",
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },

2
sports-matcher/scripts/build.py Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
import os import os
import shutil import shutil

View File

@ -14,6 +14,7 @@ const sessionConf = {
}; };
if (process.env.NODE_ENV === "production") { if (process.env.NODE_ENV === "production") {
sessionConf.cookie.secure = true; sessionConf.cookie.secure = true;
sessionConf.proxy = true;
sessionConf.store = MongoStore.create({ mongoUrl: mongoURI, dbName: mongooseDbName }); sessionConf.store = MongoStore.create({ mongoUrl: mongoURI, dbName: mongooseDbName });
} }
export const userSession = session(sessionConf); export const userSession = session(sessionConf);

View File

@ -7,7 +7,7 @@
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
"develop": "NODE_ENV=development nodemon server.js", "develop": "NODE_ENV=development nodemon server.js",
"start": "NODE_ENV=production node server.js", "start": "NODE_ENV=production MONGODB_URI='mongodb+srv://sports-matcher:PFebEO0btV91HjwF@cluster0.bow9f.mongodb.net/myFirstDatabase?retryWrites=true&w=majority' node server.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "", "author": "",