- You can view this app live at: https://nimsum.github.io/connect-four-fe/
- Checkout the backend API for this app at: https://github.com/NimSum/connect-four-be
This app was created for anyone to play and chat connect four with their friends and other users! It features account creation/login/anonymous login to tailor user login preferences. It also has a world chat feature and it allows users to create a public/private game room for them to play Connect 4 and chat!
If you'd like to clone this repository to your own local machine, run the following commands in your terminal:
https://github.com/NimSum/connect-four-fe.git
Then for each repo, run the following command to install dependencies:
npm install
To view the app in action, run the following command in your terminal for the front-end:
npm start
Then, go to http://localhost:3000/
in your browser to see the code running in the browser.
If you already have an account, simply login with your email and password. If you would like to create an account, click "Create account and fill in the forms, please try not to forget your secret phrases or save them as they are needed to retrieve your account in case of you forget your password.
For anonymous login, simply click "Anonymous Login" and type in a 3-15 character name then login. Please note that you will not be able to recieve access to the other features of the app that requires a user account.
- Click 'New Room' located on the top right corner of "Available Rooms Box".
- A dialog will appear, type in a 3-35 character Room Name (Password is optional) and then click "Create".
- Once created, you will be placed in a game "room" where you will wait for your opponents to join. Note: You can easily leave the game room and join other rooms.
- If there are rooms available, click the "Join" button on the Room Card For Locked Rooms:
- A lock icon appears for rooms that are private and REQUIRES a password to join
- To join a locked room, click the "Join" button and a password input will appear. Type the password then click "Join" again.
- Select a color for your chip. This step is optional because if you do not select, it will randomly choose a color for you.
- Press "Ready?" button.
- Once you and your opponent are ready, the game will begin and the app will bring you to the game!
Once you're in a game, a random player will be selected to go first!.
- If it's your to "chip" in... ha! it will indicate on the top of the connect 4 grid and the bottom slot will be bright white else it will be your opponent and the bottom slot will be grayed out.
- To place your "chip" click the "+" button in the middle of the chip.
- Play until someone loses!
- When a player wins, the waiting room re-appears and you have the option for a rematch!
- Your stats are updated automatically if you are signed in with an account. Note: Leaving a match automatically forfeits the game.
To give myself a better understanding of how the layout and UI/UX would be, I created a simple Figma wireframe for the login, home, and active game pages. This gave me guidance as to how I would develop the UI/UX.
- Improve smaller device UI
- Friends
- Custom Friends Chat
- Achievements
- Invite Player to hidden room
- Emojis(What kind of chat app has no emojis these days?)
I created this app to challenge myself to learn new technologies such as Material UI and Socket.io(client). The complexity of the front-end allowed me to dive deeper into more complex Redux state management. I also gained a deeper understanding of the new React hooks API such as useEffect(different lifecycles), useState, useRef, and useCallback.
- Material UI
- UI design
- React w/ Redux & Router
- Javascript(Async, ES6)
- Socket.io
- Enzyme & Jest testing