Giter VIP home page Giter VIP logo

kamon's Introduction

Kamon

Kamon Game on CLI, web, mobile.

This project is a set of 5 packages :

  • @kamon/core: the logic of the game
  • @kamon/cli: the game playable in CLI
  • @kamon/webapp: the game playable on a browser and the API, built on the top of NestJS
  • @kamon/mobileapp: the game playable on mobile, built with Expo and React Native
  • @kamon/admin: manage users and games, build with React-admin

Almost all of these packages use a part of @kamon/core.

Develop with Docker

Prerequisites

  • docker
  • docker compose

Start the project

This command will build dockers containers and up these

make start-dev
# with build
EXTRA_PARAMS=--build make start-dev

You can access to applications as follow:

To stop all

make stop-dev

Develop without Docker

Disclaimer: you need a database to run the webapp and the API, at this time, you can use Docker to run it

Dependencies installation

All this packages use yarn workspace, first, install every dependencies:

cd kamon
make install

Run Docker to access database

Some packages like @kamon/webapp, @kamon/admin need a database.

First to first, make sure you followed the Before you start section to configure applications with .env files.

Then start docker containers

docker compose up -d

@kamon/core

Requirements

  • Node.js ^18
  • yarn

Developing

## Re-run the script on change
yarn workspace @kamon/core watch

Build

# build once
make build-core

# build watch, usefull to developp other apps
yarn workspace @kamon/core build -w

Test

make test-core

@kamon/cli

Requirements

  • Node.js ^18
  • yarn

Developing

## Re-run the script on change
yarn workspace @kamon/cli dev

Build

# build once
make build-cli

# build watch
yarn workspace @kamon/cli build -w

Play

## initialize a new game
make run-cli

## resume a game from a target save file
yarn workspace @kamon/cli start -f my_save_file.json

@kamon/webapp

This package is build over NestJS, so all available command in NestJS are available here.

Configure access to database

Edit the .env file in ./webapp as follow

#POSTGRES_HOST=kamon_postgres
POSTGRES_HOST=0.0.0.0 # access database in dev mode

Install

Run the migrations
yarn workspace @kamon/webapp db:migrate

Running the app

# development
yarn workspace @kamon/webapp run start
# or
make run-webapp

# watch mode
yarn workspace @kamon/webapp run start:dev

# production mode
yarn workspace @kamon/webapp run start:prod

Test

# unit tests
yarn workspace @kamon/webapp run test
# or
make unit-test-webapp

# e2e tests
yarn workspace @kamon/webapp run test:e2e
# or
make e2e-test-webapp

# test coverage
yarn workspace @kamon/webapp run test:cov

Build

yarn workspace @kamon/webapp build
# or
make build-webapp

@kamon/mobileapp

This package is build over Expo and React Native.

Before you want to run the app, you need to run @kamon/webapp because it's the API of the game.

Create a .env based on .env.local and configure it. To use a local API (eg: localhost), use the same IP that Expo expose to you.
Exemple: your Expo application run on http://192.168.86.27:19000, your API endpoint should look like http://192.168.86.27:3000. That's it.

Developping

Install Expo Go on your phone and run

make run-mobileapp

Build

First, you need an Expo account to build on the Expo Cloud.

When you have an account, you have to run these commands as explain here

npm install -g eas-cli
eas login

To build the application as an APK, run this

eas build --platform android --profile apk

@kamon/admin

This package is build over React-admin, and allow admin to manage users and games.

Developping

make dev-admin
# or
yarn workspace @kamon/admin dev

Build

make dev-admin
# or
yarn workspace @kamon/admin build

Test

make test-admin
# or
yarn workspace @kamon/admin test --run

kamon's People

Contributors

adguernier avatar djhi avatar fzaninotto avatar guilbill avatar jonathan-marmelab avatar nitix avatar paulsanchezmarmelab avatar slax57 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.