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

Game over page #162

Open
wants to merge 128 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
01ece78
set css for the App.js
mhosseinsafi Oct 17, 2023
7bc6bef
add new font
mhosseinsafi Oct 17, 2023
2e7e0f3
add fake data to json file
mhosseinsafi Oct 17, 2023
d8f6eb5
edit .css import in index.js
mhosseinsafi Oct 17, 2023
93fa1c8
initial homepage
mhosseinsafi Oct 17, 2023
f3a3fde
add package-lock.json
mhosseinsafi Oct 17, 2023
8c70346
add QuizJs logo
mhosseinsafi Oct 17, 2023
fef7c81
add QuizJs logo to homepage
mhosseinsafi Oct 17, 2023
3f18a7b
add new Logo
mhosseinsafi Oct 17, 2023
e64b8f8
add path for the Logo
mhosseinsafi Oct 17, 2023
954348f
create components
mhosseinsafi Oct 17, 2023
6112bf1
move function to home.js component
mhosseinsafi Oct 17, 2023
454271d
change the path for the image
mhosseinsafi Oct 17, 2023
f762f1b
schema file made seeds started
ryanstew95 Oct 18, 2023
b51a45b
npm install router dom
mhosseinsafi Oct 18, 2023
bb3c244
add routes
mhosseinsafi Oct 18, 2023
5f7d0fb
add navigation to instruction page
mhosseinsafi Oct 18, 2023
8771bda
add image-css file-back navigation
mhosseinsafi Oct 18, 2023
028feb9
writing outline for questions for round one
ryanstew95 Oct 18, 2023
f5943f6
merge master to my database branch
ryanstew95 Oct 18, 2023
afbd036
Merge pull request #1 from ryanstew95/home_page
mhosseinsafi Oct 18, 2023
131d20c
working on round two questions
ryanstew95 Oct 18, 2023
26e1825
merge with master
ryanstew95 Oct 18, 2023
2c9efe2
working on questions for round two
ryanstew95 Oct 18, 2023
593686e
finished outline for questions
ryanstew95 Oct 18, 2023
8134636
started seeds for question table
ryanstew95 Oct 18, 2023
1b85ea5
editing questions
ryanstew95 Oct 19, 2023
6141fa5
add testing-library package, add tests for leaderboards
nickstilwell52 Oct 19, 2023
9b29130
finishing up questions outline
ryanstew95 Oct 19, 2023
8e24a30
add mock data
ychento Oct 19, 2023
812221b
ready to work on seed02 file
ryanstew95 Oct 19, 2023
336f05b
added how to play to instruction page
ryanstew95 Oct 20, 2023
b23a3fc
database made and connected
ryanstew95 Oct 20, 2023
9394575
made backend route to test if the db connection worked
ryanstew95 Oct 20, 2023
a9c305e
api for game table done
ryanstew95 Oct 20, 2023
c04efec
replace hard coded leaderbaord with scores from the db
ryanstew95 Oct 20, 2023
dbe3ed5
ordered the scores from highest to lowest
ryanstew95 Oct 20, 2023
defa3e3
deleted consolelog for debugging and imports that was not being used
ryanstew95 Oct 20, 2023
6ed16ee
Merge pull request #2 from ryanstew95/tests/leaderboard
nickstilwell52 Oct 20, 2023
97784ba
merge
ryanstew95 Oct 20, 2023
5c44976
Merge pull request #3 from ryanstew95/back-end
ryanstew95 Oct 20, 2023
d7166a0
fixing merge confilt mistake
ryanstew95 Oct 20, 2023
1f2f085
Merge pull request #4 from ryanstew95/ryan
ryanstew95 Oct 20, 2023
4c4e9a3
fixed seed and schema issues
ryanstew95 Oct 21, 2023
291ca2d
template for game started
ryanstew95 Oct 21, 2023
4a40791
working on quiz features
ryanstew95 Oct 21, 2023
6e4782e
worked on quiz logic
ryanstew95 Oct 21, 2023
bef4d5c
added back to home button
ryanstew95 Oct 21, 2023
138e1d6
front end for last page
ryanstew95 Oct 21, 2023
1d69c18
added some styling to quiz
ryanstew95 Oct 21, 2023
9cf8dae
made game layout bigger
ryanstew95 Oct 21, 2023
1185577
added image for when you get a question right
ryanstew95 Oct 21, 2023
067f657
create the game page with function of showing choices and select answer
ychento Oct 21, 2023
128eb89
add basic css code for game page
ychento Oct 21, 2023
08ffc6b
add /game route
ychento Oct 21, 2023
d4452e0
add route
ychento Oct 21, 2023
ddc7156
change set time out from image and route for game to quiz
ryanstew95 Oct 23, 2023
b432acf
Merge pull request #5 from ryanstew95/quiz2
ryanstew95 Oct 24, 2023
75e5004
is working with db but correct asnwer is not being handle correctly
ryanstew95 Oct 24, 2023
fa40727
is working but now it going thought every question instead of showing…
ryanstew95 Oct 24, 2023
a4c6d13
revert changes untill got back to working state
ryanstew95 Oct 24, 2023
86dc73c
add game function
ychento Oct 24, 2023
230d698
edit code
ychento Oct 24, 2023
4b4b5ad
Merge branch 'master' into game_page
ychento Oct 24, 2023
2781357
got random question for every playthought to work
ryanstew95 Oct 25, 2023
ac31cc9
Merge pull request #6 from ryanstew95/refactoring2
ryanstew95 Oct 25, 2023
9239b43
data of players name and score is being logged but not displayed yet
ryanstew95 Oct 25, 2023
8943aff
submit form at the end is now working
ryanstew95 Oct 26, 2023
ddd8417
only 20 scores display at one time on front page now
ryanstew95 Oct 26, 2023
b59edf4
tryed to add a command to reset the db then reverted changes
ryanstew95 Oct 26, 2023
f2e4f32
added handling for scoring:
ryanstew95 Oct 26, 2023
18d9252
added a reset db command
ryanstew95 Oct 26, 2023
dc9e631
Merge pull request #7 from ryanstew95/last_page2
ryanstew95 Oct 26, 2023
a406df0
merge
ryanstew95 Oct 26, 2023
6b8f88f
fix the back-end and front-end data sync issue
ychento Oct 26, 2023
e974311
Merge branch 'master' into timer
ychento Oct 26, 2023
7d3ff30
your time is displayed on the last page
ryanstew95 Oct 26, 2023
c791013
add timer function in quiz page
ychento Oct 26, 2023
fb9d57f
added a thumb down dude
ryanstew95 Oct 26, 2023
e31d883
added dude image to front page
ryanstew95 Oct 27, 2023
55e1c13
rounds and instruction page
ryanstew95 Oct 27, 2023
0a40f41
reverted round changes and cleaned up code
ryanstew95 Oct 27, 2023
7f4f659
skip,fiftyfifty,switch
mhosseinsafi Oct 28, 2023
59e3ad4
new commit
ryanstew95 Oct 28, 2023
1f85212
Merge pull request #8 from ryanstew95/ryan2
ryanstew95 Oct 28, 2023
d141ca2
working on round issues and debugging
ryanstew95 Oct 29, 2023
427148a
got rounds working again
ryanstew95 Oct 29, 2023
be57241
fixed uncaught promise error
ryanstew95 Oct 29, 2023
86cd5e0
removed hint emoji
ryanstew95 Oct 29, 2023
fd81cae
fixing hidden errors
ryanstew95 Oct 29, 2023
0ffb62e
changed wording for instruction page
ryanstew95 Oct 29, 2023
35288ab
added ul emelments to instruction page
ryanstew95 Oct 30, 2023
4fdd00b
working on validations for nicknames
ryanstew95 Oct 30, 2023
60ac606
Merge pull request #9 from ryanstew95/ryan3
ryanstew95 Oct 30, 2023
80adb08
can not add blank nicknames and ones to small or large
ryanstew95 Oct 30, 2023
412a7b3
handle 50/50 functionality
mhosseinsafi Oct 30, 2023
8cf087b
handle skip and 50/50 functionality
mhosseinsafi Oct 30, 2023
452d2fb
Validations for nickname
ryanstew95 Oct 30, 2023
7ee681f
merge with master
ryanstew95 Oct 30, 2023
0823caf
fixed warning in console, delete hint emjoi and settime out for dude
ryanstew95 Oct 30, 2023
3e5ec41
Merge pull request #10 from ryanstew95/nickname-testing
ryanstew95 Oct 30, 2023
5d1df75
add sound functionality
nickstilwell52 Oct 30, 2023
0892eae
Merge pull request #11 from ryanstew95/feature/sound
nickstilwell52 Oct 30, 2023
82ac4b7
added thinking dude to quiz
ryanstew95 Oct 30, 2023
87c145a
fixed last score not updating to congrads page problem
ryanstew95 Oct 31, 2023
cc76cd2
Merge pull request #12 from ryanstew95/ryan4
ryanstew95 Oct 31, 2023
e4eb7e3
Merge branch 'master' into timer
ychento Oct 31, 2023
d55c134
styling front page
ychento Oct 31, 2023
af793d3
edit css code for quiz page - choices
ychento Oct 31, 2023
18e3585
updated readme
ryanstew95 Oct 31, 2023
1b29f4c
Merge pull request #13 from ryanstew95/tuesday
ryanstew95 Oct 31, 2023
3af498e
Merge branch 'master' of github.com:ryanstew95/final_project
ychento Oct 31, 2023
5d626ba
added question counter
ryanstew95 Oct 31, 2023
77b4a3c
Merge branch 'master' into tuesday
ryanstew95 Oct 31, 2023
07e9306
fixed styling on pages
ryanstew95 Oct 31, 2023
b5a7284
Merge pull request #14 from ryanstew95/tuesday
ryanstew95 Oct 31, 2023
6acf858
moved image over and added question counter
ryanstew95 Oct 31, 2023
16ef0d0
Merge pull request #15 from ryanstew95/tuesday
ryanstew95 Oct 31, 2023
a15e2a3
added some styling to the front and instructions page
ryanstew95 Oct 31, 2023
ba5a8be
added styling to front page
ryanstew95 Nov 1, 2023
56183bc
Merge pull request #16 from ryanstew95/wednesday
ryanstew95 Nov 1, 2023
d7de2e3
merge
ryanstew95 Nov 1, 2023
a053d34
add css normalizer
nickstilwell52 Nov 1, 2023
7a349b2
merge
ryanstew95 Nov 1, 2023
b544156
added a header components for logo description and mute button
ryanstew95 Nov 1, 2023
b33c02f
Merge pull request #17 from ryanstew95/wednesday
ryanstew95 Nov 1, 2023
39b8322
create new game over page when time is out or lives are out
ychento Nov 2, 2023
046cba1
Merge branch 'master' of github.com:ryanstew95/final_project
ychento Nov 2, 2023
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
Binary file added .DS_Store
Binary file not shown.
92 changes: 68 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,90 @@
# React + Express No-Fluff Boilerplate
![quizjs](react-front-end/src/asset/THELOGO.png)
![quizjs](react-front-end/src/asset/smaller-dude.png)
## Final Product

A boilerplate project for anyone interested in making a project that uses React and Express.
### Home Page
photo of home page

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.
### Instruction Page
photo of instruction page

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.
### Quiz Page
photo of quiz page

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!
### Congrads Page
photo of congrads page

You can (and perhaps should) rename the directories `express-back-end` and `react-front-end` if you want-- The name doesn't matter.
## Getting Started

## Running the projects
1. Create database in PostgreSQL called quiz_app_
2. Create the `.env` by using `.env.example` in the back-end folder
3. Update the .env file with your correct local information
- username: `labber`
- password: `labber`
- database: `quiz_app`
4. Install dependencies on both the front and back-end: `npm i`
5. Reset database: `node reset-database.js`
6. cd into back-end folder, Run the server: `npm run go`
7. cd into front-end folder, Run the client: `npm start`
8. Visit http://localhost:3000/

You need **TWO** terminal windows/tabs for this (or some other plan for running two Node processes).
## Navigating the app

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.
### Home page
- On the home page you see the top 20 high scores
- You can hit play to start the quiz or look at the Instructions page

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.
### Instructions page
- On this page you learn how to play and how the point system works

In the browser, you can click on the button and see the data get loaded.
### Quiz page
- This page is the game it's self
- Here you answer questions, earn points, and use hints if you stuck
- You score is being recorded as you go along
- How long you take to complete the quiz is also being recorded

If this doesn't work, please message me!
### Congrads Page
- This is where you will see your score and final time
- You enter in a nickname
- if you scored high enough your score will be added to the leader board

## Next steps
## How to Reset the database

From here, you can start working on your project!
- Use the `node reset-database.js` command in the back-end each time there is a change to the database schema or seeds.
- It runs through each of the files, in order, and executes them against the database.
- Note: you will lose all newly created (test) data each time this is run, since the schema files will tend to `DROP` the tables and recreate them.

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.
## Dependencies

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.
- axios: 0.18.1
- react: 16.8.6
- react-dom: 16.8.6
- react-router-dom: 6.17.0
- react-scripts: 2.1.8
- body-parser: 1.20.2
- chalk: 4.1.2
- cors: 2.8.5
- dotenv: 16.3.1
- express: 4.18.2
- fs: 0.0.1-security
- knex: 3.0.1
- nodemon: 1.18.7
- pg: 8.11.3
- whatwg-fetch: 3.6.19

And don't forget to update the README!
## Starting the server and the client

## Example Projects
1. Run the server: `npm run go`
2. Run the client: `npm start`
3. Visit: http://localhost:3000/

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:

* [Later Cart](https://github.com/bonitac/later-cart)
* [Buddi.io](https://github.com/Danny-Tran/buddi.io)
## The team

If you'd like your project added to the list, please shoot me a message.
- Nick Stilwell: https://github.com/nickstilwell52

## Contact
- Yiyao Chen: https://github.com/ychento

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!
- Hossein Safi: https://github.com/mhosseinsafi

- Ryan Stewart: https://github.com/ryanstew95
7 changes: 7 additions & 0 deletions express-back-end/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DB_HOST=
DB_USER=
DB_PASS=
DB_NAME=
DB_PORT=
DB_SSL=
DATABASE_URL=
Loading