chore: use devbox
All checks were successful
/ build (map[dockerfile:./services/app/Dockerfile name:app]) (push) Successful in 1m47s
/ build (map[dockerfile:./services/hasura/Dockerfile name:hasura]) (push) Successful in 2m7s
/ build (map[dockerfile:./services/files/Dockerfile name:files]) (push) Successful in 1m48s
/ build (map[dockerfile:./services/tasks/Dockerfile name:tasks]) (push) Successful in 2m7s
/ build (map[dockerfile:./services/watchers/Dockerfile name:watchers]) (push) Successful in 2m4s
/ build (map[dockerfile:./services/api/Dockerfile name:api]) (push) Successful in 2m16s
/ build (map[dockerfile:./services/web/Dockerfile name:web]) (push) Successful in 25s
/ deploy (push) Successful in 12s
All checks were successful
/ build (map[dockerfile:./services/app/Dockerfile name:app]) (push) Successful in 1m47s
/ build (map[dockerfile:./services/hasura/Dockerfile name:hasura]) (push) Successful in 2m7s
/ build (map[dockerfile:./services/files/Dockerfile name:files]) (push) Successful in 1m48s
/ build (map[dockerfile:./services/tasks/Dockerfile name:tasks]) (push) Successful in 2m7s
/ build (map[dockerfile:./services/watchers/Dockerfile name:watchers]) (push) Successful in 2m4s
/ build (map[dockerfile:./services/api/Dockerfile name:api]) (push) Successful in 2m16s
/ build (map[dockerfile:./services/web/Dockerfile name:web]) (push) Successful in 25s
/ deploy (push) Successful in 12s
This commit is contained in:
parent
1f449e9f0c
commit
d1d8f725ce
6 changed files with 199 additions and 28 deletions
|
@ -20,9 +20,12 @@ CHANGELOG.md
|
||||||
docker-compose.build.yaml
|
docker-compose.build.yaml
|
||||||
|
|
||||||
# env
|
# env
|
||||||
.envrc
|
|
||||||
.env.local
|
.env.local
|
||||||
|
|
||||||
|
# devbox
|
||||||
|
devbox.lock
|
||||||
|
.devbox/
|
||||||
|
|
||||||
# git
|
# git
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|
||||||
|
|
24
.envrc
24
.envrc
|
@ -1,22 +1,2 @@
|
||||||
export PATH=$PWD/bin:$PWD/scripts:$PATH
|
# Automatically load the Devbox environment
|
||||||
export PROJECT_WORKINGDIR=$PWD
|
eval "$(devbox generate direnv --print-envrc)"
|
||||||
|
|
||||||
# appli
|
|
||||||
export JAVA_HOME=${JAVA_HOME:-"/opt/android-studio/jbr"}
|
|
||||||
export ANDROID_HOME=$HOME/Android/Sdk
|
|
||||||
export PATH=$PATH:$ANDROID_HOME/emulator
|
|
||||||
export PATH=$PATH:$ANDROID_HOME/tools
|
|
||||||
export PATH=$PATH:$ANDROID_HOME/tools/bin
|
|
||||||
export PATH=$PATH:$ANDROID_HOME/platform-tools
|
|
||||||
export NODE_OPTIONS"=--openssl-legacy-provider"
|
|
||||||
export LOCAL_DEV=true
|
|
||||||
|
|
||||||
# local pg
|
|
||||||
export PGHOST=localhost
|
|
||||||
export PGUSER=dev
|
|
||||||
export PGPASSWORD=dev
|
|
||||||
export PGPORT=${EXPOSE_PG_PORT:-4204}
|
|
||||||
|
|
||||||
# dotenv
|
|
||||||
dotenv_if_exists .env.default
|
|
||||||
dotenv_if_exists .env.local
|
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -7,6 +7,8 @@ yarn-error.log
|
||||||
.env.yaml
|
.env.yaml
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
|
.devbox/
|
||||||
|
|
||||||
.archive
|
.archive
|
||||||
/.osm-files
|
/.osm-files
|
||||||
/osm-files
|
/osm-files
|
||||||
|
|
52
DEVELOPER.md
52
DEVELOPER.md
|
@ -7,9 +7,9 @@ This document contains technical information for developers working on the Alert
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- Docker
|
- Docker
|
||||||
- Direnv
|
- Devbox
|
||||||
- Node.js (>=20)
|
- Android SDK (for mobile development)
|
||||||
- Yarn (v4.6.0+)
|
- Java 8+ (for Android development)
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
|
@ -19,12 +19,22 @@ git clone https://codeberg.org/alerte-secours/alerte-secours
|
||||||
cd alerte-secours
|
cd alerte-secours
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install dependencies:
|
2. Install devbox if not already installed:
|
||||||
|
```sh
|
||||||
|
curl -fsSL https://get.jetpack.io/devbox | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Enter devbox shell (this will automatically install Node.js 20 and Yarn 4.6.0):
|
||||||
|
```sh
|
||||||
|
devbox shell
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Install dependencies:
|
||||||
```sh
|
```sh
|
||||||
yarn
|
yarn
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Set up environment variables:
|
5. Set up environment variables:
|
||||||
```sh
|
```sh
|
||||||
cp .env.default .env
|
cp .env.default .env
|
||||||
```
|
```
|
||||||
|
@ -35,11 +45,43 @@ Start all services with:
|
||||||
```sh
|
```sh
|
||||||
yarn dev:up
|
yarn dev:up
|
||||||
```
|
```
|
||||||
|
Or using devbox scripts:
|
||||||
|
```sh
|
||||||
|
devbox run dev:up
|
||||||
|
```
|
||||||
|
|
||||||
View logs:
|
View logs:
|
||||||
```sh
|
```sh
|
||||||
yarn dev:logs
|
yarn dev:logs
|
||||||
```
|
```
|
||||||
|
Or using devbox:
|
||||||
|
```sh
|
||||||
|
devbox run dev:logs
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using Devbox
|
||||||
|
|
||||||
|
Once you're in the devbox shell, you have access to:
|
||||||
|
- Node.js 20 (automatically installed)
|
||||||
|
- Yarn 4.6.0 (automatically installed)
|
||||||
|
- All project scripts and environment variables
|
||||||
|
- PostgreSQL client tools
|
||||||
|
|
||||||
|
To exit the devbox shell:
|
||||||
|
```sh
|
||||||
|
exit
|
||||||
|
```
|
||||||
|
|
||||||
|
To run commands from outside the shell:
|
||||||
|
```sh
|
||||||
|
devbox run <command>
|
||||||
|
```
|
||||||
|
|
||||||
|
Available devbox scripts:
|
||||||
|
- `devbox run dev` - Start development environment
|
||||||
|
- `devbox run dev:up` - Start all services
|
||||||
|
- `devbox run dev:logs` - View development logs
|
||||||
|
- `devbox run console` - Open development console
|
||||||
|
|
||||||
### Public Staging Environment
|
### Public Staging Environment
|
||||||
|
|
||||||
|
|
52
devbox.json
Normal file
52
devbox.json
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.13.6/.schema/devbox.schema.json",
|
||||||
|
"packages": [
|
||||||
|
"nodejs_20",
|
||||||
|
"yarn",
|
||||||
|
"git",
|
||||||
|
"curl",
|
||||||
|
"jq"
|
||||||
|
],
|
||||||
|
"shell": {
|
||||||
|
"init_hook": [
|
||||||
|
"# Load environment variables from .env files",
|
||||||
|
"[ -f .env.default ] && export $(grep -v '^#' .env.default | xargs)",
|
||||||
|
"[ -f .env.local ] && export $(grep -v '^#' .env.local | xargs)",
|
||||||
|
"",
|
||||||
|
"# Project-specific PATH modifications",
|
||||||
|
"export PATH=$PWD/bin:$PWD/scripts:$PATH",
|
||||||
|
"export PROJECT_WORKINGDIR=$PWD",
|
||||||
|
"",
|
||||||
|
"# Node.js configuration",
|
||||||
|
"export NODE_OPTIONS=\"--openssl-legacy-provider\"",
|
||||||
|
"export LOCAL_DEV=true",
|
||||||
|
"",
|
||||||
|
"# Local PostgreSQL configuration",
|
||||||
|
"export PGHOST=localhost",
|
||||||
|
"export PGUSER=dev",
|
||||||
|
"export PGPASSWORD=dev",
|
||||||
|
"export PGPORT=${EXPOSE_PG_PORT:-4204}",
|
||||||
|
"",
|
||||||
|
"# Android development (system dependencies)",
|
||||||
|
"# Note: JAVA_HOME and ANDROID_HOME should be configured in your system",
|
||||||
|
"# These are kept as system dependencies as requested",
|
||||||
|
"if [ -n \"$ANDROID_HOME\" ]; then",
|
||||||
|
" export PATH=$PATH:$ANDROID_HOME/emulator",
|
||||||
|
" export PATH=$PATH:$ANDROID_HOME/tools",
|
||||||
|
" export PATH=$PATH:$ANDROID_HOME/tools/bin",
|
||||||
|
" export PATH=$PATH:$ANDROID_HOME/platform-tools",
|
||||||
|
"fi",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"dev": "yarn dev",
|
||||||
|
"dev:up": "yarn dev:up",
|
||||||
|
"dev:logs": "yarn dev:logs",
|
||||||
|
"console": "scripts/console"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "development",
|
||||||
|
"LOCAL_DEV": "true"
|
||||||
|
}
|
||||||
|
}
|
92
devbox.lock
Normal file
92
devbox.lock
Normal file
|
@ -0,0 +1,92 @@
|
||||||
|
{
|
||||||
|
"lockfile_version": "1",
|
||||||
|
"packages": {
|
||||||
|
"curl": {
|
||||||
|
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D#curl",
|
||||||
|
"source": "nixpkg",
|
||||||
|
"systems": {
|
||||||
|
"x86_64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "man",
|
||||||
|
"path": "/nix/store/bsga1570f0sxs832blngxcb7jcc706mw-curl-8.14.1-man",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bin",
|
||||||
|
"path": "/nix/store/vdl7fgasaimqnkr47xw8vq7alafv9zyx-curl-8.14.1-bin",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"git": {
|
||||||
|
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D#git",
|
||||||
|
"source": "nixpkg",
|
||||||
|
"systems": {
|
||||||
|
"x86_64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"path": "/nix/store/zhv8ib8y1zfi76afddfnp8fmm562bgaa-git-2.50.1",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"github:NixOS/nixpkgs/nixpkgs-unstable": {
|
||||||
|
"last_modified": "2025-09-05T01:14:44Z",
|
||||||
|
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?lastModified=1757034884&narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D"
|
||||||
|
},
|
||||||
|
"jq": {
|
||||||
|
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D#jq",
|
||||||
|
"source": "nixpkg",
|
||||||
|
"systems": {
|
||||||
|
"x86_64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "man",
|
||||||
|
"path": "/nix/store/xvv5ss0sb0y0bfi7m19smls37afsxmvi-jq-1.8.1-man",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "bin",
|
||||||
|
"path": "/nix/store/zjl3cfsqvwiz2g943sm15n1gghv793m3-jq-1.8.1-bin",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nodejs_20": {
|
||||||
|
"plugin_version": "0.0.2",
|
||||||
|
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D#nodejs_20",
|
||||||
|
"source": "nixpkg",
|
||||||
|
"systems": {
|
||||||
|
"x86_64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"path": "/nix/store/4i5h4acwfks571bagg651zdp0fybv93s-nodejs-20.19.4",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"yarn": {
|
||||||
|
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D#yarn",
|
||||||
|
"source": "nixpkg",
|
||||||
|
"systems": {
|
||||||
|
"x86_64-linux": {
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"path": "/nix/store/0wckc0rh5m1v74g0sb3xa9ax0rf1dfg5-yarn-1.22.22",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue