- William Rodriguez
- James Fox
- Marcus Lorenzo
- Mark McConnell
This is a full stack application that uses prisma and postgresql for the backend, node/express for the server, and react for the front-end and is written using typescript.
This is a web application that will allow a group of users to play a lovecraftian-styled hidden role game. It largely based off the popular games of Mafia, Werewolf and The Townspeople. The objective of the game is for the cultists to “kill” investigators until they are the majority, or for the investigators to kill off all the cultists. When one of those two things happens, the game is over and the respective faction wins!.
- Basic game default settings
- Game logic decides roles based off of the amount of players
- A Help section and or tutorial for first time players
- A flowchart of the game and how to win(Readme)
- A user should be able to host a game
- A user should be able to join a game with an access code
- A clean & easy UI to interact with
- A manual "ready" button to move game forward
- A tooltip for roles to help remind players what their role can/can't do
- A group of users should be able to successfully start and complete a game
[] A simple tutorial toggle with persisted user preferences [] Customizable settings [] Mini games between rounds [] SMS/Email invites [] A timer [] Custom Themes [] In-game communication/Chat
- React
- React Query
- React Router
- Typescript
- Socket.IO
- Prisma
- PostgreSQL
- ExpressJs
- Express-Session
- Prisma-session-store
- ViteJS
- Nodemon
- Fly.IO
- Swagger-ui-express
- Please ensure you have the latest version of NodeJs and PostgreSQL
- Clone this repository https://github.com/eyecuelab/mafia-lite locally
- Navigate to the root folder
mafia-lite
and thencd api
and runnpm install
and thencd client
and runnpm install
. - See below for required .env files
- You will also need to have your database setup in PostgreSQL
- To ensure the prisma schema has been updated to PostgreSQL, Run a migration to create your database tables with Prisma Migrate:
npx prisma migrate dev --name init
npm run seed
to seed the database with the default roles
- Also, Prisma Studio is a visual editor for the data in your database.
- Run
npx prisma studio
in your terminal.
- Run
- In the
/api
directory, create an .env file and insert the following:DATABASE_URL="postgresql://postgres:yourPasswordGoesHere@localhost:5432/yourDatabaseNameGoesHere?schema=yourSchemaNameGoesHere"
&SESSION_SECRET="yourSecretGoesHere"
- Then save
- In the
/client
directory, create an .env file (separate from the previous), and insert the following:VITE_API_ENDPOINT=http://localhost:3000
- Then save
- Split your terminal into two separate consoles
- Navigate one terminal into the
/api
directory and runnpm run dev
- Navigate the second terminal into the
/client
directory and runnpm run dev
as well. If your browser does not automatically load, typehttp://localhost:5173/
manually in the browser
- Everything you need to interact with our API.
- If you want to access our API directly, you can use the following base URL:
http://localhost:3000/swagger
after running the app locally.
-
All requests should be made to the base URL:
http://localhost:3000/
and use Postman/Thunderclient and requests should be made using the HTTP verbsGET
,POST
,PUT
,PATCH
, andDELETE
. -
Player:
- GET
/player
retrieves a single player by Id. - GET
/player/:gameId
retrieves all players by gameId. - POST
/player/
creates a new player. - PUT
/player/:id
updates a single player by Id.
- GET
-
Game:
- GET
/games
retrieves all games. - GET
/game/:id
retrieves a single game by Id. - POST
/game/:id
creates a new game.
- GET
-
Round:
- GET
/round/:id
retrieves specific round from game. - GET
/rounds/:gameID
retrieves all rounds from game.
- GET
-
Role:
- GET
/roles
retrieves all roles. - GET
/role/:id
retrieves a single role by Id. - POST
/role/
creates a new role.
- GET
-
Vote:
- GET
/vote/:id
retrieves a single vote by Id. - GET
/votes/:gameId
retrieves all votes by gameId. - POST
/vote/
creates a new vote. - POST
/tallyVote
Counts casted votes and tally them. - POST
/vote/
casted votes are collected.
- GET
- In progress
- In progress
- No Known Issues
MIT 👈
If you run into any issues or have questions, ideas, or concerns; please email us
Copyright (c) 2022 - William Rodriguez - James Fox - Marcus Lorenzo - Mark McConnell