diff --git a/.docs/architecture/adr/2024-03-15-backend-segregation-tech.md b/.docs/architecture/adr/2024-03-15-backend-segregation-tech.md index 7c0a827..ca53cdd 100644 --- a/.docs/architecture/adr/2024-03-15-backend-segregation-tech.md +++ b/.docs/architecture/adr/2024-03-15-backend-segregation-tech.md @@ -20,4 +20,4 @@ Another option is to create one backend for each language and endpoint, creating Although this is a lab project, in the real world we would choose one technology and language for each service so we will follow this approach. We will name each service with the naming convention `backend--`. -For example: `backend-golang-rest`, `backend-golang-htmx`, `backend-csharp-rest`, ... \ No newline at end of file +For example: `backend-rest-go`, `backend-golang-htmx`, `backend-csharp-rest`, ... \ No newline at end of file diff --git a/.github/workflows/build-run-test.yaml b/.github/workflows/build-run-test.yaml index 87dd2c0..3d8df04 100644 --- a/.github/workflows/build-run-test.yaml +++ b/.github/workflows/build-run-test.yaml @@ -19,11 +19,12 @@ jobs: matrix: service: [ - backend-golang-rest, - backend-js-rest, - webapp-golang-htmx, + backend-rest-go, + backend-rest-js, + webapp-htmx-go, webapp-nextjs, e2e-cypress, + bdd-go, ] steps: - uses: actions/checkout@v4 @@ -53,7 +54,7 @@ jobs: strategy: matrix: runner: [cypress] - frontend: [next, golang-htmx] + frontend: [nextjs, htmx-go] backend: [go, js] db: [inmemory, mongo] steps: @@ -66,7 +67,7 @@ jobs: - name: Run E2E tests run: just test-${{ matrix.runner }}-${{ matrix.frontend }}-${{ matrix.backend }}-${{ matrix.db }} - name: Upload test screenshots - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4.3.3 with: name: e2e-screenshots-${{ matrix.e2e_runner }}-${{ matrix.frontend }}-${{ matrix.backend }}-${{ matrix.db }} path: e2e-cypress/cypress/screenshots diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index db47265..2980136 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -3,20 +3,17 @@ name: Unit Test on: [push] jobs: - build: + unit-test: runs-on: ubuntu-latest strategy: matrix: - go-version: ["1.21.3"] - + component: ["backend-rest-go", "backend-rest-js"] steps: - uses: actions/checkout@v4 - - name: Setup Go ${{ matrix.go-version }} - uses: actions/setup-go@v4 + - name: Setup Go 1.21.3 + uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} - # You can test your matrix by printing the current Go version - - name: Display Go version - run: go version - - name: Run unit tests - run: cd backend-golang-rest && GIN_MODE=test go test -v ./... + go-version: 1.21.3 + - uses: extractions/setup-just@v2 + - name: Run unit tests ${{ matrix.component }} + run: cd ${{ matrix.component }} && just unit-test diff --git a/backend-golang-rest/Dockerfile b/backend-rest-go/Dockerfile similarity index 100% rename from backend-golang-rest/Dockerfile rename to backend-rest-go/Dockerfile diff --git a/backend-golang-rest/cmd/auth_middleware.go b/backend-rest-go/cmd/auth_middleware.go similarity index 100% rename from backend-golang-rest/cmd/auth_middleware.go rename to backend-rest-go/cmd/auth_middleware.go diff --git a/backend-golang-rest/cmd/main.go b/backend-rest-go/cmd/main.go similarity index 91% rename from backend-golang-rest/cmd/main.go rename to backend-rest-go/cmd/main.go index 6d08afe..c64d2b0 100644 --- a/backend-golang-rest/cmd/main.go +++ b/backend-rest-go/cmd/main.go @@ -6,10 +6,10 @@ import ( "os" "github.com/gin-gonic/gin" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/authentication" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/common" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/db" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/tasks" + "github.com/tonitienda/kadai/backend-rest-go/pkg/authentication" + "github.com/tonitienda/kadai/backend-rest-go/pkg/common" + "github.com/tonitienda/kadai/backend-rest-go/pkg/db" + "github.com/tonitienda/kadai/backend-rest-go/pkg/tasks" ) const ( diff --git a/backend-golang-rest/cmd/system_test.go b/backend-rest-go/cmd/system_test.go similarity index 100% rename from backend-golang-rest/cmd/system_test.go rename to backend-rest-go/cmd/system_test.go diff --git a/backend-golang-rest/cmd/tasks_test.go b/backend-rest-go/cmd/tasks_test.go similarity index 98% rename from backend-golang-rest/cmd/tasks_test.go rename to backend-rest-go/cmd/tasks_test.go index 02ebf4f..6c49ca7 100644 --- a/backend-golang-rest/cmd/tasks_test.go +++ b/backend-rest-go/cmd/tasks_test.go @@ -9,7 +9,7 @@ import ( "github.com/gin-gonic/gin" "github.com/stretchr/testify/assert" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/tasks" + "github.com/tonitienda/kadai/backend-rest-go/pkg/tasks" ) func TestGetTasksAnonymousUser(t *testing.T) { diff --git a/backend-golang-rest/go.mod b/backend-rest-go/go.mod similarity index 97% rename from backend-golang-rest/go.mod rename to backend-rest-go/go.mod index 77c7cb1..0d0bfac 100644 --- a/backend-golang-rest/go.mod +++ b/backend-rest-go/go.mod @@ -1,4 +1,4 @@ -module github.com/tonitienda/kadai/backend-golang-rest +module github.com/tonitienda/kadai/backend-rest-go go 1.22.1 diff --git a/backend-golang-rest/go.sum b/backend-rest-go/go.sum similarity index 100% rename from backend-golang-rest/go.sum rename to backend-rest-go/go.sum diff --git a/backend-rest-go/justfile b/backend-rest-go/justfile new file mode 100644 index 0000000..1dbc3bd --- /dev/null +++ b/backend-rest-go/justfile @@ -0,0 +1,2 @@ +unit-test: + GIN_MODE=test go test -v ./... \ No newline at end of file diff --git a/backend-golang-rest/pkg/authentication/auth.go b/backend-rest-go/pkg/authentication/auth.go similarity index 100% rename from backend-golang-rest/pkg/authentication/auth.go rename to backend-rest-go/pkg/authentication/auth.go diff --git a/backend-golang-rest/pkg/authentication/auth_test.go b/backend-rest-go/pkg/authentication/auth_test.go similarity index 87% rename from backend-golang-rest/pkg/authentication/auth_test.go rename to backend-rest-go/pkg/authentication/auth_test.go index 492920c..cd563ca 100644 --- a/backend-golang-rest/pkg/authentication/auth_test.go +++ b/backend-rest-go/pkg/authentication/auth_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/common" + "github.com/tonitienda/kadai/backend-rest-go/pkg/common" ) func TestAuthenticateNewUser(t *testing.T) { diff --git a/backend-golang-rest/pkg/authentication/db_in_memory.go b/backend-rest-go/pkg/authentication/db_in_memory.go similarity index 100% rename from backend-golang-rest/pkg/authentication/db_in_memory.go rename to backend-rest-go/pkg/authentication/db_in_memory.go diff --git a/backend-golang-rest/pkg/common/errors.go b/backend-rest-go/pkg/common/errors.go similarity index 100% rename from backend-golang-rest/pkg/common/errors.go rename to backend-rest-go/pkg/common/errors.go diff --git a/backend-golang-rest/pkg/common/validations.go b/backend-rest-go/pkg/common/validations.go similarity index 100% rename from backend-golang-rest/pkg/common/validations.go rename to backend-rest-go/pkg/common/validations.go diff --git a/backend-golang-rest/pkg/db/mongo.go b/backend-rest-go/pkg/db/mongo.go similarity index 98% rename from backend-golang-rest/pkg/db/mongo.go rename to backend-rest-go/pkg/db/mongo.go index c01fa49..ccaaa33 100644 --- a/backend-golang-rest/pkg/db/mongo.go +++ b/backend-rest-go/pkg/db/mongo.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/tasks" + "github.com/tonitienda/kadai/backend-rest-go/pkg/tasks" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" diff --git a/backend-golang-rest/pkg/tasks/db_in_memory.go b/backend-rest-go/pkg/tasks/db_in_memory.go similarity index 96% rename from backend-golang-rest/pkg/tasks/db_in_memory.go rename to backend-rest-go/pkg/tasks/db_in_memory.go index 67eb395..652049b 100644 --- a/backend-golang-rest/pkg/tasks/db_in_memory.go +++ b/backend-rest-go/pkg/tasks/db_in_memory.go @@ -3,7 +3,7 @@ package tasks import ( "sync" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/common" + "github.com/tonitienda/kadai/backend-rest-go/pkg/common" ) type InMemoryTasksDB struct { diff --git a/backend-golang-rest/pkg/tasks/handlers.go b/backend-rest-go/pkg/tasks/handlers.go similarity index 98% rename from backend-golang-rest/pkg/tasks/handlers.go rename to backend-rest-go/pkg/tasks/handlers.go index a51b7c7..33d421a 100644 --- a/backend-golang-rest/pkg/tasks/handlers.go +++ b/backend-rest-go/pkg/tasks/handlers.go @@ -7,7 +7,7 @@ import ( "github.com/gin-gonic/gin" "github.com/google/uuid" - "github.com/tonitienda/kadai/backend-golang-rest/pkg/common" + "github.com/tonitienda/kadai/backend-rest-go/pkg/common" ) const ( diff --git a/backend-golang-rest/pkg/tasks/responses.go b/backend-rest-go/pkg/tasks/responses.go similarity index 100% rename from backend-golang-rest/pkg/tasks/responses.go rename to backend-rest-go/pkg/tasks/responses.go diff --git a/backend-js-rest/.gitignore b/backend-rest-js/.gitignore similarity index 100% rename from backend-js-rest/.gitignore rename to backend-rest-js/.gitignore diff --git a/backend-js-rest/Dockerfile b/backend-rest-js/Dockerfile similarity index 100% rename from backend-js-rest/Dockerfile rename to backend-rest-js/Dockerfile diff --git a/backend-js-rest/package-lock.json b/backend-rest-js/package-lock.json similarity index 99% rename from backend-js-rest/package-lock.json rename to backend-rest-js/package-lock.json index f751c41..e8cdaf9 100644 --- a/backend-js-rest/package-lock.json +++ b/backend-rest-js/package-lock.json @@ -1,11 +1,11 @@ { - "name": "backend-js-rest", + "name": "backend-rest-js", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "backend-js-rest", + "name": "backend-rest-js", "version": "1.0.0", "license": "ISC", "dependencies": { diff --git a/backend-js-rest/package.json b/backend-rest-js/package.json similarity index 90% rename from backend-js-rest/package.json rename to backend-rest-js/package.json index 8b0f742..6130053 100644 --- a/backend-js-rest/package.json +++ b/backend-rest-js/package.json @@ -1,5 +1,5 @@ { - "name": "backend-js-rest", + "name": "backend-rest-js", "version": "1.0.0", "description": "Backend for the Kadai application", "main": "src/index.js", diff --git a/backend-js-rest/src/index.js b/backend-rest-js/src/index.js similarity index 100% rename from backend-js-rest/src/index.js rename to backend-rest-js/src/index.js diff --git a/backend-js-rest/src/tasks/core.js b/backend-rest-js/src/tasks/core.js similarity index 100% rename from backend-js-rest/src/tasks/core.js rename to backend-rest-js/src/tasks/core.js diff --git a/backend-js-rest/src/tasks/db-in-memory.js b/backend-rest-js/src/tasks/db-in-memory.js similarity index 100% rename from backend-js-rest/src/tasks/db-in-memory.js rename to backend-rest-js/src/tasks/db-in-memory.js diff --git a/backend-js-rest/src/tasks/index.js b/backend-rest-js/src/tasks/index.js similarity index 100% rename from backend-js-rest/src/tasks/index.js rename to backend-rest-js/src/tasks/index.js diff --git a/backend-js-rest/src/tasks/router.js b/backend-rest-js/src/tasks/router.js similarity index 100% rename from backend-js-rest/src/tasks/router.js rename to backend-rest-js/src/tasks/router.js diff --git a/bdd-go/acceptance_test.go b/bdd-go/acceptance_test.go index 103e675..635bbee 100644 --- a/bdd-go/acceptance_test.go +++ b/bdd-go/acceptance_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/cucumber/godog" - "github.com/tonitienda/kadai/acceptance-go/pkg/api" + "github.com/tonitienda/kadai/bdd-go/pkg/api" ) type TestsImpl interface { diff --git a/bdd-go/go.mod b/bdd-go/go.mod index 86f8c90..292dddc 100644 --- a/bdd-go/go.mod +++ b/bdd-go/go.mod @@ -1,4 +1,4 @@ -module github.com/tonitienda/kadai/acceptance-go +module github.com/tonitienda/kadai/bdd-go go 1.22.1 diff --git a/compose.go-backend.yaml b/compose.backend-go.yaml similarity index 62% rename from compose.go-backend.yaml rename to compose.backend-go.yaml index 7acd956..ba4389a 100644 --- a/compose.go-backend.yaml +++ b/compose.backend-go.yaml @@ -1,8 +1,7 @@ -version: '3.7' services: backend: build: - context: ./backend-golang-rest + context: ./backend-rest-go dockerfile: Dockerfile env_file: - .env \ No newline at end of file diff --git a/compose.js-backend.yaml b/compose.backend-js.yaml similarity index 64% rename from compose.js-backend.yaml rename to compose.backend-js.yaml index 5398aa2..1ebd162 100644 --- a/compose.js-backend.yaml +++ b/compose.backend-js.yaml @@ -1,8 +1,7 @@ -version: '3.7' services: backend: build: - context: ./backend-js-rest + context: ./backend-rest-js dockerfile: Dockerfile env_file: - .env diff --git a/compose.db-inmemory.yaml b/compose.db-inmemory.yaml index 57cd3d6..889cd4b 100644 --- a/compose.db-inmemory.yaml +++ b/compose.db-inmemory.yaml @@ -1,4 +1,3 @@ -version: '3.7' services: backend: environment: diff --git a/compose.db-mongo.yaml b/compose.db-mongo.yaml index 05f7647..37f2b72 100644 --- a/compose.db-mongo.yaml +++ b/compose.db-mongo.yaml @@ -1,4 +1,3 @@ -version: '3.7' services: backend: environment: diff --git a/compose.dev.yaml b/compose.dev.yaml index 9fa1d6a..142f70c 100644 --- a/compose.dev.yaml +++ b/compose.dev.yaml @@ -1,4 +1,3 @@ -version: '3.7' services: webapp: build: diff --git a/compose.e2e-cypress.yaml b/compose.e2e-cypress.yaml index 394be50..4c02642 100644 --- a/compose.e2e-cypress.yaml +++ b/compose.e2e-cypress.yaml @@ -1,4 +1,3 @@ -version: '3.7' services: e2e: build: diff --git a/compose.expose-ports.yaml b/compose.expose-ports.yaml index f8c4e10..4ea8bbd 100644 --- a/compose.expose-ports.yaml +++ b/compose.expose-ports.yaml @@ -1,4 +1,3 @@ -version: '3.7' services: backend: ports: diff --git a/compose.golang-htmx-frontend.yaml b/compose.frontend-htmx-go.yaml similarity index 78% rename from compose.golang-htmx-frontend.yaml rename to compose.frontend-htmx-go.yaml index 6823203..f961b59 100644 --- a/compose.golang-htmx-frontend.yaml +++ b/compose.frontend-htmx-go.yaml @@ -1,8 +1,7 @@ -version: '3.7' services: webapp: build: - context: ./webapp-golang-htmx + context: ./webapp-htmx-go dockerfile: Dockerfile depends_on: - backend diff --git a/compose.next-frontend.yaml b/compose.frontend-nextjs.yaml similarity index 91% rename from compose.next-frontend.yaml rename to compose.frontend-nextjs.yaml index 39d707e..6007730 100644 --- a/compose.next-frontend.yaml +++ b/compose.frontend-nextjs.yaml @@ -1,4 +1,3 @@ -version: '3.7' services: webapp: build: diff --git a/compose.e2e-bdd-go.yaml b/compose.system-bdd-go.yaml similarity index 90% rename from compose.e2e-bdd-go.yaml rename to compose.system-bdd-go.yaml index e2fbcec..a0dbc7e 100644 --- a/compose.e2e-bdd-go.yaml +++ b/compose.system-bdd-go.yaml @@ -1,4 +1,3 @@ -version: '3.7' services: e2e: build: diff --git a/generate-justfile.js b/generate-justfile.js index 840d398..b91747c 100644 --- a/generate-justfile.js +++ b/generate-justfile.js @@ -1,41 +1,28 @@ const fs = require("node:fs"); -const frontEnds = ["next", "golang-htmx"]; +const frontEnds = ["nextjs", "htmx-go"]; const backends = ["go", "js"]; const e2eRunners = ["cypress"]; -const apiRunners = ["bdd-go"]; +const systemtests = ["bdd-go"]; const dbs = ["inmemory", "mongo"]; const makeJustE2ETestTasks = ({ frontend, backend, runner, db }) => ` test-${runner}-${frontend}-${backend}-${db}: - docker compose \\ - -f compose.${frontend}-frontend.yaml \\ - -f compose.${backend}-backend.yaml \\ - -f compose.db-${db}.yaml \\ - -f compose.e2e-${runner}.yaml \\ - config - COMPOSE_PROJECT_NAME="kadai-${runner}-${frontend}-${backend}-${db}" docker compose \\ - -f compose.${frontend}-frontend.yaml \\ - -f compose.${backend}-backend.yaml \\ + -f compose.frontend-${frontend}.yaml \\ + -f compose.backend-${backend}.yaml \\ -f compose.db-${db}.yaml \\ -f compose.e2e-${runner}.yaml \\ up --build --exit-code-from e2e `; -const makeJustApiTestTasks = ({ backend, runner, db }) => ` +const makeJustSystemTestTasks = ({ backend, runner, db }) => ` test-${runner}-${backend}-${db}: - docker compose \\ - -f compose.${backend}-backend.yaml \\ - -f compose.db-${db}.yaml \\ - -f compose.e2e-${runner}.yaml \\ - config - COMPOSE_PROJECT_NAME="kadai-${runner}-${backend}-${db}" docker compose \\ - -f compose.${backend}-backend.yaml \\ + -f compose.backend-${backend}.yaml \\ -f compose.db-${db}.yaml \\ - -f compose.e2e-${runner}.yaml \\ + -f compose.system-${runner}.yaml \\ up --build --exit-code-from e2e `; @@ -43,12 +30,6 @@ test-${runner}-${backend}-${db}: const makeJustStartTasks = ({ frontend, backend, db }) => ` start-${frontend}-${backend}-${db}: - docker compose \\ - -f compose.${frontend}-frontend.yaml \\ - -f compose.${backend}-backend.yaml \\ - -f compose.db-${db}.yaml \\ - config - COMPOSE_PROJECT_NAME="kadai-${frontend}-${backend}-${db}" docker compose \\ -f compose.${frontend}-frontend.yaml \\ -f compose.${backend}-backend.yaml \\ @@ -72,8 +53,8 @@ const appCombinations = frontEnds.flatMap((f) => })) ); -const apiTestsCombinations = apiCombinations.flatMap((a) => - apiRunners.flatMap((r) => ({ +const systemTestsCombinations = apiCombinations.flatMap((a) => + systemtests.flatMap((r) => ({ ...a, runner: r, })) @@ -87,6 +68,10 @@ const e2eTestsCombinations = appCombinations.flatMap((a) => ); const contents = + ` +unit-test: + @echo "No unit tests found" +` + appCombinations.reduce( (contents, combination) => contents + makeJustStartTasks(combination), "" @@ -95,8 +80,8 @@ const contents = (contents, combination) => contents + makeJustE2ETestTasks(combination), "" ) + - apiTestsCombinations.reduce( - (contents, combination) => contents + makeJustApiTestTasks(combination), + systemTestsCombinations.reduce( + (contents, combination) => contents + makeJustSystemTestTasks(combination), "" ); diff --git a/justfile b/justfile index 6123958..b756cd1 100644 --- a/justfile +++ b/justfile @@ -1,14 +1,17 @@ +unit-test: + @echo "No unit tests found" + -start-next-go-inmemory: +start-nextjs-go-inmemory: docker compose \ - -f compose.next-frontend.yaml \ + -f compose.nextjs-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-inmemory.yaml \ config - COMPOSE_PROJECT_NAME="kadai-next-go-inmemory" docker compose \ - -f compose.next-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-nextjs-go-inmemory" docker compose \ + -f compose.nextjs-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-inmemory.yaml \ -f compose.expose-ports.yaml \ @@ -16,15 +19,15 @@ start-next-go-inmemory: -start-next-go-mongo: +start-nextjs-go-mongo: docker compose \ - -f compose.next-frontend.yaml \ + -f compose.nextjs-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-mongo.yaml \ config - COMPOSE_PROJECT_NAME="kadai-next-go-mongo" docker compose \ - -f compose.next-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-nextjs-go-mongo" docker compose \ + -f compose.nextjs-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-mongo.yaml \ -f compose.expose-ports.yaml \ @@ -32,15 +35,15 @@ start-next-go-mongo: -start-next-js-inmemory: +start-nextjs-js-inmemory: docker compose \ - -f compose.next-frontend.yaml \ + -f compose.nextjs-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-inmemory.yaml \ config - COMPOSE_PROJECT_NAME="kadai-next-js-inmemory" docker compose \ - -f compose.next-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-nextjs-js-inmemory" docker compose \ + -f compose.nextjs-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-inmemory.yaml \ -f compose.expose-ports.yaml \ @@ -48,15 +51,15 @@ start-next-js-inmemory: -start-next-js-mongo: +start-nextjs-js-mongo: docker compose \ - -f compose.next-frontend.yaml \ + -f compose.nextjs-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-mongo.yaml \ config - COMPOSE_PROJECT_NAME="kadai-next-js-mongo" docker compose \ - -f compose.next-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-nextjs-js-mongo" docker compose \ + -f compose.nextjs-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-mongo.yaml \ -f compose.expose-ports.yaml \ @@ -64,15 +67,15 @@ start-next-js-mongo: -start-golang-htmx-go-inmemory: +start-htmx-go-go-inmemory: docker compose \ - -f compose.golang-htmx-frontend.yaml \ + -f compose.htmx-go-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-inmemory.yaml \ config - COMPOSE_PROJECT_NAME="kadai-golang-htmx-go-inmemory" docker compose \ - -f compose.golang-htmx-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-htmx-go-go-inmemory" docker compose \ + -f compose.htmx-go-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-inmemory.yaml \ -f compose.expose-ports.yaml \ @@ -80,15 +83,15 @@ start-golang-htmx-go-inmemory: -start-golang-htmx-go-mongo: +start-htmx-go-go-mongo: docker compose \ - -f compose.golang-htmx-frontend.yaml \ + -f compose.htmx-go-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-mongo.yaml \ config - COMPOSE_PROJECT_NAME="kadai-golang-htmx-go-mongo" docker compose \ - -f compose.golang-htmx-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-htmx-go-go-mongo" docker compose \ + -f compose.htmx-go-frontend.yaml \ -f compose.go-backend.yaml \ -f compose.db-mongo.yaml \ -f compose.expose-ports.yaml \ @@ -96,15 +99,15 @@ start-golang-htmx-go-mongo: -start-golang-htmx-js-inmemory: +start-htmx-go-js-inmemory: docker compose \ - -f compose.golang-htmx-frontend.yaml \ + -f compose.htmx-go-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-inmemory.yaml \ config - COMPOSE_PROJECT_NAME="kadai-golang-htmx-js-inmemory" docker compose \ - -f compose.golang-htmx-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-htmx-go-js-inmemory" docker compose \ + -f compose.htmx-go-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-inmemory.yaml \ -f compose.expose-ports.yaml \ @@ -112,144 +115,144 @@ start-golang-htmx-js-inmemory: -start-golang-htmx-js-mongo: +start-htmx-go-js-mongo: docker compose \ - -f compose.golang-htmx-frontend.yaml \ + -f compose.htmx-go-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-mongo.yaml \ config - COMPOSE_PROJECT_NAME="kadai-golang-htmx-js-mongo" docker compose \ - -f compose.golang-htmx-frontend.yaml \ + COMPOSE_PROJECT_NAME="kadai-htmx-go-js-mongo" docker compose \ + -f compose.htmx-go-frontend.yaml \ -f compose.js-backend.yaml \ -f compose.db-mongo.yaml \ -f compose.expose-ports.yaml \ up --build -test-cypress-next-go-inmemory: +test-cypress-nextjs-go-inmemory: docker compose \ - -f compose.next-frontend.yaml \ - -f compose.go-backend.yaml \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-go.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-next-go-inmemory" docker compose \ - -f compose.next-frontend.yaml \ - -f compose.go-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-nextjs-go-inmemory" docker compose \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-go.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e -test-cypress-next-go-mongo: +test-cypress-nextjs-go-mongo: docker compose \ - -f compose.next-frontend.yaml \ - -f compose.go-backend.yaml \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-go.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-next-go-mongo" docker compose \ - -f compose.next-frontend.yaml \ - -f compose.go-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-nextjs-go-mongo" docker compose \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-go.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e -test-cypress-next-js-inmemory: +test-cypress-nextjs-js-inmemory: docker compose \ - -f compose.next-frontend.yaml \ - -f compose.js-backend.yaml \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-js.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-next-js-inmemory" docker compose \ - -f compose.next-frontend.yaml \ - -f compose.js-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-nextjs-js-inmemory" docker compose \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-js.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e -test-cypress-next-js-mongo: +test-cypress-nextjs-js-mongo: docker compose \ - -f compose.next-frontend.yaml \ - -f compose.js-backend.yaml \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-js.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-next-js-mongo" docker compose \ - -f compose.next-frontend.yaml \ - -f compose.js-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-nextjs-js-mongo" docker compose \ + -f compose.frontend-nextjs.yaml \ + -f compose.backend-js.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e -test-cypress-golang-htmx-go-inmemory: +test-cypress-htmx-go-go-inmemory: docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.go-backend.yaml \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-go.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-golang-htmx-go-inmemory" docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.go-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-htmx-go-go-inmemory" docker compose \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-go.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e -test-cypress-golang-htmx-go-mongo: +test-cypress-htmx-go-go-mongo: docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.go-backend.yaml \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-go.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-golang-htmx-go-mongo" docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.go-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-htmx-go-go-mongo" docker compose \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-go.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e -test-cypress-golang-htmx-js-inmemory: +test-cypress-htmx-go-js-inmemory: docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.js-backend.yaml \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-js.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-golang-htmx-js-inmemory" docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.js-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-htmx-go-js-inmemory" docker compose \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-js.yaml \ -f compose.db-inmemory.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e -test-cypress-golang-htmx-js-mongo: +test-cypress-htmx-go-js-mongo: docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.js-backend.yaml \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-js.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ config - COMPOSE_PROJECT_NAME="kadai-cypress-golang-htmx-js-mongo" docker compose \ - -f compose.golang-htmx-frontend.yaml \ - -f compose.js-backend.yaml \ + COMPOSE_PROJECT_NAME="kadai-cypress-htmx-go-js-mongo" docker compose \ + -f compose.frontend-htmx-go.yaml \ + -f compose.backend-js.yaml \ -f compose.db-mongo.yaml \ -f compose.e2e-cypress.yaml \ up --build --exit-code-from e2e @@ -257,56 +260,56 @@ test-cypress-golang-htmx-js-mongo: test-bdd-go-go-inmemory: docker compose \ - -f compose.go-backend.yaml \ + -f compose.backend-go.yaml \ -f compose.db-inmemory.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ config COMPOSE_PROJECT_NAME="kadai-bdd-go-go-inmemory" docker compose \ - -f compose.go-backend.yaml \ + -f compose.backend-go.yaml \ -f compose.db-inmemory.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ up --build --exit-code-from e2e test-bdd-go-go-mongo: docker compose \ - -f compose.go-backend.yaml \ + -f compose.backend-go.yaml \ -f compose.db-mongo.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ config COMPOSE_PROJECT_NAME="kadai-bdd-go-go-mongo" docker compose \ - -f compose.go-backend.yaml \ + -f compose.backend-go.yaml \ -f compose.db-mongo.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ up --build --exit-code-from e2e test-bdd-go-js-inmemory: docker compose \ - -f compose.js-backend.yaml \ + -f compose.backend-js.yaml \ -f compose.db-inmemory.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ config COMPOSE_PROJECT_NAME="kadai-bdd-go-js-inmemory" docker compose \ - -f compose.js-backend.yaml \ + -f compose.backend-js.yaml \ -f compose.db-inmemory.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ up --build --exit-code-from e2e test-bdd-go-js-mongo: docker compose \ - -f compose.js-backend.yaml \ + -f compose.backend-js.yaml \ -f compose.db-mongo.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ config COMPOSE_PROJECT_NAME="kadai-bdd-go-js-mongo" docker compose \ - -f compose.js-backend.yaml \ + -f compose.backend-js.yaml \ -f compose.db-mongo.yaml \ - -f compose.e2e-bdd-go.yaml \ + -f compose.system-bdd-go.yaml \ up --build --exit-code-from e2e diff --git a/webapp-golang-htmx/Dockerfile b/webapp-htmx-go/Dockerfile similarity index 100% rename from webapp-golang-htmx/Dockerfile rename to webapp-htmx-go/Dockerfile diff --git a/webapp-golang-htmx/cmd/main.go b/webapp-htmx-go/cmd/main.go similarity index 97% rename from webapp-golang-htmx/cmd/main.go rename to webapp-htmx-go/cmd/main.go index 1b0947b..22a9ae3 100644 --- a/webapp-golang-htmx/cmd/main.go +++ b/webapp-htmx-go/cmd/main.go @@ -10,8 +10,8 @@ import ( "os" "strings" - authenticator "github.com/tonitienda/kadai/webapp-golang-htmx/pkg/auth" - "github.com/tonitienda/kadai/webapp-golang-htmx/pkg/tasks" + authenticator "github.com/tonitienda/kadai/webapp-htmx-go/pkg/auth" + "github.com/tonitienda/kadai/webapp-htmx-go/pkg/tasks" "golang.org/x/oauth2" ) diff --git a/webapp-golang-htmx/go.mod b/webapp-htmx-go/go.mod similarity index 86% rename from webapp-golang-htmx/go.mod rename to webapp-htmx-go/go.mod index 0a05c13..7da001f 100644 --- a/webapp-golang-htmx/go.mod +++ b/webapp-htmx-go/go.mod @@ -1,4 +1,4 @@ -module github.com/tonitienda/kadai/webapp-golang-htmx +module github.com/tonitienda/kadai/webapp-htmx-go go 1.22.1 diff --git a/webapp-golang-htmx/go.sum b/webapp-htmx-go/go.sum similarity index 100% rename from webapp-golang-htmx/go.sum rename to webapp-htmx-go/go.sum diff --git a/webapp-golang-htmx/pkg/auth/authenticator.go b/webapp-htmx-go/pkg/auth/authenticator.go similarity index 100% rename from webapp-golang-htmx/pkg/auth/authenticator.go rename to webapp-htmx-go/pkg/auth/authenticator.go diff --git a/webapp-golang-htmx/pkg/tasks/tasks.go b/webapp-htmx-go/pkg/tasks/tasks.go similarity index 100% rename from webapp-golang-htmx/pkg/tasks/tasks.go rename to webapp-htmx-go/pkg/tasks/tasks.go diff --git a/webapp-golang-htmx/templates/index.html b/webapp-htmx-go/templates/index.html similarity index 100% rename from webapp-golang-htmx/templates/index.html rename to webapp-htmx-go/templates/index.html diff --git a/webapp-golang-htmx/templates/task-list.html b/webapp-htmx-go/templates/task-list.html similarity index 100% rename from webapp-golang-htmx/templates/task-list.html rename to webapp-htmx-go/templates/task-list.html