minor updates for gleam
This commit is contained in:
parent
7db864bb64
commit
9c7a6f01dd
5 changed files with 59 additions and 4 deletions
|
|
@ -1,2 +1,3 @@
|
||||||
elixir 1.19.0-rc.0-otp-27
|
elixir 1.19.0-rc.0-otp-27
|
||||||
erlang 27.3.4
|
erlang 27.3.4
|
||||||
|
gleam 1.11.1
|
||||||
|
|
|
||||||
12
CLAUDE.md
12
CLAUDE.md
|
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Before setting up the project, ensure you have the following installed:
|
||||||
|
- Elixir 1.17+
|
||||||
|
- Erlang/OTP
|
||||||
|
- PostgreSQL with PostGIS extension
|
||||||
|
- **Gleam** (required for Gleam modules) - Install from https://gleam.run/getting-started/installing/
|
||||||
|
|
||||||
## Project Overview
|
## Project Overview
|
||||||
|
|
||||||
This is an Elixir Phoenix LiveView application that serves as a real-time APRS (Automatic Packet Reporting System) tracker and visualizer. It connects to the APRS-IS network to receive live amateur radio packets and displays them on an interactive map interface.
|
This is an Elixir Phoenix LiveView application that serves as a real-time APRS (Automatic Packet Reporting System) tracker and visualizer. It connects to the APRS-IS network to receive live amateur radio packets and displays them on an interactive map interface.
|
||||||
|
|
@ -9,7 +17,8 @@ This is an Elixir Phoenix LiveView application that serves as a real-time APRS (
|
||||||
## Development Commands
|
## Development Commands
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
- `mix setup` - Complete project setup (deps.get + ecto.setup)
|
- `mix archive.install hex mix_gleam --force` - Install mix_gleam archive (required first step)
|
||||||
|
- `mix setup` - Complete project setup (deps.get + ecto.setup + gleam compilation)
|
||||||
- `mix deps.get` - Install dependencies
|
- `mix deps.get` - Install dependencies
|
||||||
- `mix ecto.setup` - Create database, run migrations, and seed data
|
- `mix ecto.setup` - Create database, run migrations, and seed data
|
||||||
- `mix ecto.reset` - Drop and recreate database
|
- `mix ecto.reset` - Drop and recreate database
|
||||||
|
|
@ -56,6 +65,7 @@ This is an Elixir Phoenix LiveView application that serves as a real-time APRS (
|
||||||
- Oban for background job processing
|
- Oban for background job processing
|
||||||
- GenStage for packet processing pipelines
|
- GenStage for packet processing pipelines
|
||||||
- Tailwind CSS + ESBuild for frontend assets (no Node.js)
|
- Tailwind CSS + ESBuild for frontend assets (no Node.js)
|
||||||
|
- Gleam for additional type-safe modules (requires mix_gleam archive)
|
||||||
|
|
||||||
## Test-Driven Development
|
## Test-Driven Development
|
||||||
|
|
||||||
|
|
|
||||||
21
README.md
21
README.md
|
|
@ -1,9 +1,26 @@
|
||||||
# Aprs
|
# Aprs
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Before setting up the project, ensure you have the following installed:
|
||||||
|
- Elixir 1.17+
|
||||||
|
- Erlang/OTP
|
||||||
|
- PostgreSQL with PostGIS extension
|
||||||
|
- **Gleam** - Required for Gleam modules. Install from https://gleam.run/getting-started/installing/
|
||||||
|
- If using asdf: `asdf install` (will use versions from .tool-versions)
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
To start your Phoenix server:
|
To start your Phoenix server:
|
||||||
|
|
||||||
* Install dependencies with `mix deps.get`
|
* First install the mix_gleam archive:
|
||||||
* Create and migrate your database with `mix ecto.setup`
|
```bash
|
||||||
|
mix archive.install hex mix_gleam --force
|
||||||
|
```
|
||||||
|
* Run the complete setup:
|
||||||
|
```bash
|
||||||
|
mix setup
|
||||||
|
```
|
||||||
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
|
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
|
||||||
|
|
||||||
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
|
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
|
||||||
|
|
|
||||||
27
lib/mix/tasks/setup_gleam.ex
Normal file
27
lib/mix/tasks/setup_gleam.ex
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
defmodule Mix.Tasks.SetupGleam do
|
||||||
|
use Mix.Task
|
||||||
|
|
||||||
|
@shortdoc "Installs mix_gleam archive if not already installed"
|
||||||
|
|
||||||
|
def run(_) do
|
||||||
|
if archive_installed?() do
|
||||||
|
Mix.shell().info("mix_gleam archive already installed")
|
||||||
|
else
|
||||||
|
Mix.shell().info("Installing mix_gleam archive...")
|
||||||
|
# Use System.cmd to avoid Mix dependency issues
|
||||||
|
{_, 0} = System.cmd("mix", ["archive.install", "hex", "mix_gleam", "--force"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp archive_installed? do
|
||||||
|
archives_path = Path.join([Mix.Utils.mix_home(), "archives"])
|
||||||
|
|
||||||
|
if File.exists?(archives_path) do
|
||||||
|
archives_path
|
||||||
|
|> File.ls!()
|
||||||
|
|> Enum.any?(&String.starts_with?(&1, "mix_gleam"))
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
2
mix.exs
2
mix.exs
|
|
@ -128,7 +128,7 @@ defmodule Aprsme.MixProject do
|
||||||
# See the documentation for `Mix` for more info on aliases.
|
# See the documentation for `Mix` for more info on aliases.
|
||||||
defp aliases do
|
defp aliases do
|
||||||
[
|
[
|
||||||
setup: ["deps.get", "ecto.setup", "gleam_compile"],
|
setup: ["setup_gleam", "deps.get", "ecto.setup", "gleam_compile"],
|
||||||
compile: ["gleam_compile", "compile"],
|
compile: ["gleam_compile", "compile"],
|
||||||
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
|
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
|
||||||
"ecto.reset": ["ecto.drop", "ecto.setup"],
|
"ecto.reset": ["ecto.drop", "ecto.setup"],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue