- Download Node.js LTS. (Recommend installing via NVM for Windows, a Node.js version manager)
- (Optional) Install pnpm (alternative to Node's default NPM)
- Download VS Code.
- Install the ESLint extension by Microsoft
- Install the IntelliCode extension by Microsoft
- (Optional) Install the IntelliCode API Usage Examples extension by Microsoft
- Download Docker Desktop.
- βIf you are on Windows, Docker Desktop will require installing WSL 2 (Windows Subsystem for Linux).
- To check if you have WSL,
wsl --list
in your terminal should return something. - To install WSL, simply runΒ
wsl --install
Β in anΒ administratorΒ PowerShell or Command Prompt & then restart your computer.
- To check if you have WSL,
- βIf you are on Windows, Docker Desktop will require installing WSL 2 (Windows Subsystem for Linux).
- Download Git.
- Clone the repo (
git clone https://github.com/AdoryVo/big-two.git
) - Open your local repo folder in VS Code
- Open a new terminal (
Ctrl+`
) & runpnpm install
(ornpm install
) to install dependencies - Add a
.env
file to the root directory & add the contents received from Discord - Run
docker compose up
& leave the terminal open - Open a new terminal (
Ctrl+Shift+`
) and runpnpm prisma migrate dev
(ornpx prisma migrate dev
) to hook up Prisma to your database - Send
Ctrl+C
to your terminal running docker to stop the process
First, start your existing Docker image:
docker compose start
Next, run the development server:
npm run dev
# or
pnpm dev
Open http://localhost:3000 with your browser to see the app.
Key:
- β: Primary - most changes will happen here
- π: Secondary - changes provide support for primary focuses
- π: Mainly for reference & foundation, unlikely to be changed
prisma/
βββ schema.prisma # π Database schema
src/
βββ components/ # β React components
βββ lib/
β βββ big-two/ # β Game logic
βββ utils/ ## Constants and exports
β βββ hooks/ # π Hooks
β βββ theme.ts/ # π Theme specifications
βββ pages/ ## Visitable routes
βββ api/ # β Server API routes
βββ _app.tsx # π Page component wrapper
βββ game/[gameId].tsx # β Game lobby page
βββ index.tsx # π Home page
βββ sandbox.tsx # π Development page for debugging game logic
.env # π Environment variables
package.json # π Dependencies
db push
: Push the Prisma schema state to the databasemigrate dev
: Create migrations from your Prisma schema, apply them to the database, generate artifacts (e.g. Prisma Client)studio
: Run Prisma's local browser tool for viewing models
- Next.js - React framework
- Prisma - Typescript-first ORM for database operations dealing with active games
- Pusher - Realtime web socket channels for multiplayer functionality
- Supabase - Cloud Postgres database
- SWR - Optimized data fetching for streamlined game updates
- Chakra UI - Component library inspired by Tailwind CSS
- Formik - Form logic
- Material Design icons via react-icons - Icons
- cards - Basic deck operation functionality
- random-word-slugs - Creative game ID generation
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.