Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
exclude_patterns:
- "islanders-shared/__tests__/"
- "islanders-shared/test/"
- "islanders-shared/dist/"
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/*
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Docker Image CI

on:
push:

jobs:
build_test_project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Compose Build
run: docker compose build
93 changes: 0 additions & 93 deletions .github/workflows/dockerimage.yml

This file was deleted.

1,325 changes: 1,325 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

43 changes: 24 additions & 19 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
version: "3.5"
services:
mongo:
image: mongo
postgres:
image: postgres:15-alpine
restart: unless-stopped
volumes:
- islanders-mongo-data:/data/db
environment:
- MONGO_INITDB_DATABASE=islanders
- POSTGRES_DB=islanders
- POSTGRES_USER=islanders
- POSTGRES_PASSWORD=islanders
volumes:
- ./islanders-server/scripts/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- 27017:27017
- 5432:5432

islanders-server:
image: islanders/islanders-server:latest
build:
context: .
dockerfile: ./islanders-server/Dockerfile
env_file:
- ./islanders-server/.env
restart: unless-stopped
ports:
- 3000:3000
environment:
- MONGO_URL=mongo
links:
- mongo
- 3001:3001
depends_on:
- postgres

islanders-client:
image: islanders/islanders-client:latest
build:
context: .
dockerfile: ./islanders-client/Dockerfile
env_file:
- ./islanders-client/.env
restart: unless-stopped
ports:
- 80:80


volumes:
islanders-mongo-data:
- 3000:3000
depends_on:
- islanders-server
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions islanders-client-vue/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NODE_ENV=development
BASE_URL=http://localhost:3002/
VUE_APP_SERVER_URL=http://localhost:3002
VUE_APP_SERVERPORT=3002
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions islanders-client-vue/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM oven/bun:1 AS builder

WORKDIR /app

COPY bun.lock package.json ./
COPY islanders-client/package.json islanders-client/
COPY islanders-server/package.json islanders-server/
COPY islanders-shared/package.json islanders-shared/
RUN bun install --frozen-lockfile

COPY islanders-shared/lib ./islanders-shared/lib
COPY islanders-client/babel.config.js ./islanders-client/babel.config.js
COPY islanders-client/postcss.config.js ./islanders-client/postcss.config.js
COPY islanders-client/tsconfig.json ./islanders-client/tsconfig.json
COPY islanders-client/vue.config.ts ./islanders-client/vue.config.ts
COPY islanders-client/.browserslistrc ./islanders-client/.browserslistrc
COPY islanders-client/public ./islanders-client/public
COPY islanders-client/src ./islanders-client/src

WORKDIR /app/islanders-client
RUN bun run build

FROM nginx:alpine

COPY islanders-client/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/islanders-client/dist /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
26 changes: 26 additions & 0 deletions islanders-client-vue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# islanders-client

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Run your unit tests
```
npm run test:unit
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Sprite } from 'pixi.js';

import { Tile } from '../../../islanders-shared/dist/Shared';
import { Tile } from '../../../islanders-shared/lib/Shared';

export function generateSprites(): { [s: string]: () => Sprite } {
const tilePath = './img/tilesets/';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import chat from './modules/chat';
import game from './modules/game';
import ui from './modules/ui';

import { Result, SocketActions, success, toResultInstance, World } from '../../../islanders-shared/dist/Shared';
import { Result, SocketActions, success, toResultInstance, World } from '../../../islanders-shared/lib/Shared';

Vue.use(Vuex);

Expand All @@ -25,7 +25,7 @@ const mutationTree: MutationTree<State> = {};
const host = `http://${process.env.VUE_APP_SERVER}:${process.env.VUE_APP_SERVERPORT}/`;

const actionTree: ActionTree<unknown, unknown> = {
async createGame ({ commit }: ActionContext<unknown, unknown>, playerName: string) {
async createGame({ commit }: ActionContext<unknown, unknown>, playerName: string) {
const { data }: { data: string } = await Axios.get(`${host}newgame`);
const gameId = data;

Expand All @@ -37,7 +37,7 @@ const actionTree: ActionTree<unknown, unknown> = {
commit('game/setPlayerName', playerName);
},

async joinGame (
async joinGame(
{ commit }: ActionContext<unknown, unknown>,
gameStartInfo: { gameId: string; playerName: string },
): Promise<void> {
Expand Down
28 changes: 28 additions & 0 deletions islanders-client-vue/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"noImplicitAny": false,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": ["webpack-env", "jest"],
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx",
"src/main.js" ],
"exclude": ["node_modules"]
}
File renamed without changes.
2 changes: 2 additions & 0 deletions islanders-client/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SERVER_PORT=3001
PORT=3000
23 changes: 23 additions & 0 deletions islanders-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions islanders-client/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
9 changes: 9 additions & 0 deletions islanders-client/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lock
bun.lockb

# Miscellaneous
/static/
16 changes: 16 additions & 0 deletions islanders-client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
],
"tailwindStylesheet": "./src/app.css"
}
55 changes: 0 additions & 55 deletions islanders-client/.yarn/releases/yarn-berry.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions islanders-client/.yarnrc.yml

This file was deleted.

Loading