Skip to content

bcaliva21/factory_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is for a simple scroll timing game. There are three micro services running on docker containers:

  • Frontend -- React/Typescript/vite

  • Backend -- Apollo/Graphql/prisma

  • Database -- Postgres

To get it up and running you must build and run both FE/BE simultaneously

Development

Local Env setup

node must be >= 18.15.0 and npm must be >= 9.5.0

  1. Clone the repo git clone https://github.com/bcaliva21/factory_game.git

  2. Enter repo cd factory_game

  3. Install Docker

Front-end

  1. Install frontend dependencies cd frontend && npm i

  2. Once dependencies are installed npm run dev

Back-end

  1. Ensure .env database url points to localhost postgresql://USER:PASSWORD@localhost:5432/DBNAME?schema=public

  2. Install backend dependencies cd server && npm i

  3. Spin up docker database docker-compose up -d postgres

  4. Generate prisma client locally npx prisma generate

  5. Sync prisma client with local schemas npx prisma migrate dev

  6. Start Back-end ```npm run serve``

Docker setup

  1. Complete docker migration as described below

  2. Navigate to localhost:4173 to view project

Docker Migration

  1. Make sure the postgres container is running docker ps

  2. Ensure .env database url points to docker postgres postgresql://USER:PASSWORD@postgres:5432/DBNAME?schema=public

  3. Start docker container docker-compose up --build

  4. Open side terminal and execute the following command to enter a bash terminal inside the prisma container docker exec -it "factory_server" sh

  5. Inside the factory_server container run the migration command npx prisma migrate dev --name migration-name

Helpful Commands

  • lint repo npm run lint

  • format repo npm run prettier-format

  • start a local web server that serves the built solution from ./dist npm run preview

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages