Skip to content

Summer internship 2022: A web application used to play a Mafia/Werewolf style game.

Notifications You must be signed in to change notification settings

eyecuelab/mafia-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

28-days-later-font

Generic badge

Summer Internship 2022

🧑🏽‍🤝‍🧑🏼 Maintainers

  • William Rodriguez
  • James Fox
  • Marcus Lorenzo
  • Mark McConnell

📂 Table Of Contents

📝 Summary

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.

✅ Description

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!.

🎯 MVP

  • 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

⭐ Stretch Goals

[] 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

🖥️ Technologies Used

⚙️ Installation, Setup, and Running The App

Setup/Installation Requirements

  • 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 then cd api and run npm install and then cd client and run npm 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.

Required .env Files

  • 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

Running the App Locally

  • Split your terminal into two separate consoles
  • Navigate one terminal into the /api directory and run npm run dev
  • Navigate the second terminal into the /client directory and run npm run dev as well. If your browser does not automatically load, type http://localhost:5173/ manually in the browser

The Nameless Terror API Reference

  • 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.

Making Requests

  • All requests should be made to the base URL: http://localhost:3000/ and use Postman/Thunderclient and requests should be made using the HTTP verbs GET, POST, PUT, PATCH, and DELETE.

  • 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.
  • Game:

    • GET /games retrieves all games.
    • GET /game/:id retrieves a single game by Id.
    • POST /game/:id creates a new game.
  • Round:

    • GET /round/:id retrieves specific round from game.
    • GET /rounds/:gameID retrieves all rounds from game.
  • Role:

    • GET /roles retrieves all roles.
    • GET /role/:id retrieves a single role by Id.
    • POST /role/ creates a new role.
  • 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.

The Request Body

  • In progress

Models

  • In progress

Known 🐛 Bugs

  • No Known Issues

🎫License

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

About

Summer internship 2022: A web application used to play a Mafia/Werewolf style game.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages