在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):obsidiansystems/obelisk开源软件地址(OpenSource Url):https://github.com/obsidiansystems/obelisk开源编程语言(OpenSource Language):Haskell 85.4%开源软件介绍(OpenSource Introduction):ObeliskFunctional reactive web and mobile applications, with batteries included. Obelisk's goal is to represent a cohesive, highly-curated set of choices that Obsidian Systems has made for building these types of applications in a way that is extremely fast but does not compromise on production readiness.
OverviewObelisk allows you to build high-quality web and mobile applications very quickly using Reflex. 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. 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. Who should consider using it?Obelisk assumes basic knowledge of Haskell and Reflex/Reflex-DOM, web technologies like HTML and CSS, and a terminal shell like Bash. Knowledge of Nix helps but is not strictly necessary. Installing Obelisk
Accessing private repositoriesTo allow the Nix builder to access private git repositories, you must be set up to access them via SSH. Follow these steps depending on the platform you need access to: Developing an Obelisk projectTo create a new Obelisk project, go to an empty directory and run: ob init Obelisk leverages ghcid to provide a live-reloading server that handles both frontend and backend. To run your Obelisk app and monitor the source for changes: ob run Now, with an appropriate browser, go to http://localhost:8000 (or the address/port specified in Every time you change the Haskell source files in frontend, common or backend, Local HoogleObelisk can also provide a local Hoogle server that lets you browse and search the types and documentation for all of the dependencies in your entire Obelisk application. To start the Hoogle server, in a spare terminal run the following command from the root of your Obelisk application: $ ob hoogle You can then access your local Hoogle from your web browser at Adding packagesIn 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. Adding package overridesTo 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 # ...
project ./. ({ pkgs, ... }: {
# ...
overrides = self: super: let
aesonSrc = pkgs.fetchFromGitHub {
owner = "obsidiansystems";
repo = "aeson-gadt-th";
rev = "ed573c2cccf54d72aa6279026752a3fecf9c1383";
sha256 = "08q6rnz7w9pn76jkrafig6f50yd0f77z48rk2z5iyyl2jbhcbhx3";
};
in
{
aeson = self.callCabal2nix "aeson" aesonSrc {};
waargonaut = self.callHackageDirect {
pkg = "waargonaut";
ver = "0.8.0.1";
sha256 = "1zv28np3k3hg378vqm89v802xr0g8cwk7gy3mr77xrzy5jbgpa39";
} {};
};
# ... For further information see the Haskell section of nixpkgs Contributors Guide. Adding extra local packagesIf the standard packages ( # ...
project ./. ({ pkgs, ... }: {
# ...
packages = {
another = ./another;
};
# ... Running over HTTPSTo run your app locally over HTTPS, update the protocol in 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 IDE SupportObelisk officially supports terminal-based feedback (akin to DeployingDefault EC2 DeploymentIn 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). First create a new EC2 instance:
At this stage your instance should be booting and become accessible shortly. Note down the hostname of your EC2 instance. Now go to your Obelisk project directory ( cd ~/code/myapp
SERVER=ec2-35-183-22-197.ca-central-1.compute.amazonaws.com
ROUTE=https://myapp.com # Publicly accessible route to your app
[email protected]
ob deploy init \
--ssh-key ~/myaws.pem \
--hostname $SERVER \
--route $ROUTE \
--admin-email $EMAIL \
~/code/myapp-deploy HTTPS is enabled by default; to disable HTTPS pass This step will also require that you manually verify the authenticity of the host Next, go to the deployment directory that you just initialized and deploy! cd ~/code/myapp-deploy
ob deploy push
At this point you are done. Your app will be accessible at Custom Non-EC2 DeploymentBy default Obelisk deployments are configured for NixOS machines running on AWS EC2. To provide your own configuration, you need to write a custom
The VirtualBox Deployment section provides an example. VirtualBox DeploymentHere's a { nixosPkgs, ... }: {...}: {
imports = [ (nixosPkgs.path + /nixos/modules/virtualisation/virtualbox-image.nix) ];
} The LocallyIf you want deploy your application locally or test a production-oriented build you can build and deploy the app as described below. Build the application: nix-build -A exe --no-out-link Copy the result to a new directory, add configuration, and run! mkdir test-app
ln -s $(nix-build -A exe --no-out-link)/* test-app/
cp -r config test-app
(cd test-app && ./backend) From macOSDeploying from macOS requires some extra setup: Running Deploying an updated versionIf you'd like to deploy an updated version (with new commits) of your Obelisk app: simply go to the configuration directory, update the source thunk and push: cd ~/code/myapp-deploy
ob deploy update
ob deploy push MobileUntil Obelisk offers a iOSFirst time setupDevelopment on iOS requires a computer running macOS and an iOS developer account. Your account must also belong to an Apple Developer Team, if you want to access developer portal links (otherwise they'll redirect to your account page). iPhone
XcodeInstall Xcode 11.2 (contains iOS SDK 13.2) and open it so that it runs its post install tool setup. These versions will work out of the box but iOS SDKs prior to 11.3 should also work. You can choose another installed version in More recent Xcodes should also work, as long as one of the SDKs mentioned above has been used. To add another SDK to your current Xcode, download the corresponding Xcode, extract it and copy its SDK folder next to the installed one, e.g. open -W Xcode_9.2.xip
sudo cp -R Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk You can verify that you have correct versions by running xcodebuild -showsdks CertificatesTo deploy and/or package apps, you'll need to inform Apple of your development devices and permissions by adding credentials to the correct provisioning profile via the Apple Developer portal.
Building
Deploying
result-ios/bin/deploy [TEAM_ID]
# or in debug mode via lldb:
result-ios/bin/deploy [TEAM_ID] -d Packaging
result-ios/bin/package [TEAM_ID] /path/to/output/.ipa /path/to/profile/file DebuggingIt's also possible to inspect iOS WkWebView apps once they are installed in the iPhone:
AndroidNOTE: Currently Android builds are only supported on Linux.
Now deploy the built apk file to your Android device:
Alternatively, you can deploy from an obelisk deployment directory (a directory generated post
In the event that you change your key or keystore password, you will have to update your credentials within the JSON object found in Additional documentation on Java key stores can be found here. This should copy over and install the application on your device (if you see a "signatures do not match" error, simply uninstall the previous app from the device before retrying the deploy). The name of the installed application will be what you have specified for Releasing to Play StoreBuild a release versionAfter 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 further above for exact instructions on building and deploying to your device. Frequently Asked Questions (FAQ)Refer to FAQ. ContributingContributions and issue reports are encouraged and appreciated! Refer to the Contributing guide for information about getting started. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论