on master help sign in
Merge pull request #758 from obsidiansystems/eac@high-level-docs

README/FAQ improvements

commit4af7903df2100ea467f355aa01c35c3fbecead0a authorRyan Trinkle <ryan@trinkle.org> dateWed 10 Jun 2020, 12:05 (6 years ago) parent37c2f0c4df5a9a
7 files changed+179−233
CONTRIBUTING.md+52 ChangeLog.md+2−2 FAQ.md+62−67 README.md+61−162 docs/obelisk-logo-640.png guides/app-deploy/README.md+1−1 lib/command/src/Obelisk/Command/Run.hs+1−1
CONTRIBUTING.md+52
@@ -8,6 +8,7 @@ Contributions and issue reports are encouraged and appreciated!
88 - [Guidelines for Pull Requests](#guidelines-for-pull-requests)
99 - [Code Quality](#code-quality)
1010 - [Documentation](#documentation)
11+- [Development Environment](#development-environment)
1112
1213## Opening Issues
1314
@@ -39,6 +40,7 @@ For breaking changes, new features, refactors, or other major changes, the body
3940
4041Wherever possible, pull requests should add a single feature or fix a single bug. Pull requests should not bundle several unrelated changes.
4142
43+
4244### Code Quality
4345
4446#### Warnings
@@ -77,3 +79,53 @@ Add an entry to the changelog when your PR:
7779#### In the [Readme](README.md)
7880The readme is the first place a lot of people look for information about the repository. Update any parts of the readme that are affected by your PR.
7981
82+
83+## Development Environment
84+
85+There are two ways to get live compiler feedback while developing Obelisk libraries. For libraries that are dependencies of the `skeleton` application, the easiest way to get feedback is to
86+
87+```bash
88+cd skeleton
89+ob run
90+```
91+
92+This `ob run` session only loads modules that are dependencies of the skeleton and `obelisk-run`. For example, `obelisk-asset` and `obelisk-route` are used by the skeleton.
93+
94+For other libraries like `obelisk-command` you can use `ghcid`. To launch `ghcid` for `lib/command` you can run
95+
96+```bash
97+nix-shell -A obeliskEnvs.obelisk-command --run "cd lib/command && ghcid"
98+```
99+
100+### Building `ob` for testing
101+
102+To re-install `ob` from source globally you can do
103+
104+```bash
105+nix-env -f /path/to/obelisk -iA command
106+```
107+
108+You can also open a shell with the local version of `ob` available on your `$PATH`:
109+
110+```bash
111+nix run -f /path/to/obelisk command
112+```
113+
114+### Hacking on Obelisk from within an Obelisk project
115+
116+`ob` will defer to the version found in your project's `.obelisk/impl` directory. To work on that version specifically:
117+
118+```bash
119+ob thunk unpack ./.obelisk/impl
120+cd ./.obelisk/impl
121+# apply your changes
122+```
123+
124+If you want to commit your changes, first push them to your fork of obelisk and then
125+
126+```bash
127+cd /your/project/root
128+ob thunk pack .obelisk/impl
129+git add .obelisk/impl
130+git commit -m "Bump obelisk"
131+```
ChangeLog.md+2−2
@@ -23,7 +23,7 @@ This project's release branch is `master`. This log is written from the perspect
2323* ([#695](https://github.com/obsidiansystems/obelisk/pull/695)) `ob deploy init` now requires that your obelisk project be a clean `git` checkout with pushed changes. It has always required that your obelisk project be a `git` repository, but it did not require that your local changes be committed and pushed. This new requirement is added to ensure users don't accidentally create a deployment pointing to an old version of the project.
2424* ([#705](https://github.com/obsidiansystems/obelisk/pull/705)) Add `Obelisk.Route.packTextEncoder` and generalize `Obelisk.Route.unpackTextEncoder` over any `Data.Text.Lens.IsText`.
2525* ([#712](https://github.com/obsidiansystems/obelisk/pull/712)) Update [`reflex-platform`](https://github.com/reflex-frp/reflex-platform) to version 0.5.3.0.
26−* ([#700](https://github.com/obsidiansystems/obelisk/pull/700)) Ensure `ob init` uses the thunk format of the target obelisk rather than the one currently running the init command. If a user had installed a version of obelisk with a new thunk format, a newly initialized skeleton of an older version would not be able to unpack it's own `.obelisk/impl`.
26+* ([#700](https://github.com/obsidiansystems/obelisk/pull/700)) Ensure `ob init` uses the thunk format of the target obelisk rather than the one currently running the init command. If a user had installed a version of obelisk with a new thunk format, a newly initialized skeleton of an older version would not be able to unpack its own `.obelisk/impl`.
2727* ([#693](https://github.com/obsidiansystems/obelisk/pull/693)) Fix a bug where some packages in `.attr-cache` directories would be incorrectly picked up and used instead of the correct ones when using `ob run`/`ob watch`/`ob repl`.
2828* ([#709](https://github.com/obsidiansystems/obelisk/pull/709)) Fix a bug in obelisk's preprocessor causing it to incorrectly skip files in some circumstances.
2929* ([#663](https://github.com/obsidiansystems/obelisk/pull/663)) Add **experimental** support for [`ghcide`](https://github.com/digital-asset/ghcide). See the README for more information.
@@ -74,7 +74,7 @@ This project's release branch is `master`. This log is written from the perspect
7474* Improve error messaging when a dependency doesn't have the expected `.cabal` or `package.yaml` file. ([#597](https://github.com/obsidiansystems/obelisk/pull/597))
7575* Improve the skeleton in small ways. ([#593](https://github.com/obsidiansystems/obelisk/pull/593), [#589](https://github.com/obsidiansystems/obelisk/pull/589))
7676* Fix `ob` commands to again support running from any subdirectory of an obelisk project ([#591](https://github.com/obsidiansystems/obelisk/pull/591))
77−* Add `reflex-platform-func` argument to Obelisk's `default.nix`. It defaults to it's prior behavior of using the reflex-platform in in `dep`. ([#612](https://github.com/obsidiansystems/obelisk/pull/612))
77+* Add `reflex-platform-func` argument to Obelisk's `default.nix`. It defaults to its prior behavior of using the reflex-platform in in `dep`. ([#612](https://github.com/obsidiansystems/obelisk/pull/612))
7878
7979## v0.3.0.0 - 2019-12-20
8080
FAQ.md+62−67
@@ -1,14 +1,70 @@
11# Frequently Asked Questions
22
3−1. [How do I fix invalid entitlements? ](#how-do-i-fix-invalid-entitlements)
3+1. [How do I declare a new Haskell dependency?](#how-do-i-declare-a-new-haskell-dependency)
4+1. [How do I add or override Haskell dependencies in the package set?](#how-do-i-add-or-override-haskell-dependencies-in-the-package-set)
5+1. [How do I extend my Obelisk application with more local packages?](#how-do-i-extend-my-obelisk-application-with-more-local-packages)
6+1. [How do I use `ob run` over HTTPS?](#how-do-i-use-ob-run-over-https)
7+1. [How do I fix invalid entitlements?](#how-do-i-fix-invalid-entitlements)
481. [`ob thunk update` or `ob deploy update` fails](#ob-thunk-update-or-ob-deploy-update-fails)
591. [How do I fix `Ambiguous module name` errors?](#how-do-i-fix-ambiguous-module-name-errors)
6−1. [What does `ob run` actually do?](#what-does-ob-run-actually-do)
10+
11+### How do I declare a new Haskell dependency?
12+
13+Every component of your Obelisk application is a standard [cabal](https://www.haskell.org/cabal/) package. That means declaring new Haskell dependencies simply involves updating the `build-depends` field in the appropriate cabal file (`backend.cabal` for example). By default, Obelisk will use its curated package set to choose which version of each package you get. It's possible that the package you need is not already in the curated set or the curated version isn't the one you want. See [How do I add or override Haskell dependencies in the package set?](#how-do-i-add-or-override-haskell-dependencies-in-the-package-set) for a solution to this.
14+
15+### How do I add or override Haskell dependencies in the package set?
16+
17+To add a Haskell package that doesn't exist in Obelisk's package set or to override the version of a package, use the `overrides` attribute in your project's `default.nix`. For example, to use a specific version of the `aeson` package fetched from GitHub and a specific version of the `waargonaut` package fetched from Hackage, your `default.nix` will look like:
18+
19+```nix
20+# ...
21+project ./. ({ pkgs, ... }: {
22+# ...
23+ overrides = self: super: let
24+ aesonSrc = pkgs.fetchFromGitHub {
25+ owner = "obsidiansystems";
26+ repo = "aeson-gadt-th";
27+ rev = "ed573c2cccf54d72aa6279026752a3fecf9c1383";
28+ sha256 = "08q6rnz7w9pn76jkrafig6f50yd0f77z48rk2z5iyyl2jbhcbhx3";
29+ };
30+ in
31+ {
32+ aeson = self.callCabal2nix "aeson" aesonSrc {};
33+ waargonaut = self.callHackageDirect {
34+ pkg = "waargonaut";
35+ ver = "0.8.0.1";
36+ sha256 = "1zv28np3k3hg378vqm89v802xr0g8cwk7gy3mr77xrzy5jbgpa39";
37+ } {};
38+ };
39+# ...
40+```
41+
42+For further information see [the Haskell section](https://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure) of nixpkgs "Contributors Guide".
43+
44+### How do I extend my Obelisk application with more local packages?
45+
46+If the standard packages (`frontend`, `backend`, and `common`) are not enough, you may add more local packages by defining them with the `packages` attribute in your `default.nix`. The sources of these packages will be automatically loaded by `ob run`/`ob repl`/etc.
47+
48+```nix
49+# ...
50+project ./. ({ pkgs, ... }: {
51+# ...
52+ packages = {
53+ another = ./dep/another;
54+ };
55+# ...
56+```
57+
58+### How do I use `ob run` over HTTPS?
59+
60+To run your app locally over HTTPS, update the protocol in `config/common/route` to `https`, and then use `ob run` as normal.
61+
62+Obelisk generates a self-signed certificate for running HTTPS so the browser will issue a warning about using an invalid certificate. On Chrome, you can go to `chrome://flags/#allow-insecure-localhost` to enable invalid certificates for localhost.
63+
764
865### How do I fix invalid entitlements?
966
10−You probably did not set `ios.bundleIdentifier` correctly in `default.nix`.
11−When this happens you'll see an error something like this:
67+You probably did not set `ios.bundleIdentifier` correctly in `default.nix`. When this happens you'll see an error something like this:
1268
1369```
14702018-11-25 09:34:22.438 ios-deploy[58106:8521046] [ !! ] Error 0xe8008016: The executable was signed with invalid entitlements. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
@@ -19,7 +75,7 @@ Fixing the value of `ios.bundleIdentifier` should fix the error.
1975### `ob thunk update` or `ob deploy update` fails
2076Whenever an `ob` command fails, try re-running it with `-v`.
2177
22−If you're using a private repo, and you get a failure in nix-prefetch-url, you may need to unpack and repack the thunk. Here's some example output that shows this issue:
78+If you're using a private repo, and you get a failure in `nix-prefetch-url`, you may need to unpack and repack the thunk. Here's some example output that shows this issue:
2379
2480```
2581Starting Obelisk </nix/store/j8wls8a89xr6s1a47lg6g83gnbdrfd0l-obelisk-command-0.1/bin/.ob-wrapped> args=["deploy","update","-v"] logging-level=Debug
@@ -39,7 +95,7 @@ nix-prefetch-url: Failed to determine sha256 hash of URL https://github.com/obsi
3995
4096And here's how you can fix it:
4197
42−```
98+```bash
4399ob thunk unpack $SOME_THUNK
44100ob thunk pack $SOME_THUNK
45101```
@@ -59,64 +115,3 @@ error:
59115```
60116then specify the package you want in the import, e.g:
61117`import "cryptonite" Crypto.Hash`
62−
63−
64−### What does `ob run` actually do?
65−
66−
67−#### Short version:
68−
69−`ob run` starts a [`ghcid`](https://github.com/ndmitchell/ghcid) process which
70−tries to build your project within a carefully crafted `nix-shell` with all the
71−project's dependencies and,
72−
73−* either displays compilation errors/warnings,
74−* or starts the Obelisk server, which serves:
75− * your backend's route handlers,
76− * the static assets,
77− * the [JSaddle](https://github.com/ghcjs/jsaddle) frontend code (while opening its websocket).
78−
79−#### Longer version:
80−
81−Assuming we are in a project created with `ob init`, `ob run` calls (see
82−`lib/command/src/Obelisk/Command.hs`):
83−
84− nix-shell --pure -A shells.ghc --run 'ob --no-handoff internal run-static-io <real-run-function>'
85−
86−where
87−
88−* `shells.ghc` is defined in `./default.nix` by importing `./.obelisk/impl/default.nix` which
89− is `default.nix` in the present (Obelisk) repository,
90−* `run-static-io` is a logging-enabled command wrapper
91− (cf. `runObelisk` in `lib/command/src/Obelisk/App.hs`).
92−
93−In this case, it runs the function `Obelisk.Command.Command.run` (defined in
94−`lib/command/src/Obelisk/Command/Run.hs`).
95−
96−* It creates a GHCi config from a Nix expression which:
97− * loads three packages: `backend`, `common`, `frontend`,
98− * obtains a free port number.
99−* Then runs `ghcid`
100− * with a command that reruns `Obelisk.Run.run` at each restart (option
101− `--test`).
102−
103−It is defined in `lib/run/src/Obelisk/Run.hs`:
104−
105−* It creates a thread which starts the main backend.
106− This runs `runSnapWithCommandLineArgs` and passes routes:
107− * to the backend (result of the `_backend_run` field of your
108− implementation of the `Backend fullRoute frontendRoute` record),
109− * or to `serveDefaultObeliskApp` (`lib/backend/src/Obelisk/Backend.hs`) to
110− serve static assets.
111−* Starts `runWidget`
112− which itself runs
113− [runSettingsSocket](https://hackage.haskell.org/package/warp-3.2.26/docs/Network-Wai-Handler-Warp.html#v:runSettingsSocket)
114− (the *“TCP listen loop”*):
115− * it binds to TCP socket, and
116− * creates the HTTP connection manager
117− ( [`newManager`](https://hackage.haskell.org/package/http-client-0.6.3/docs/Network-HTTP-Client.html#v:newManager))
118− * calls `obeliskApp` which
119− * has a route to serve the [JSaddle](https://github.com/ghcjs/jsaddle) frontend,
120− * runs the frontend (*on* the server), to produce pre-rendered pages,
121− * starts the JSaddle web-socket,
122− * “falls back” to proxying the backend (`fallbackProxy`).
README.md+61−162
@@ -3,17 +3,16 @@
33[![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)](http://www.haskell.org)
44[![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
55
6+<p align="center"><img src="docs/obelisk-logo-640.png" width="50%" alt="Obelisk Logo"></p>
67
7−Obelisk provides an easy way to develop and deploy your [Reflex](https://github.com/reflex-frp/reflex) project as web apps and as mobile apps.
8+Obelisk is an opinionated, batteries-included framework for building production-ready web and mobile applications in [Haskell](https://www.haskell.org/). Its goal is to represent a cohesive, highly-curated set of choices that [Obsidian Systems](https://obsidian.systems/) has made for building these types of applications in a way that is extremely fast but does not compromise on production readiness.
89
10+- [Overview](#installing-obelisk)
11+ - [Why would I use it?](#why-would-i-use-it)
12+ - [Who should consider using it?](#who-should-consider-using-it)
913- [Installing Obelisk](#installing-obelisk)
1014- [Developing an Obelisk project](#developing-an-obelisk-project)
11− - [Adding Packages](#adding-packages)
12− - [Adding Package Overrides](#adding-package-overrides)
13− - [Running over HTTPS](#running-over-https)
1415 - [IDE Support](#ide-support)
15− - [Terminal-based feedback](#terminal-based-feedback)
16− - [Experimental `ghcide` support](#experimental-ghcide-support)
1716- [Deploying](#deploying)
1817 - [Locally](#locally)
1918 - [Default EC2 Deployment](#default-ec2-deployment)
@@ -24,74 +23,52 @@ Obelisk provides an easy way to develop and deploy your [Reflex](https://github.
2423- [Mobile](#mobile)
2524 - [iOS](#ios)
2625 - [Android](#android)
26+- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
27+- [Contributing](#contributing)
28+
29+## Overview
30+
31+Obelisk allows you to build high-quality web and mobile applications very quickly using [Reflex](https://reflex-frp.org/). In minutes you can go from an empty directory to an interactive application that works on web, iOS, and Android, all sharing the same Haskell codebase! Obelisk's development environment also enables extremely rapid development and feedback. You can take advantage of Haskell's type system across the frontend and backend boundary. This means changes to your backend that would break your frontend are immediately detected during development and vice versa. Obelisk uses Haskell's compiler to give you a complete "TODO list" of what needs to be updated.
32+
33+Obelisk is targeted primarily at Haskell developers who want to build high-quality web and/or mobile applications in Haskell, without the distractions of manually choosing and integrating technology for every piece of the system.
34+
35+### Who should consider using it?
36+
37+Obelisk assumes basic knowledge of [Haskell](https://www.haskell.org/) and [Reflex/Reflex-DOM](https://reflex-frp.org/), web technologies like [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) and [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS), and a terminal shell like [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)). Knowledge of [Nix](https://nixos.org/) helps but is not strictly necessary.
38+
2739
2840## Installing Obelisk
41+
29421. [Install Nix](https://nixos.org/nix/).
3043 If you already have Nix installed, make sure you have version 2.0 or higher. To check your current version, run `nix-env --version`.
31441. Set up nix caches
3245 1. If you are running NixOS, add this to `/etc/nixos/configuration.nix`:
33− ```
46+ ```nix
3447 nix.binaryCaches = [ "https://nixcache.reflex-frp.org" ];
3548 nix.binaryCachePublicKeys = [ "ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=" ];
3649 ```
3750 and rebuild your NixOS configuration (e.g. `sudo nixos-rebuild switch`).
38− 1. If you are using another operating system or linux distribution, ensure that these lines are present in your Nix configuration file (`/etc/nix/nix.conf` on most systems; [see full list](https://nixos.org/nix/manual/#sec-conf-file)):
39− ```
40− binary-caches = https://cache.nixos.org https://nixcache.reflex-frp.org
41− binary-cache-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=
42− binary-caches-parallel-connections = 40
51+ 1. If you are using another operating system or Linux distribution, ensure that these lines are present in your Nix configuration file (`/etc/nix/nix.conf` on most systems; [see full list](https://nixos.org/nix/manual/#sec-conf-file)):
52+ ```nix
53+ binary-caches = https://cache.nixos.org https://nixcache.reflex-frp.org
54+ binary-cache-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=
55+ binary-caches-parallel-connections = 40
4356 ```
44− * other Linux: enable sandboxing (see these [issue172](https://github.com/obsidiansystems/obelisk/issues/172#issuecomment-411507818) or [issue6](https://github.com/obsidiansystems/obelisk/issues/6) if you run into build problems)
45− ```
57+ * If you're on a Linux distribution other than NixOS, enable sandboxing (see these [issue 172](https://github.com/obsidiansystems/obelisk/issues/172#issuecomment-411507818) or [issue 6](https://github.com/obsidiansystems/obelisk/issues/6) if you run into build problems) by adding the following:
58+ ```nix
4659 sandbox = true
4760 ```
48− * MacOS: disable sandboxing (there are still some impure dependencies for now)
49− ```
61+ * If you're on MacOS, disable sandboxing (there are still some impure dependencies for now) by adding the following:
62+ ```nix
5063 sandbox = false
5164 ```
5265 then restart the nix daemon
53− ```
66+ ```bash
5467 sudo launchctl stop org.nixos.nix-daemon
5568 sudo launchctl start org.nixos.nix-daemon
5669 ```
57701. Install obelisk: `nix-env -f https://github.com/obsidiansystems/obelisk/archive/master.tar.gz -iA command`
5871
59−### Contributing to Obelisk
60−
61−When developing on obelisk itself you may launch `ghcid` for the corresponding project as follows. For example to launch ghcid for `lib/backend` project:
62−
63−```bash
64−nix-shell -A obeliskEnvs.obelisk-backend --run "cd lib/backend && ghcid -c 'cabal new-repl'"
65−```
66−
67−Or to launch ghcid for `lib/command` project:
68−
69−```bash
70−nix-shell -A obeliskEnvs.obelisk-command --run "cd lib/command && ghcid -c 'cabal new-repl'"
71−```
72−
73−To re-install `ob` from source do
74−```bash
75−nix-env -f /path/to/obelisk -iA command
76−```
77−
78−Note that `ob` will defer to the version found in your project's `.obelisk/impl` directory. To update that version specifically:
79−
80−```bash
81−ob thunk unpack ./.obelisk/impl
82−cd ./.obelisk/impl
83−# apply your changes
84−```
85−
86−If you want to commit your changes, first push them to your fork of obelisk and then
87−
88−```bash
89−cd /your/project/root
90−ob thunk pack .obelisk/impl
91−git add .obelisk/impl
92−git commit -m "Bump obelisk"
93−```
94−
9572### Accessing private repositories
9673
9774To allow the Nix builder to access private git repositories, you must be set up
@@ -120,119 +97,12 @@ Firefox will not be able to properly run the development website due to [issue 4
12097
12198Every time you change the Haskell source files in frontend, common or backend, `ob run` will automatically recompile the modified files and reload the server. Furthermore, it will display on screen compilation errors and warnings if any.
12299
123−### Adding packages
124−
125−In order to add package dependencies, declare them under the build-depends field in the appropriate cabal files (backend, common, and frontend each have their own). The corresponding Nix packages will automatically be selected when building.
126−
127−### Adding package overrides
128−
129−To add a version override to any Haskell package, or to add a Haskell package that doesn't exist in the nixpkgs used by Obelisk, use the `overrides` attribute in your project's `default.nix`. For example, to use a specific version of the `aeson` package fetched from GitHub and a specific version of the `waargonaut` package fetched from Hackage, your `default.nix` will look like:
130−
131−```nix
132−# ...
133−project ./. ({ pkgs, ... }: {
134−# ...
135− overrides = self: super: let
136− aesonSrc = pkgs.fetchFromGitHub {
137− owner = "obsidiansystems";
138− repo = "aeson-gadt-th";
139− rev = "ed573c2cccf54d72aa6279026752a3fecf9c1383";
140− sha256 = "08q6rnz7w9pn76jkrafig6f50yd0f77z48rk2z5iyyl2jbhcbhx3";
141− };
142− in
143− {
144− aeson = self.callCabal2nix "aeson" aesonSrc {};
145− waargonaut = self.callHackageDirect {
146− pkg = "waargonaut";
147− ver = "0.8.0.1";
148− sha256 = "1zv28np3k3hg378vqm89v802xr0g8cwk7gy3mr77xrzy5jbgpa39";
149− } {};
150− };
151−# ...
152−```
153−
154−For further information see [the Haskell section](https://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure) of nixpkgs Contributors Guide.
155−
156−### Adding extra local packages
157−
158−If the standard packages (`frontend`, `backend`, and `common`) are not
159−enough, to add more local Haskell packages, define them with the
160−`packages` parameter. The sources of these packages will be
161−automatically reloaded by `ob run`.
162−
163−```nix
164−# ...
165−project ./. ({ pkgs, ... }: {
166−# ...
167− packages = {
168− another = ./another;
169− };
170−# ...
171−```
172−
173−### Running over HTTPS
174−
175−To run your app locally over HTTPS, update the protocol in `config/common/route` to `https`, and then use `ob run` as normal.
176−
177−Since Obelisk generates a self-signed certificate for running HTTPS, the browser will issue a warning about using an invalid certificate. On Chrome, you can go to `chrome://flags/#allow-insecure-localhost` to enable invalid certificates for localhost.
178−
179100### IDE Support
180101
181−#### Terminal-based feedback
182−
183102Obelisk officially supports terminal-based feedback (akin to [`ghcid`](https://github.com/ndmitchell/ghcid)) in `ob run` and `ob watch`.
184103
185−#### **Experimental** `ghcide` support
186−
187−> **NOTE:** `ghcide` support is strictly **experimental** and **not officially supported**. There is no guarantee that it will work for you or that this support will be maintained over time.
188−
189−To try out the **experimental** [`ghcide`](https://github.com/digital-asset/ghcide) support:
190−
191− * Install a `ghcide` plugin for your editor.
192− * Add `__withGhcide = true;` to your Obelisk project's `default.nix` (inside the call to `project`). With this setting, `ob shell` will provide `ghcide` as well.
193− * Add `hie-bios.sh` to the root of your project:
194− ```shell
195− cat > hie-bios.sh <<'EOF'
196− #!/usr/bin/env bash
197− source "$HOME/.bash_profile"; # NOTE: Some editors need help finding 'ob' and this assumes that `ob` is made available on your `$PATH` in `.bash_profile`
198− ob internal export-ghci-configuration > "$HIE_BIOS_OUTPUT"
199− EOF
200− chmod +x hie-bios.sh
201− ```
202− * **Note:** In some projects you need to use `ob internal export-ghci-configuration --use-relative-paths` in this script instead. This is known to happen when your project contains symlinks to other packages.
203− * Add `hie.yaml` to the root of your project:
204− ```shell
205− echo 'cradle: { bios: { program: hie-bios.sh } }' > hie.yaml
206− ```
207− * Test the configuration with `ob shell ghcide`. Assuming your project compiles and works with `ghcide` otherwise, this should succeed.
208− * Start your editor in a way that it can access the appropriate `ghcide`:
209− * This can sometimes be achieved with `ob shell 'start my editor'`.
210− * If you can't easily start your editor in a way that it inherits your shell, you may need to customize how your `ghcide` plugin finds `ghcide` or create a custom `ghcide` replacement script that you install globally. For example, for Visual Studio Code on macOS adding a script called `ghcide` to your `PATH` like the one below will cause `ghcide` from each project's `ob shell` to be used:
211− ```shell
212− #!/usr/bin/env bash
213− source "$HOME/.bash_profile" # NOTE: This assumes that `ob` is made available on your `$PATH` in `.bash_profile`
214− ob shell "ghcide $@"
215− ```
216−
217104## Deploying
218105
219−### Locally
220−
221−Build everything:
222−
223−```bash
224−nix-build -A exe --no-out-link
225−```
226−
227−Copy the result to a new directory, add configuration, and run!
228−
229−```bash
230−mkdir test-app
231−ln -s $(nix-build -A exe --no-out-link)/* test-app/
232−cp -r config test-app
233−(cd test-app && ./backend)
234−```
235−
236106### Default EC2 Deployment
237107
238108In this section we will demonstrate how to deploy your Obelisk app to an Amazon EC2 instance. Obelisk deployments are configured for EC2 by default (see [Custom Non-EC2 Deployment](#custom-non-ec2-deployment)).
@@ -249,7 +119,7 @@ At this stage your instance should be booting and become accessible shortly. Not
249119Now go to your Obelisk project directory (`~/code/myapp`), and initialize a deployment config (`~/code/myapp-deploy`):
250120Your project directory must be "thunkable", i.e. something on which `ob thunk pack` can be called. Usually it will be a git repository whose current revision has been pushed upstream.
251121
252−```
122+```bash
253123cd ~/code/myapp
254124SERVER=ec2-35-183-22-197.ca-central-1.compute.amazonaws.com
255125ROUTE=https://myapp.com # Publicly accessible route to your app
@@ -268,7 +138,7 @@ This step will also require that you manually verify the authenticity of the hos
268138
269139Next, go to the deployment directory that you just initialized and deploy!
270140
271−```
141+```bash
272142cd ~/code/myapp-deploy
273143ob deploy push
274144```
@@ -297,6 +167,25 @@ Here's a `module.nix` that is configured for deployment to a VirtualBox VM (runn
297167
298168The `{...}:` and following is the [NixOS module](https://nixos.org/nixos/manual/index.html#sec-writing-modules) definition.
299169
170+### Locally
171+
172+If you want deploy your application locally or test a production-oriented build you can build and deploy the app as described below.
173+
174+Build the application:
175+
176+```bash
177+nix-build -A exe --no-out-link
178+```
179+
180+Copy the result to a new directory, add configuration, and run!
181+
182+```bash
183+mkdir test-app
184+ln -s $(nix-build -A exe --no-out-link)/* test-app/
185+cp -r config test-app
186+(cd test-app && ./backend)
187+```
188+
300189### From macOS
301190
302191Deploying from macOS requires some extra setup:
@@ -423,3 +312,13 @@ This should copy over and install the application on your device (if you see a
423312##### Build a release version
424313
425314After having configured signing for your app, you may proceed to build a release version of the app. This is no different to how you build the non-release version, so consult the section [Android](#android) further above for exact instructions on building and deploying to your device.
315+
316+
317+## Frequently Asked Questions (FAQ)
318+
319+Refer to [FAQ](FAQ.md).
320+
321+
322+## Contributing
323+
324+Contributions and issue reports are encouraged and appreciated! Refer to the [Contributing](CONTRIBUTING.md) guide for information about getting started.
docs/obelisk-logo-640.pngnew file

Binary file not shown.

guides/app-deploy/README.md+1−1
@@ -8,7 +8,7 @@ This document serves two purposes, the first one is to guide new users that want
88
99## a) Get Obelisk (Linux, Mac)
1010
11−There are several ways to install Obelisk, but the one we are going to use here allows us to test a single version of Obelisk in different ways. The approach is to clone Obelisk from it's GitHub repository and start a project that uses that local check out.
11+There are several ways to install Obelisk, but the one we are going to use here allows us to test a single version of Obelisk in different ways. The approach is to clone Obelisk from its GitHub repository and start a project that uses that local check out.
1212
1313Open a terminal and run the following:
1414
lib/command/src/Obelisk/Command/Run.hs+1−1
@@ -96,7 +96,7 @@ data CabalPackageInfo = CabalPackageInfo
9696 -- ^ List of compiler-specific options (e.g., the "ghc-options" field of the cabal file)
9797 }
9898
99−-- | 'Bool' with a better name for it's purpose.
99+-- | 'Bool' with a better name for its purpose.
100100data Interpret = Interpret_Interpret | Interpret_NoInterpret deriving (Eq, Ord, Show)
101101
102102textInterpret :: Interpret -> Text