ivangreene / crushnote Goto Github PK
View Code? Open in Web Editor NEWReact + Node web implementation of the "Love Letter" card game
License: MIT License
React + Node web implementation of the "Love Letter" card game
License: MIT License
express-session
is set up and ready to handle authorizing users.
Due to limitations of socketio, we can only instantiate a session within an express route and not within a socketio event handler.
I think we should accept the username/password in a route, and then if the authentication is successful, assign a userid in req.session.userid
or something like that, so that we will have it available in socket.request.session
. Maybe we should define what authorization details should look like in a new Wiki page.
We need to do some reorganization of the structure of server-side code, find some better naming conventions, and decide what should be a controller and what should be an abstraction of the ORM.
I think it will be easiest if one person takes this task on, and we do it at a time when we can collate different branches from a good working point, and put this into master
so people can base future branches on this new structure.
I'm willing to take this on today and tomorrow, and please leave any suggestions in the comments here.
I'd like everyone to submit pull requests of their latest work sometime today so I can merge everything we have and then work from that base.
Routing of all players when game end is triggered.
Make this process look better.
Login page: alert user and prevent redirect to main screen if user creates a new user (email, password, name) that is invalid.
???
Write tests for engine/game.js
.
This was working on gameRooms branch yesterday. Double check it works again.
On the login page: alert user and prevent redirect to main screen if user enters wrong username/password.
Make rounds end when end conditions are met and assign a winning value for the ROUND (not the game) to winning user.
Tentative models: Users(+Stats), Active Games, Chats.
May be possible to merge Active Games and Chats.
Remove Start Game, Join Game.
Move others and make them pretty.
On game end, delete game from database.
component to make:
Card Container
Card view (with card info)
Cheatsheet Card (with card summary/class count)
Card in play/out of play?
Private card alert
Add a React project as a subdirectory client
within the main project directory.
Using provided round end information (@ivangreene will work on that, I think) display the correct number of hearts to each 'playerMount' component.
Review of project management tool
- who has done what, what has been completed and is still left
- where we are from our app workflow submission to presentation
- attempt to be 75% of the way done with app
Working, unpolished app ON THE WEB (Heroku?)
Mini-presentation.
A decision needs to be made on the front end visual framework to be used. Good candidates should either be purely CSS, or be component based and integrate well with React.
A few possibilities:
Material Design - https://material.io/ - or possibly the React component based Material UI http://www.material-ui.com/#/
Bulma - https://bulma.io/
Pure.css - https://purecss.io/
Make it percent width so it can be closed on smaller width browsers.
For guard card selection, gray out/deselect guard card and and close 'show cards' when a card is clicked.
List of what we still need to make available to the frontend as API routes:
/api/games?open=true
/api/games?playerOrder=<userId>
Write tests to check mongoose calls in lib/gamesDbCalls.js
and lib/usersDbCalls.js
.
We need to determine what is the smallest but complete representation of a Game State as an object, and begin to build an "engine" that will accept a description of a move, and return a new state based on the previous state.
This engine should be the point where invalid moves are rejected, although the front end should be aware of the rules enough not to let a player try an invalid move.
I think that a series of pure "reducer" functions would work best for this.
I've outlined my initial draft for what a game state would need to look like in the Wiki: https://github.com/ivangreene/crushnote/wiki/Game-State
I'll continue working on this today and begin to build the "engine", and please let me know if I'm missing any integral parts that need to be accounted for.
Make them pretty.
It's available to use for the front-end in React as the socket.io-client
package.
Don't display 'playerMount' component if the respective user is not in game.
To move forward with development, our React app will need some serious refactoring and cleanup.
I suggest that we have a meeting discussing the architecture that the app will need to have, and layout a basic structure of components that need to be built.
The current app gives us a rough idea of what it will look like, but the structure is hard to follow. We will have a better time developing it to handle gameplay and dynamic state after a refactoring.
Add dev dependencies for testing, make sure tests run when using yarn test
, add a basic sanity test to check testing setup works.
Configure an Express server
Suggestions:
npm-run-all
as a tool to run both the React webpack server and express server
nodemon
to watch for file changes
node-sass-chokidar
for styles
main page: correct game display to only show number of players once and display creator's name
Write a Wiki page roughly drafting the API routes needed
Establish React game state that emits & accepts changes.
If active player is current user, then border is blue. If active player is an opponent, then border is green.
'newGame'
- requires authentication'gameMove', gameId, move
/api/games?open=true
'joinGame', gameId
'startGame', gameId
need to pass an empty function. it never needs to be clicked
Find a good way to persist a session and share its data between express and socket.io.
Make it prettier. @jdlehne knows what he wants it to look like, I hope.
Use game.open to determine whether to show it or not.
Connect user info to game view and display user names in correct locations on screen.
Make game end when a player has won correct number of rounds. According to the rules, rounds needed are different based on number of players.
2 players: 7 rounds
3 players: 5 rounds
4 players: 4 rounds
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.