-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
225 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
# Zeus Scan Syst(e)em | ||
*Formerly called Vincent* | ||
|
||
_Formerly called Vincent_ | ||
|
||
Check-in in the the kelder kelder | ||
|
||
(Will) scan a badge at the scanner (vinscant) which registers its serial number at the webserver (vingo). | ||
|
||
Goals: | ||
|
||
- Support a check-in a day, keeping track of which days you have visited the kelder | ||
- Support check-in and check-out, keeping track of how many hours(, minutes(, seconds)) you have been in the kelder | ||
- Cool stats :D | ||
|
||
Secret goals: | ||
|
||
- Streaks | ||
- Data | ||
- More Data | ||
- Skins | ||
- Battlepass | ||
- Battlepass | ||
|
||
## Structure | ||
|
||
- `Vinscant` -> Scanner | ||
- `Vingo` -> Backend | ||
- `Vinvoor` -> Frontend | ||
|
||
## How to run (for development) | ||
|
||
### Easy & Quick | ||
|
||
- Install Docker and Docker Compose | ||
- Run the script `./dev.sh` with optional flags: | ||
- `-b`: Show the output of the backend. | ||
- `-f`: Show the output of the frontend. | ||
- If both flags or no flags are provided, the output of both the backend and frontend are shown. | ||
|
||
The backend is accessible at `localhost:3000`, and the frontend at `localhost:5173`. | ||
|
||
### Manual | ||
|
||
- Each part has it's own `README.md` with instructions on how to run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Parse input | ||
|
||
backend=false | ||
frontend=false | ||
|
||
while getopts 'bf' flag; do | ||
case "${flag}" in | ||
b) backend=true ;; | ||
f) frontend=true ;; | ||
*) echo "Unexpected option ${flag}" ;; | ||
esac | ||
done | ||
|
||
# Check for the required files | ||
|
||
if [ ! -f vingo/.env ]; then | ||
cp vingo/dev.env vingo/.env | ||
fi | ||
|
||
# Start the docker containers | ||
|
||
docker-compose -f docker-compose.yml up -d | ||
|
||
echo "-------------------------------------" | ||
echo "Following logs..." | ||
echo "Press CTRL + C to stop all containers" | ||
echo "-------------------------------------" | ||
|
||
if [ "$backend" = true ] && [ "$frontend" = false ]; then | ||
docker-compose -f docker-compose.yml logs -f zess-backend | ||
elif [ "$backend" = false ] && [ "$frontend" = true ]; then | ||
docker-compose -f docker-compose.yml logs -f zess-frontend | ||
else | ||
docker-compose -f docker-compose.yml logs -f zess-backend zess-frontend | ||
fi | ||
|
||
docker-compose -f docker-compose.yml stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
services: | ||
zess-db: | ||
image: postgres | ||
environment: | ||
- POSTGRES_PASSWORD=zess | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_DB=zess | ||
expose: | ||
- 5432 | ||
network_mode: host | ||
|
||
zess-backend: | ||
build: | ||
context: vingo | ||
dockerfile: Dockerfile.dev | ||
expose: | ||
- 4000 | ||
volumes: | ||
- ./vingo:/backend | ||
- backend-cache:/root/.cache/go-build | ||
depends_on: | ||
- zess-db | ||
network_mode: host | ||
|
||
zess-frontend: | ||
build: | ||
context: vinvoor | ||
dockerfile: Dockerfile.dev | ||
expose: | ||
- 5173 | ||
volumes: | ||
- ./vinvoor:/frontend | ||
network_mode: host | ||
|
||
volumes: | ||
backend-cache: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
root = "." | ||
testdata_dir = "testdata" | ||
tmp_dir = "tmp" | ||
|
||
[build] | ||
args_bin = [] | ||
bin = "./tmp/main" | ||
cmd = "go build -o ./tmp/main ." | ||
delay = 1000 | ||
exclude_dir = ["assets", "tmp", "vendor", "testdata"] | ||
exclude_file = [] | ||
exclude_regex = ["_test.go"] | ||
exclude_unchanged = false | ||
follow_symlink = false | ||
full_bin = "" | ||
include_dir = [] | ||
include_ext = ["go", "tpl", "tmpl", "html"] | ||
include_file = [] | ||
kill_delay = "0s" | ||
log = "build-errors.log" | ||
poll = false | ||
poll_interval = 0 | ||
post_cmd = [] | ||
pre_cmd = [] | ||
rerun = false | ||
rerun_delay = 500 | ||
send_interrupt = false | ||
stop_on_error = false | ||
|
||
[color] | ||
app = "" | ||
build = "yellow" | ||
main = "magenta" | ||
runner = "green" | ||
watcher = "cyan" | ||
|
||
[log] | ||
main_only = false | ||
time = false | ||
|
||
[misc] | ||
clean_on_exit = false | ||
|
||
[proxy] | ||
app_port = 0 | ||
enabled = false | ||
proxy_port = 0 | ||
|
||
[screen] | ||
clear_on_rebuild = false | ||
keep_scroll = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM golang:1.22.1-alpine3.19 | ||
|
||
WORKDIR /backend | ||
|
||
RUN go install github.com/air-verse/air@latest | ||
COPY .air.toml . | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
CMD go mod tidy && air -c .air.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
key.txt | ||
mfrc522.py | ||
webrepl_cli.py | ||
|
||
# ESP-IDF default build directory name | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM node:22.2.0-alpine3.19 as build-stage | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
|
||
RUN yarn install | ||
|
||
COPY ./ . | ||
|
||
RUN yarn run build | ||
|
||
|
||
FROM nginx:alpine-slim as production-stage | ||
|
||
EXPOSE 3000 | ||
|
||
RUN mkdir /app | ||
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
COPY --from=build-stage /app/dist /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:22.2.0-alpine3.19 | ||
|
||
WORKDIR /frontend | ||
|
||
COPY package.json yarn.lock ./ | ||
|
||
CMD yarn install && yarn run host |
Oops, something went wrong.