Skip to content

Commit 3f2a964

Browse files
authored
V1.1.0 (#18)
* 1 restructuring (#14) * Restructured project tree * remove builds * Update .gitignore * Renamed folders * cleaned up * Added Makefile and Dockerfile (#16) * Refactored Project (#17) * Fixed wrong default scene in godot
1 parent f933714 commit 3f2a964

21 files changed

Lines changed: 105 additions & 90 deletions

File tree

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

2-
Client/.godot/
3-
Client/icon.svg.import
2+
client/.godot/
3+
client/icon.svg.import
44

5-
Server/.idea
5+
server/.idea
6+
7+
builds/
8+
client/asset/icon.svg.import

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"makefile.configureOnOpen": false
3+
}

Builds/Client.exe

-78.7 MB
Binary file not shown.

Builds/Server.exe

-7.54 MB
Binary file not shown.

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
FROM golang:1.23-alpine
3+
4+
WORKDIR /app
5+
6+
COPY . .
7+
8+
RUN cd ./server && go mod tidy
9+
10+
RUN cd ./server && go build -o ../builds/Server.exe ./main.go
11+
12+
EXPOSE 5000
13+
14+
CMD ["/app/builds/Server.exe"]

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
CLIENT_SRC = ./client
2+
SERVER_SRC = ./main.go
3+
4+
CLIENT_BIN = ./builds/Client.exe
5+
SERVER_BIN = ./builds/Server.exe
6+
7+
MAKE_PATH = %CD%
8+
9+
.PHONY: build-docker
10+
build-docker: ## Build Docker image
11+
docker build --no-cache -t websocketchat .
12+
13+
.PHONY: build-client
14+
build-client: ## Create the Client.exe
15+
godot --headless --path $(CLIENT_SRC) --export-release "Windowsx86_64" ../$(CLIENT_BIN)
16+
17+
.PHONY: build-server
18+
build-server: ## Create the Server.exe
19+
cd server && go build -o ../$(SERVER_BIN) $(SERVER_SRC)
20+
21+
.PHONY: clean-build
22+
clean-build: ## Remove Client and Server binaries
23+
if exist $(CLIENT_BIN) del /F /Q $(CLIENT_BIN)
24+
if exist $(SERVER_BIN) del /F /Q $(SERVER_BIN)
25+
26+
.PHONY: run-docker
27+
run-docker: ## Run Docker image
28+
docker stop websocketchat || true
29+
docker rm websocketchat || true
30+
docker run -d -p 5000:5000 --name websocketchat websocketchat
31+
32+
.PHONY: run-client
33+
run-client: ## Run Client
34+
$(CLIENT_BIN)
35+
36+
.PHONY: run-server
37+
run-server: ## Run Server in a new terminal
38+
cmd.exe /c start "C:\Users\loica\Desktop\ChatWS\builds\Server.exe"
39+
40+
.PHONY: test
41+
test: ## Run tests
42+
cd .\server && go test ./...
43+
44+
.PHONY: deps
45+
deps: ## Install new dependencies
46+
cd .\server && go mod tidy -v

Server/server_test.go

Lines changed: 0 additions & 69 deletions
This file was deleted.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[preset.0]
22

3-
name="Windows Desktop"
3+
name="Windowsx86_64"
44
platform="Windows Desktop"
55
runnable=true
66
advanced_options=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ config_version=5
1111
[application]
1212

1313
config/name="ClientWebSocket"
14-
run/main_scene="res://scene/main.tscn"
14+
run/main_scene="res://scene/login.tscn"
1515
config/features=PackedStringArray("4.4", "Forward Plus")
16-
config/icon="res://icon.svg"
16+
config/icon="res://asset/icon.svg"

0 commit comments

Comments
 (0)