1
0
Fork 0

Compare commits

...

6 Commits
0.1.1 ... main

Author SHA1 Message Date
Ryan Rix ef88ee8c3b nix-shell needs all our deps 2021-07-06 18:34:20 -07:00
Ryan Rix 2c8e8598d0 Set up Phoenix.PubSub.Server 2021-07-06 18:33:55 -07:00
Ryan Rix 18bcb65523 remove the references to Foundation for Sites 2021-07-06 18:33:32 -07:00
Ryan Rix 141289e231 splatter 2021-07-05 22:09:56 -07:00
Ryan Rix 988034984a update some links 2021-07-05 22:09:55 -07:00
Ryan Rix c44c14adfb [build] integrating nixos shell for local dev 2021-07-05 22:09:55 -07:00
14 changed files with 70 additions and 70 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use nix

7
.gitignore vendored
View File

@ -1,4 +1,3 @@
# [[file:phoenix.org::*Project =.gitignore= file][Project =.gitignore= file:1]]
# elixir and mix outputs
/_build/
/cover/
@ -22,9 +21,7 @@ arcology-*.tar
/roles/
systemd.service.j2
deploy.yml
# Project =.gitignore= file:1 ends here
# [[file:phoenix.org::*Project =.gitignore= file][Project =.gitignore= file:2]]
/mix.exs
# /mix.lock is checked in.
.formatter.exs
@ -77,4 +74,6 @@ deploy.yml
/rel/vm.args.eex
/bin/build
/Dockerfile
# Project =.gitignore= file:2 ends here
# nixos crap
shell.nix

View File

@ -5,6 +5,7 @@
#+CREATED: [2020-09-22]
#+MODIFIED: [2020-09-22]
#+ARCOLOGY_KEY: arcology/index
#+AUTO_TANGLE: t
The Arcology is a system for publishing my org-mode documents to the web, an important component of Ryan Rix's [[file:../cce/cce.org][Complete Computing Environment]]. Rather than a pure static-site design, a directory full of "compiled HTML", the Arcology aims to provide *just enough* dynamicity to make publishing on the web simple, transparent, and powerful. Arcology uses the same database caching that Org Roam uses with some custom extensions to provide a web-view of a *subset of documents in my knowledge base*, and "indieweb" facilities around this like microformats, webmentions, indieauth, and some day a full ActivityPub implementation for my Journal and a "link blog" of my Archive posts.
@ -39,13 +40,34 @@ There is a [[file:Makefile][Makefile]] to make it easier to tangle the files. Yo
=make init= will tangle, download dependencies, and compile them.
* Nix Shell for Development Environment
#+begin_src nix :tangle shell.nix
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
packages = with pkgs; [
emacs-nox
sqlite
pandoc
redis
nodejs
inotify-tools
elixir_1_12
elixir_ls
];
}
#+end_src
* Developing in a REPL and a Babel doc
Arcology development requires a postgres database with a database called =arcology_dev=. run [[shell:mix ecto.setup]] (or click on that link!)
Executing this code will allow you to send the org-babel block under point to the REPL. I don't know how that handles =noweb=, blocks but it kinda works. Most of the time, I rely on *automatically tangling and recompiling*.
#+begin_src emacs-lisp :results none
#+CCE_MODULE: arcology-dev
#+begin_src emacs-lisp :results none :tangle ~/org/cce/arcology-dev.el
(use-package eval-in-repl
:config
(require 'eval-in-repl-ielm)
@ -82,13 +104,7 @@ alias Arcology.{Repo,Roam,Page}
IEx.configure(colors: [enabled: false])
#+end_src
To trigger a tangle after =org-src= blocks, run this code. Opening an =org-src= block will do a bunch of window-modification which isn't restored properly by =winner-mode=, so stepping in and out of =org-src= blocks kind of sucks. I have =C-x s= bound to =org-edit-src-save=, and attach this function to it with the Emacs [[info:elisp#Advising Functions][Advising Functions]].
#+begin_src emacs-lisp :results none
(defun arcology/tangle-on-block-save ()
(org-babel-tangle-file org-src-source-file-name))
(advice-add 'org-edit-src-save :after #'arcology/tangle-on-block-save)
#+end_src
=use-package= [[https://github.com/yilkalargaw/org-auto-tangle][org-auto-tangle]] and enable =org-auto-tangle-mode= to get automatic tangling.
To trigger a recompile in =iex= after tangle, execute this block. It'll also touch the files which the =Makefile= checks for "up-to-date"-ness in the =tangle= task which'll need to be run by build scripts. This code is kind of cursed; you see, org-babel has a pre-tangle hook which isn't so useful, but =current-buffer= is the org-mode doc. The post-tangle hook is ran in *each output file*. So this cursed code runs an idle timer!

View File

@ -65,10 +65,7 @@ This module contains the base HTML templates for the application, as well as the
In the base template I have three CSS entrypoints defined, and this is mirrored in [[file:assets/webpack.config.js::const path = require('path');][webpack.config.js]]:
- [[file:assets/css/app.scss][app.scss]] - semantic markup
- [[file:assets/css/foundation.scss][foundation.scss]] - the entire Foundation CSS bundle
- [[file:assets/css/aesthetics.scss][aesthetics.scss]] - a bundle containing font-face rules, colors, etc
Additionally, Foundation has a [[./assets/css/_settings.scss][_settings.scss]] file that is imported in a few places, it just sets a ton of =SCSS= variables.
- [[file:assets/css/aesthetics.scss][aesthetics.scss]] - a bundle containing font-face rules
* JavaScript
@ -95,24 +92,6 @@ import "../css/app.scss"
// }
#+end_src
** =js/foundation.js= -- foundation's code goes here.
Loading foundation is a pretty simple affair, =foundation.core= and whatever UI elements needed are all that are loaded, and then call the foundation initialization function. Easy.
#+begin_src js :tangle assets/js/foundation.js
// import "jquery"
//
// import "../css/foundation.scss"
//
// import 'foundation-sites/dist/js/plugins/foundation.core';
// import 'foundation-sites/dist/js/plugins/foundation.dropdownMenu.min.js';
// import 'foundation-sites/dist/js/plugins/foundation.util.keyboard.min.js';
// import 'foundation-sites/dist/js/plugins/foundation.util.box.min.js';
// import 'foundation-sites/dist/js/plugins/foundation.util.nest.min.js';
//
// $(document).foundation();
#+end_src
** =js/sw.js= -- Service Worker for Progressive Web App
It's not clear to me how well this will handle offline behavior, I'm not sure I really care for it, though I should. The service worker will let us figure that out later, for now it caches stylesheets.

View File

@ -2,6 +2,7 @@
#+ROAM_ALIAS: Arcology.Application Arcology.Repo
#+ARCOLOGY_KEY: arcology/application
#+ROAM_TAGS: Arcology
#+AUTO_TANGLE: t
In Elixir there is usually a frontend application which serves the Phoenix web site, and a backend service which it communicates with over Erlang messaging to do state management, business logic, and tasks like that, so that the frontend can stay as a "pure" MVC setup.
@ -50,6 +51,7 @@ def start(_type, _args) do
Arcology.Repo,
ArcologyWeb.Endpoint,
Arcology.FileNotifier,
{Phoenix.PubSub, [name: Arcology.PubSub, adapter: Phoenix.PubSub.Redis]},
{Task.Supervisor, name: Arcology.TaskSupervisor}
]

View File

@ -9,7 +9,7 @@ Copyright © 2020 Jethro Kuan <jethrokuan95@gmail.com>
Copyright © 2020 Ryan Rix <ryan@whatthfuck.computer>
#+end_quote
Right now, it's assumed that this code will run on the server which hosts the Elixir service, but that is not a hard requirement -- it could be generated locally and then the =sqlite3= file pushed to the server with [[file:../cce/nearly_stateless_computing_using_syncthing.org][Syncthing]] or so.
Right now, it's assumed that this code will run on the server which hosts the Elixir service, but that is not a hard requirement -- it could be generated locally and then the =sqlite3= file pushed to the server with [[file:../cce/syncthing.org][Syncthing]] or so.
* Rebuilding the Arcology DB within Elixir
:PROPERTIES:

View File

@ -1,5 +1,5 @@
#+TITLE: Arcology Page Module
#+ROAM_TAGS: Arcology
#+ROAM_TAGS: Project Arcology
#+ROAM_ALIAS: Arcology.Page
#+ARCOLOGY_KEY: arcology/page
@ -340,6 +340,10 @@ def normalize_cloze(_match, first, optional_hint, position) do
end
#+end_src
** NEXT paragraph anchors within text bodies
NAME keywords may do this, but make sure.
* Footnotes
[fn:1] [[file:../open_threads.org][open thread]] on whether this idea of [[file:../cce/literate_programming.org][Literate Programming]] meta-programing is good or not. might defeat the purpose, making the tests really brittle and make me unwilling to move code around or re-structure the doc to be more accessible.

View File

@ -3094,12 +3094,6 @@
"mime-types": "^2.1.12"
}
},
"foundation-sites": {
"version": "6.6.3",
"resolved": "https://registry.npmjs.org/foundation-sites/-/foundation-sites-6.6.3.tgz",
"integrity": "sha512-8X93wUAmUg1HhVv8uWMWnwoBLSQWSmFImJencneIZDctswn724Bq/MV1cbPZN/GFWGOB/9ngoQHztfzd4+ovCg==",
"dev": true
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",

View File

@ -21,7 +21,6 @@
"babel-loader": "^8.0.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.4.2",
"foundation-sites": "^6.6.3",
"imports-loader": "^1.1.0",
"jquery": "^2.2.4",
"mini-css-extract-plugin": "^0.9.0",

View File

@ -17,14 +17,8 @@ module.exports = (env, options) => {
new OptimizeCSSAssetsPlugin({})
]
},
resolve: {
alias: {
foundation: path.resolve(__dirname, 'node_modules/foundation-sites/scss/')
}
},
entry: {
'app': './js/app.js',
'foundation': './js/foundation.js',
'aesthetics': './css/aesthetics.scss',
'sw': './js/sw.js',
's1gma': './js/s1gma.js',

View File

@ -6,7 +6,7 @@
#+ARCOLOGY_KEY: arcology/inotify
Here we weld [[file:arcology_db.org][arcology-db]]'s shell calls to =emacs= to the [[https://github.com/falood/file_system/][file_system]] module, to signal Arcology to update its database whenever I change the files and [[file:../cce/nearly_stateless_computing_using_syncthing.org][Syncthing]] gets it to my server. Until I work through documenting my goal-state and doing some amount of risk/threat modeling in [[file:publishing.org][Arcology Publishing Workflow]], this is going to generate the DB on file-updates automatically. It'll be its own OTP application implemented with [[file:../genserver_elixir_v1_11_2.org][GenServer]] that is almost entirely set apart from the rest of the system.
Here we weld [[file:arcology_db.org][arcology-db]]'s shell calls to =emacs= to the [[https://github.com/falood/file_system/][file_system]] module, to signal Arcology to update its database whenever I change the files and [[file:../cce/syncthing.org][Syncthing]] gets it to my server. Until I work through documenting my goal-state and doing some amount of risk/threat modeling in [[file:publishing.org][Arcology Publishing Workflow]], this is going to generate the DB on file-updates automatically. It'll be its own OTP application implemented with [[file:../genserver_elixir_v1_11_2.org][GenServer]] that is almost entirely set apart from the rest of the system.
I have to think about how to design this thing, optimally I would prefer it not to spawn 150 Emacs works whenever my laptop connects to Wi-Fi, after all, so I need to build in some sort of rate-limiter or cooldown period in to this. I love building "distributed systems." I'm going to want to build another rate-limiter, a =Plug= and so-called "anti-viral" rate-limiter designed to keep my pages from "going viral" when I'm not paying attention. Luckily both of these rate limiters will opt to "drop" the traffic that is over-budget and ask them to try again later.

View File

@ -1,34 +1,37 @@
%{
"artificery": {:hex, :artificery, "0.4.3", "0bc4260f988dcb9dda4b23f9fc3c6c8b99a6220a331534fdf5bf2fd0d4333b02", [:mix], [], "hexpm", "12e95333a30e20884e937abdbefa3e7f5e05609c2ba8cf37b33f000b9ffc0504"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"},
"cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"},
"cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"},
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"},
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
"db_connection": {:hex, :db_connection, "1.1.3", "89b30ca1ef0a3b469b1c779579590688561d586694a3ce8792985d4d7e575a61", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm", "5f0a16a58312a610d5eb0b07506280c65f5137868ad479045f2a2dc4ced80550"},
"decimal": {:hex, :decimal, "1.9.0", "83e8daf59631d632b171faabafb4a9f4242c514b0a06ba3df493951c08f64d07", [:mix], [], "hexpm", "b1f2343568eed6928f3e751cf2dffde95bfaa19dd95d09e8a9ea92ccfd6f7d85"},
"distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm", "bbc7008b0161a6f130d8d903b5b3232351fccc9c31a991f8fcbf2a12ace22995"},
"ecto": {:hex, :ecto, "2.2.11", "4bb8f11718b72ba97a2696f65d247a379e739a0ecabf6a13ad1face79844791c", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: true]}, {:decimal, "~> 1.2", [hex: :decimal, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.8.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.13.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm", "e7e50d6bb2254777d304bad064af31cc1d76a3bf043bbd9913990c450d428109"},
"esqlite": {:hex, :esqlite, "0.4.1", "ba5d0bab6b9c8432ffe1bf12fee8e154a50f1c3c40eadc3a9c870c23ca94d961", [:rebar3], [], "hexpm", "3584ca33172f4815ce56e96eed9835f5d8c987a9000fbc8c376c86acef8bf965"},
"file_system": {:hex, :file_system, "0.2.9", "545b9c9d502e8bfa71a5315fac2a923bd060fd9acb797fe6595f54b0f975fd32", [:mix], [], "hexpm", "3cf87a377fe1d93043adeec4889feacf594957226b4f19d5897096d6f61345d8"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"gettext": {:hex, :gettext, "0.18.1", "89e8499b051c7671fa60782faf24409b5d2306aa71feb43d79648a8bc63d0522", [:mix], [], "hexpm", "e70750c10a5f88cb8dc026fc28fa101529835026dec4a06dba3b614f2a99c7a9"},
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
"memoize": {:hex, :memoize, "1.3.0", "c82eaf40cd2afd0cc050ee0d7e6b298aa2a0d5faa8680b48147deecb4b94300d", [:mix], [], "hexpm", "e7821b08820b39f090c8a2a321c639068fd11690d0477a5a32d477696329058e"},
"mime": {:hex, :mime, "1.4.0", "5066f14944b470286146047d2f73518cf5cca82f8e4815cf35d196b58cf07c47", [:mix], [], "hexpm", "75fa42c4228ea9a23f70f123c74ba7cece6a03b1fd474fe13f6a7a85c6ea4ff6"},
"mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"},
"mix_test_watch": {:hex, :mix_test_watch, "1.0.2", "34900184cbbbc6b6ed616ed3a8ea9b791f9fd2088419352a6d3200525637f785", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "47ac558d8b06f684773972c6d04fcc15590abdb97aeb7666da19fcbfdc441a07"},
"panpipe": {:hex, :panpipe, "0.1.1", "4fa886dc6c148879d0a33267c2925ccea16bac9ccd51150edb1f940a4a452366", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:protocol_ex, "~> 0.4", [hex: :protocol_ex, repo: "hexpm", optional: false]}, {:rambo, "~> 0.2", [hex: :rambo, repo: "hexpm", optional: false]}], "hexpm", "c1d374fe685cc3df9cb98f0d01b434309c783e82e63be7643c2b3c2c907df01a"},
"phoenix": {:hex, :phoenix, "1.4.17", "1b1bd4cff7cfc87c94deaa7d60dd8c22e04368ab95499483c50640ef3bd838d8", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a8e5d7a3d76d452bb5fb86e8b7bd115f737e4f8efe202a463d4aeb4a5809611"},
"phoenix": {:hex, :phoenix, "1.5.9", "a6368d36cfd59d917b37c44386e01315bc89f7609a10a45a22f47c007edf2597", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7e4bce20a67c012f1fbb0af90e5da49fa7bf0d34e3a067795703b74aef75427d"},
"phoenix_html": {:hex, :phoenix_html, "2.14.2", "b8a3899a72050f3f48a36430da507dd99caf0ac2d06c77529b1646964f3d563e", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "58061c8dfd25da5df1ea0ca47c972f161beb6c875cd293917045b92ffe1bf617"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.4", "940c0344b1d66a2e46eef02af3a70e0c5bb45a4db0bf47917add271b76cd3914", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "38f9308357dea4cc77f247e216da99fcb0224e05ada1469167520bed4cb8cccd"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm", "1f13f9f0f3e769a667a6b6828d29dec37497a082d195cc52dbef401a9b69bf38"},
"plug": {:hex, :plug, "1.10.4", "41eba7d1a2d671faaf531fa867645bd5a3dce0957d8e2a3f398ccff7d2ef017f", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ad1e233fe73d2eec56616568d260777b67f53148a999dc2d048f4eb9778fe4a0"},
"plug_cowboy": {:hex, :plug_cowboy, "2.3.0", "149a50e05cb73c12aad6506a371cd75750c0b19a32f81866e1a323dda9e0e99d", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bc595a1870cef13f9c1e03df56d96804db7f702175e4ccacdb8fc75c02a7b97e"},
"plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"},
"phoenix_pubsub_redis": {:hex, :phoenix_pubsub_redis, "3.0.1", "d4d856b1e57a21358e448543e1d091e07e83403dde4383b8be04ed9d2c201cbc", [:mix], [{:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1 or ~> 1.6", [hex: :poolboy, repo: "hexpm", optional: false]}, {:redix, "~> 0.10.0 or ~> 1.0", [hex: :redix, repo: "hexpm", optional: false]}], "hexpm", "0b36a17ff6e9a56159f8df8933d62b5c1f0695eae995a02e0c86c035ace6a309"},
"plug": {:hex, :plug, "1.11.1", "f2992bac66fdae679453c9e86134a4201f6f43a687d8ff1cd1b2862d53c80259", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "23524e4fefbb587c11f0833b3910bfb414bf2e2534d61928e920f54e3a1b881f"},
"plug_cowboy": {:hex, :plug_cowboy, "2.5.0", "51c998f788c4e68fc9f947a5eba8c215fbb1d63a520f7604134cab0270ea6513", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5b2c8925a5e2587446f33810a58c01e66b3c345652eeec809b76ba007acde71a"},
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
"poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"},
"protocol_ex": {:hex, :protocol_ex, "0.4.3", "4acbe35da85109dc40315c1139bb7a65ebc7fc102d384cd8b3038384fbb9b282", [:mix], [], "hexpm", "6ca5ddb3505c9c86f17cd3f19838b34bf89966ae17078f79f81983b6a4391fe9"},
"rambo": {:hex, :rambo, "0.3.2", "97cd76474c309c7cd0e78e889fadf4724b09fa2148a85801bcc82c5e87b54fa0", [:mix], [], "hexpm", "3226df4e19a69b88ff8ba091dcd818a2a52db6fb3fa83c4b446f8e57d36b7093"},
"ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"redix": {:hex, :redix, "1.1.3", "2b4c4451f1075b2beb18bdffe44a60298ece120795380513d972f096f18c6ec4", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ae88eed4ebb3c98c2f9760955b20a601365220ab5621716c103556985e3cc01b"},
"sbroker": {:hex, :sbroker, "1.0.0", "28ff1b5e58887c5098539f236307b36fe1d3edaa2acff9d6a3d17c2dcafebbd0", [:rebar3], [], "hexpm", "ba952bfa35b374e1e5d84bc5f5efe8360c6f99dc93b3118f714a9a2dff6c9e19"},
"sqlite_ecto2": {:hex, :sqlite_ecto2, "2.4.1", "a292b807c7670f1c2c136f7224934bf5929c998ea1b9ded63b710f3dd5140e4c", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "2.2.11", [hex: :ecto, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.13", [hex: :postgrex, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: false]}, {:sqlitex, "~> 1.6", [hex: :sqlitex, repo: "hexpm", optional: false]}], "hexpm", "19358813676eb058d1b0630cd6914817e7dbf001022c49159510241f14f0eea7"},
"sqlitex": {:hex, :sqlitex, "1.7.1", "022d477aab2ae999c43ae6fbd1782ff1457e0e95c251c7b5fa6f7b7b102040ff", [:mix], [{:decimal, "~> 1.7", [hex: :decimal, repo: "hexpm", optional: false]}, {:esqlite, "~> 0.4", [hex: :esqlite, repo: "hexpm", optional: false]}], "hexpm", "ef16cda37b151136a47a6c0830dc9eb5e5f8f5f029b649e9f3a58a6eed634b80"},
"symbolic_expression": {:git, "https://github.com/rob-brown/SymbolicExpression", "3091618801258b4712068814f0916069ebb76f51", [tag: "1.0.3"]},
"telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"},
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
}

View File

@ -3,6 +3,7 @@
#+CREATED: [2020-09-22]
#+MODIFIED: [2020-10-11]
#+ARCOLOGY_KEY: arcology/page_controller
#+ROAM_TAGS: Project
The [[file:README.org][Arcology]] is a Phoenix Elixir application, this page presents a Phoenix controller =ArcologyWeb.PageController= responsible for loading [[file:arcology_page.org][Arcology.Page]] structures and presenting the compiled HTML to the page via =ArcologyWeb.PageView=. The first implementation of this became a *mess* of mixed concerns, and I'm hoping I can do a bit better this time around.
@ -52,7 +53,7 @@ end
** Org Page Template
This template using the Foundation HTML framework for its semantic markup. It expects an [[file:arcology_page.org][Arcology.Page]] with =html_status: :localized= assigned to =@page=, a string assigned to =@page_title= and [[file:aesthetics.org][the app.html.eex template]] needs a string assigned to =@site_title=.
This template expects an [[file:arcology_page.org][Arcology.Page]] with =html_status: :localized= assigned to =@page=, a string assigned to =@page_title= and [[file:aesthetics.org][the app.html.eex template]] needs a string assigned to =@site_title=. In exchange, it rends that page as HTML with backlinks and the whole rest.
#+begin_src html :tangle lib/arcology_web/templates/page/page.html.eex
<div class="grid-container">

View File

@ -3,14 +3,18 @@
#+ARCOLOGY_KEY: arcology/project
#+CREATED: [2020-09-22]
#+MODIFIED: [2020-11-12]
#+AUTO_TANGLE: t
This file describes the general Elixir and Phoenix plumbing required to get any Elixir application stood up. In general, when I work in a code module it should get moved in to its own file, but I don't know how to address that for these "infrastructure" elements. For now they'll live here. I also need to design some build systems and build scripts, and set up my =.gitignore=
* Project =.gitignore= file
:PROPERTIES:
:ID: arcology/gitignore
:END:
This project is intended to be developed as a [[file:~/org/cce/literate_programming.org][Literate Programming]] [[file:~/org/org-mode.org][org-mode]] application, developed within my [[file:~/org/cce/org-roam.org][org-roam]] environment, published as part of my [[file:README.org][Arcology]] system. The project is its own subdirectory under my =org-roam-directory= and it can be on yours as well, or provided standalone.
The repo will contain docs and assets and a build script that will call up an [[file:../Emacs.org][Emacs]] that will "tangle" the files out and build the application. It will *not* contain the compiled code checked in, the docs must be considered the source of truth. We'll have facilities to "de-tangle" the source code eventually to aide contribution from folks who aren't running Emacs. For now, though, I'm gonna be a bastard 😄
The repo will contain docs and assets and a build script that will call up an [[file:../cce/emacs.org][Emacs]] that will "tangle" the files out and build the application. It will *not* contain the compiled code checked in, the docs must be considered the source of truth. We'll have facilities to "de-tangle" the source code eventually to aide contribution from folks who aren't running Emacs. For now, though, I'm gonna be a bastard 😄
This starts with a .gitignore. When updating this, the order of operation is to delete the file from the index, update this, tangle it, and then commit. it's a bit of a mess, maybe detangling is better. I gotta improve upon this quite a bit still, I would love to automatically generate the gitignore some time.
@ -95,6 +99,9 @@ Files which are provided from tangles will need to be managed here:
/rel/vm.args.eex
/bin/build
/Dockerfile
# nixos crap
shell.nix
#+end_src
This file should be checked in when it's changed, along with =mix.lock=
@ -171,10 +178,11 @@ defp deps do
{:sqlite_ecto2, "~> 2.2"},
{:symbolic_expression, git: "https://github.com/rob-brown/SymbolicExpression", tag: "1.0.3"},
{:panpipe, "~> 0.1"},
{:phoenix, "~> 1.4.10"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix, "~> 1.5"},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_pubsub_redis, "~> 3.0"},
{:phoenix_html, "~> 2.14"},
{:phoenix_live_reload, "~> 1.3", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
@ -246,14 +254,14 @@ config :arcology, Arcology.Repo,
config :arcology, ecto_repos: [Arcology.Repo]
#+end_src
The Phoenix endpoint configuration is pretty straightforward, we use Phoenix's PostgreSQL PubSub adapter these days to have a durable message passing channel between frontend and backend. And this damned secret key will have to be provided for production builds somehow, that'll be fun.
The Phoenix endpoint configuration is pretty straightforward, we use Phoenix's PostgreSQL PubSub adapter these days to have a durable message passing channel between frontend and backend. And this damned secret key will have to be provided for production builds somehow, that'll be fun. The only thing that is weird here is that Arcology.PubSub is disabled right now because I'm not using it directly, and don't want to take on a Redis or PG2 dependency just to have one lying about, even if my production systems de-facto have them there's no reason my endpoints and development environments need them running.
#+begin_src elixir :tangle config/config.exs
config :arcology, ArcologyWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "qjGyFdguDBSm8O7R4TI5M084mtgZ2vPE5p7a/2kTMuDCaPRUz9JiFdLK1RNUBggy",
render_errors: [view: ArcologyWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: Arcology.PubSub, adapter: Phoenix.PubSub.PG2]
pubsub_server: Arcology.PubSub
#+end_src
Logger configuration is simple, I haven't changed this, though I probably would like to have JSON logs some day.