A user with some free time wants a fun and quick mental warm-up to improve memory.
Users should be able to:
- Sign up to become a user
- Log in to the application to access the game
- Play the card matching game from start to completion
- Add their game stats to the database upon completion (including best time and highest level)
- React: the app uses embedded javascript to render information on the page
- React-Router: to couple URL segments to UI elements
- Node & Express: the app has its own server, built using Express
- MVC Pattern: the app uses the Model View Controller (MVC) programming design pattern
- MongoDB: the app persists data via a non-relational database for ease of application development and timing.
- Mongoose: to model and query data in MongoDB through Node
- Tailwind.css: The app is efficiently well-designed and considers user experience and usability
- JavaScript: the app has front-end interactivity
- Axios: the app uses isomorphic-fetch to make XMLHttpRequests from the browser and to make http requests from node.js (back-end)
- JSON Web Token: is used to create an authentication strategy for the app
- Bcrypt: the app uses bcrypt to encrypt user passwords
- Postman: to test server requests
- Vite: for a fast modern development environment
- Created project brief
- Constructed wireframes to gain an understanding of the flow of the app.
- Drew out schema for user database
- Set up the team Trello board with a list of steps to completion for SCRUM
- Created team Github Org for Github Flow workflow
- Scaffolded project using Vite
- Created and started local server
- Created model, controller, and route architecture
- Tested requests in PostMan
- Created React components
- Styled components using Tailwind.css
Applying a limited number of images to any number of card pairs:
const imgArr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
const assignImgHelper = (imgArr, numArr) => {
const uniqueNums = [...new Set(numArr)];
const obj = {};
for (let i = 0; i < uniqueNums.length; i++) {
obj[uniqueNums[i]] = imgArr[i % imgArr.length];
}
return obj;
};
const startGame = (e) => {
e.preventDefault();
setGameStarted(true);
const totalCards = gridSize * 2;
const pairCount = Math.floor(totalCards / 2);
const numbers = [...Array(pairCount).keys()].map((n) => n + 1);
const shuffledCards = [...numbers, ...numbers]
.sort(() => Math.random() - 0.5)
.slice(0, totalCards);
const imageAssign = assignImgHelper(imgArr, shuffledCards);
const newShuffledCards = shuffledCards.map((number, index) => ({
id: index,
number,
letter: imageAssign[number],
}));
setBoard(newShuffledCards);
};- Michael
- authentication logic
- connecting backend and front end with authcontext
- Aaron
- connecting front end and back end using routes
- protecting routes and redirecting unauthorized users
- Lisa
- game logic
- Tailwind syntax
- responsive mobile-first design
- Run
npm installto install all necessary dependencies listed in the package.json - Create a
.envfile in the root. You'll need to have aMONGO_URIto connect to your MongoDB and aJWT_SECRETto create and validate user tokens (authentication). - To launch the app locally run
npm run devfrom the root folder and navigate to localhost:5173 in your browser.
- a user can cheat the game by inspecting the page. If two cards have the same
cardImageclass, they are a match.
- Style
- style timer
- add dark-mode styling
- add back-of-card textured image
- make the project more responsive
- Feature
- add multiple levels to game
- create a 404 page
- create leaderboard page and route
- add background music with volume controls
- create hamburger menu for game controls
- create the option for a two-player game




