this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

:boom: create `shared` and `server` modules

+125 -70
+2 -2
.dockerignore
··· 17 17 build 18 18 dev 19 19 test 20 - justfile 21 - priv/static 20 + 21 + server/priv/static
+2 -3
.gitignore
··· 1 1 *.beam 2 2 *.ez 3 - /build 3 + build 4 4 erl_crash.dump 5 5 6 - priv/static/ 7 - priv/static/ 6 + server/priv/static
Containerfile server/Containerfile
gleam.toml server/gleam.toml
+2 -65
justfile
··· 1 - # database 2 - 3 - pg_image := "docker.io/postgres:18-alpine" 4 - pg_env := "-e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB" 5 - pg_volume := "-v ./sql/create:/docker-entrypoint-initdb.d" 6 - pg_health_cmd := "--health-cmd 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'" 7 - pg_health_conf := "--health-interval 10s --health-retries 3 --health-timeout 5s" 8 - pg_health_start_period := "--health-start-period 30s" 9 - 10 - # server 11 - 12 - server_name := "senac_backend" 13 - server_port := "-p 8000:8000" 14 - server_health_cmd := "--health-cmd 'wget -q --spider http://127.0.0.1:8000/healthcheck || exit 1'" 15 - server_health_conf := "--health-interval 30s --health-retries 3 --health-timeout 10s" 16 - server_health_start_period := "--health-start-period 10s" 1 + mod server 2 + mod db 'server/.just/db.just' 17 3 18 4 @_default: 19 5 just --list 20 - 21 - #  Generate SQL queries 22 - [group("dev")] 23 - sql: 24 - gleam run -m squirrel 25 - 26 - #  Update project dependencies 27 - [group("dev")] 28 - @_deps-update: 29 - gleam deps update 30 - 31 - # 󰏖 Build the server container image 32 - [group("podman")] 33 - build-server: 34 - podman build -t {{ server_name }} . 35 - 36 - #  Run database container 37 - [group("podman")] 38 - [no-cd] 39 - @init-database pod_name: 40 - podman run -d \ 41 - --pod {{ pod_name }} --name db \ 42 - {{ pg_env }} {{ pg_volume }} \ 43 - {{ pg_health_cmd }} {{ pg_health_conf }} {{ pg_health_start_period }} \ 44 - {{ pg_image }} 45 - 46 - #  Run app container 47 - [group("podman")] 48 - @init-server pod_name: build-server 49 - podman run -d \ 50 - --pod {{ pod_name }} \ 51 - --name server \ 52 - -e DATABASE_URL -e SECRET_KEY \ 53 - {{ server_health_cmd }} \ 54 - {{ server_health_conf }} \ 55 - {{ server_health_start_period }} \ 56 - {{ server_name }} 57 - 58 - [group("dev")] 59 - _test: 60 - gleam test 61 - 62 - [group("dev")] 63 - @_lint: 64 - sqruff lint 65 - gleam check 66 - 67 - @_fmt: 68 - gleam format
manifest.toml server/manifest.toml
+21
server/.just/db.just
··· 1 + # database 2 + 3 + pg_image := "docker.io/postgres:18-alpine" 4 + pg_env := "-e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB" 5 + pg_volume := "-v ./server/sql/create:/docker-entrypoint-initdb.d" 6 + pg_health_cmd := "--health-cmd 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'" 7 + pg_health_conf := "--health-interval 10s --health-retries 3 --health-timeout 5s" 8 + pg_health_start_period := "--health-start-period 30s" 9 + 10 + @_default: 11 + just --list 12 + 13 + #  Run database container 14 + [group("podman")] 15 + [no-cd] 16 + @init-database pod_name: 17 + podman run -d \ 18 + --pod {{ pod_name }} --name db \ 19 + {{ pg_env }} {{ pg_volume }} \ 20 + {{ pg_health_cmd }} {{ pg_health_conf }} {{ pg_health_start_period }} \ 21 + {{ pg_image }}
+47
server/justfile
··· 1 + image_name := "senac_backend" 2 + port := "-p 8000:8000" 3 + health_cmd := "--health-cmd 'wget -q --spider http://127.0.0.1:8000/healthcheck || exit 1'" 4 + health_conf := "--health-interval 30s --health-retries 3 --health-timeout 10s" 5 + health_start_period := "--health-start-period 10s" 6 + 7 + @_default: 8 + just --list 9 + 10 + #  Generate SQL queries 11 + [group("dev")] 12 + sql: 13 + gleam run -m squirrel 14 + 15 + #  Update project dependencies 16 + [group("dev")] 17 + @_deps-update: 18 + gleam deps update 19 + 20 + # 󰏖 Build the server container image 21 + [group("podman")] 22 + build: 23 + podman build -t {{ image_name }} . 24 + 25 + #  Run app container 26 + [group("podman")] 27 + @init-server pod_name: build 28 + podman run -d \ 29 + --pod {{ pod_name }} \ 30 + --name server \ 31 + -e DATABASE_URL -e SECRET_KEY \ 32 + {{ health_cmd }} \ 33 + {{ health_conf }} \ 34 + {{ health_start_period }} \ 35 + {{ image_name }} 36 + 37 + [group("dev")] 38 + _test: 39 + gleam test 40 + 41 + [group("dev")] 42 + @_lint: 43 + sqruff lint 44 + gleam check 45 + 46 + @_fmt: 47 + gleam format
+23
shared/.github/workflows/test.yml
··· 1 + name: test 2 + 3 + on: 4 + push: 5 + branches: 6 + - master 7 + - main 8 + pull_request: 9 + 10 + jobs: 11 + test: 12 + runs-on: ubuntu-latest 13 + steps: 14 + - uses: actions/checkout@v6 15 + - uses: erlef/setup-beam@v1 16 + with: 17 + otp-version: "28" 18 + gleam-version: "1.15.4" 19 + rebar3-version: "3" 20 + # elixir-version: "1" 21 + - run: gleam deps download 22 + - run: gleam test 23 + - run: gleam format --check src test
+4
shared/.gitignore
··· 1 + *.beam 2 + *.ez 3 + /build 4 + erl_crash.dump
+19
shared/gleam.toml
··· 1 + name = "shared" 2 + version = "1.0.0" 3 + 4 + # Fill out these fields if you intend to generate HTML documentation or publish 5 + # your project to the Hex package manager. 6 + # 7 + # description = "" 8 + # licences = ["Apache-2.0"] 9 + # repository = { type = "github", user = "", repo = "" } 10 + # links = [{ title = "Website", href = "" }] 11 + # 12 + # For a full reference of all the available options, you can have a look at 13 + # https://gleam.run/writing-gleam/gleam-toml/. 14 + 15 + [dependencies] 16 + gleam_stdlib = ">= 0.44.0 and < 2.0.0" 17 + 18 + [dev_dependencies] 19 + gleeunit = ">= 1.0.0 and < 2.0.0"
+5
shared/src/shared.gleam
··· 1 + import gleam/io 2 + 3 + pub fn main() -> Nil { 4 + io.println("Hello from shared!") 5 + }
src/server.gleam server/src/server.gleam
src/server/auth.gleam server/src/server/auth.gleam
src/server/context.gleam server/src/server/context.gleam
src/server/router.gleam server/src/server/router.gleam
src/server/supervision_tree.gleam server/src/server/supervision_tree.gleam