Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9275950
[FIX]-CRUD-race-controller
Jul 28, 2024
0ad71c1
:construction: [TEST] Vehicle - setup test helpers
LFLeveneur Jul 28, 2024
baf2f76
:construction: [TEST] Vehicle - test can create a new vehicle
LFLeveneur Jul 28, 2024
2a48756
:construction: [TEST] Vehicle - test can delete a vehicle
LFLeveneur Jul 28, 2024
27e2da1
:construction: [TEST] Vehicle - test can get a vehicle
LFLeveneur Jul 28, 2024
a26ebe2
:construction: [TEST] Vehicle - test can get a vehicles
LFLeveneur Jul 28, 2024
dbc751c
:construction: [TEST] Vehicle - test can update a vehicle
LFLeveneur Jul 28, 2024
f2cb688
fix: error in in vehicle test
Rijenth Aug 1, 2024
be5c6b8
refacto: use request performer in vehicle test
Rijenth Aug 1, 2024
34d75c5
[ADD]- All unitest race routes
Jul 28, 2024
c201264
fix: several api arch error
Rijenth Jul 25, 2024
784a2d8
hotfix: remove user password from user json
Rijenth Aug 2, 2024
c7525e8
fix-error-in-auth-workflow (#19)
Rijenth Aug 10, 2024
aa45138
Add vehicle status table (#20)
Rijenth Aug 20, 2024
1cb622d
Refacto vehicle table (#21)
Rijenth Aug 21, 2024
76ee617
Refacto race model (#22)
Rijenth Aug 21, 2024
d59e322
add a race type for each races (#24)
Rijenth Aug 21, 2024
3f5649a
:test_tube: Add test base on the race model (#25)
Rijenth Aug 21, 2024
084cdd9
:ambulance: Fix test for race
gaoubak Aug 21, 2024
e65257e
wip: implementing seeder
Rijenth Aug 21, 2024
8c52ff4
:seedling: Update seeder to add 3 race for each user in the seeder
gaoubak Aug 21, 2024
58fbd59
add: vehicle state for each vehicle in seeding process
Rijenth Aug 22, 2024
efbe5ad
fix: enhance MySQL healthcheck for quicker service startup
Rijenth Aug 22, 2024
1fbfcca
fix: route index user race
Rijenth Aug 22, 2024
b53465e
hotfix: cors
Rijenth Aug 22, 2024
d7a1936
:sparkles: Add name and race status for race
gaoubak Aug 22, 2024
3ed8b86
fix: severals errors
Rijenth Aug 22, 2024
8a91c29
add: unauthenticated server sent event route
Rijenth Aug 22, 2024
8891975
:bug: Fix model race add fk for user and vehicle and add change link …
gaoubak Aug 23, 2024
bf0ad0d
:wastebasket: Delete model , validator and any ref to sensorData and …
gaoubak Aug 23, 2024
501f226
:sparkles: New model Vehicle Battery
gaoubak Aug 23, 2024
94723fc
:sparkles: Add the model in the main go
gaoubak Aug 23, 2024
7babac2
rename: battery model
Rijenth Aug 23, 2024
d4c75ec
Fix post race datetime error (#33)
Rijenth Aug 25, 2024
702b833
Handle mqtt message to update race (#32)
Rijenth Aug 27, 2024
196a6d2
hotfix: race seeding not working properly
Rijenth Aug 27, 2024
1e66915
hotfix: remove average_speed from create race validator
Rijenth Aug 27, 2024
cb641c1
hotfix: race end_time not filled when receiving race ended message
Rijenth Aug 27, 2024
940da40
feat(auth): enhance API with login rememberMe and welcome email on re…
jubskan3ki Aug 31, 2024
c428da3
fix(tests): correct SetupPublicRoutes argument error in setup_test_ro…
jubskan3ki Aug 31, 2024
8dae58b
fix(tests): resolve database and API response issues in auth signup t…
jubskan3ki Aug 31, 2024
2179f3d
fix(tests): define SecondaryLedColor in signup tests to fix build error
jubskan3ki Aug 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@ DB_HOST=
DB_PORT=
DB_NAME=

SMTP_HOST=
SMTP_USER=
SMTP_PASS=

ALLOW_DATABASE_SEEDING=false
APP_FRONTEND_URL="http://localhost:5173"
JWT_SECRET_KEY="example_key"

VEHICLE_1_NAME="Freenove 1"
VEHICLE_1_IPADDRESS="0.0.0.0"
VEHICLE_1_IS_AVAILABLE=true
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.21.6 as builder

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN go build -o main .

FROM golang:1.21.6

WORKDIR /app

COPY --from=builder /app/main .

COPY --from=builder /app/src ./src

EXPOSE 8000

CMD ["./main"]
54 changes: 42 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
services:
version: '3.9'

services:
api:
build:
build:
context: .
dockerfile: Dockerfile_dev
container_name: go
environment:
Port: 8000
- PORT=8000
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- SMTP_HOST=${SMTP_HOST}
- SMTP_USER=${SMTP_USER}
- SMTP_PASS=${SMTP_PASS}
- EMAIL_FROM=${SMTP_USER}
- TEMPLATE_PATH=/app/src/templates
ports:
- "8000:8000"
volumes:
Expand All @@ -16,28 +28,36 @@ services:
depends_on:
mysql:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s

mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
ports:
- "1883:1883"
- "9001:9001"
- "1883:1883"
- "9001:9001"
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
restart: always
networks:
- goland-network

mysql:
container_name: mysql
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: database
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
test: [ "CMD", "mysql", "-uroot", "-proot", "-e", "SELECT 1" ]
interval: 5s
timeout: 2s
retries: 10
image: mysql:latest
retries: 3
ports:
- "3306:3306"
restart: always
Expand All @@ -48,17 +68,27 @@ services:

adminer:
container_name: adminer
image: adminer
depends_on:
- mysql
image: adminer
ports:
- 8080:8080
- "8080:8080"
restart: always
networks:
- goland-network

email_service:
image: bytemark/smtp
container_name: smtp
environment:
- SMTP_USER=${SMTP_USER}
- SMTP_PASS=${SMTP_PASS}
ports:
- "1025:25"
restart: always
networks:
- goland-network

networks:
goland-network:
driver: bridge

Loading