https://github.com/nimatrazmjo/gg-test
This project has been build using reactjs expressjs typescript
https://github.com/nimatrazmjo/gg-test
docker docker-compose expressjs kubernetes reactjs skaffold typescript
Last synced: 18 days ago
JSON representation
This project has been build using reactjs expressjs typescript
- Host: GitHub
- URL: https://github.com/nimatrazmjo/gg-test
- Owner: nimatrazmjo
- Created: 2022-01-08T13:22:49.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-12T13:21:00.000Z (almost 4 years ago)
- Last Synced: 2025-02-16T13:32:15.280Z (8 months ago)
- Topics: docker, docker-compose, expressjs, kubernetes, reactjs, skaffold, typescript
- Language: TypeScript
- Homepage:
- Size: 7.49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Good Game Test

This project## π Table of Contents
- [Problem Statement](#problem_statement)
- [Idea / Solution](#idea)
- [Dependencies / Limitations](#limitations)
- [Future Scope](#future_scope)
- [Setting up a local environment](#getting_started)
- [Usage](#usage)
- [Technology Stack](#tech_stack)
- [Contributing](../CONTRIBUTING.md)
- [Authors](#authors)
- [Acknowledgments](#acknowledgments)Every player in Empire has a castle. To let players attack another playerβs castle, we need you to create armies of randomly
distributed troops (a troop is a formation of soldiers with the same skill, such as Spearmen, Swordsmen, Archers, etc.)
For example, we'll call your code telling it we need a random army that's 167 men strong. Assuming our available unit types to be,
for example, Spearmen, Swordsmen and Archers, what we want from you is that you tell us what such a random army would look
like., e.g.
Our Input: 167Example result:
```
63 Spearmen57 Swordsmen
47 Archers
```
## π Getting StartedThese instructions will get you a copy of the project up and running on your local machine for development
and testing purposes. See [deployment](#deployment) for notes on how to deploy the project on a live system.## Folder Structure
```
client # React project
βββ src
β βββ **/*.js
k8s # Kubernetes config
β βββ client-deployment.yaml
β βββ ingress-service.yaml
β βββ server-deployment.yaml
server # Expressjs code using typescript
βββ src
β βββ **/*.tsβββ docker-compose.dev.yml
βββ docker-compose.prod.yml
βββ docker-compose.test.yml
βββ docker-compose.yml
βββ package.json
βββ package-lock.json
βββ package-lock.json
βββ .gitignore
βββ skaffold.yaml
```### Prerequisites
- lastet version of docker must be installed.
- docker and docker compose must be installed.
- if you want to use kubernets, skaffold need to be installed
# Installing
You can use either `docker-compose` or `Kubernetes` using `skaffold`
## 1 - docker-compose
- Development
```
npm run docker:dev
```
- open http://localhost:3000
- GET `http://localhost:400/api/armies/:totalArmy` to crate an army
- Test```
npm run docker:test
```## 2 - Kubernetes
```
skaffold dev
```
## Deploymentrun
```
skaffold run
```then add following code to `/etc/hosts` file and open `http://gg.empire.com` in browser
```
127.0.0.1 gg.empire.com
```
## βοΈ Built With- [Express](https://expressjs.com/) - Server Framework
- [Reactjs](https://reactjs.org/) - Web Framework
- [NodeJs](https://nodejs.org/en/) - Server Environment
- [Docker](https://www.docker.com/) - Server Environment
- [Docker Compose](https://www.docker.com/) - Server Environment
- [Kubernetes](https://kubernetes.io/) - Server Environment
- [Skaffold](https://http://skaffold.dev/) - Server Environment
- [PM2](https://pm2.keymetrics.io/) - production process manager- [@nimatrazmjo](https://github.com/nimatrazmjo) - Initial work