GithubHelp home page GithubHelp logo

landscapeapp's Introduction

Get started building a simple application for Landscape on your Urbit ship with a few commands.

This tool is experimental and primarily used internally to develop front-end applications. While Tlon does not officially support this tool, you can always get general programming help for Urbit from the Urbit Community group at ~bitbet-bolbel/urbit-community or the urbit-dev mailing list.

awesome urbit badge

Installation

This repository is available as a template; to immediately generate your application's repository you can click here. Clone the generated repository, npm install and then run npm start to get started (you can also directly clone this repository, if you wish!).

In order to run your application on your ship, you will need Urbit v.0.10.0 or higher. On your Urbit ship, if you haven't already, mount your pier to Unix with |mount %.

Using

Once you're up and running, your application lives in the src and urbit folders; src uses React to render itself -- you'll want a basic foothold with it first. The urbit directory includes a basic boilerplate for the back-end of the application, running on your Urbit ship.

When you make changes, the urbit directory will update with the compiled application and, if you're running npm run serve, provides a dev server environment with hot reloading at localhost:9000.

  1. Start with npm start

This runs the wizard. Give it an application name and the location of your Urbit ship's desk and it will customise the files so your new application will run on your ship.

  1. Use npm run serve (or, optionally, npm run build to produce a minified JS blob).

  2. |commit %home on your ship and |start %yourappname.

  3. Access your application at localhost:9000/~yourappname. As you edit your source code, the page will automatically refresh.

FAQ

How can I ensure my app fits Landscape design?

Landscape makes use of the indigo-react component library. The template makes use of it as an example for you to get going fast.

Nothing shows up when I go to localhost:9000.

The build process assumes your ship is available at localhost:80. If it isn't (the ship's boot process will give you a port), then change it accordingly in .urbitrc and run npm run serve again.

How do I develop on a different ship?

Edit the .urbitrc file with the path to your new pier/desk:

module.exports = {
  URBIT_PIERS: [
    "/path/to/new-pier/desk-name",
  ]
};

Do I need Hoon to build apps for Landscape?

Not necessarily! You don't even need this template, if you want to create a pure front-end application. You can tell your ship to mount any path inside Clay to an endpoint, and it will mount all HTML, CSS, JS, and PNGs from that Clay path to the endpoint path:

:file-server &file-server-action [%serve-dir /example-path /app/example %.y %.n]

This command would serve the files inside /app/example on your ship at your-ship.arvo.network/example-path, and the first boolean, %.y, declares that it's public. If you would like to require authentication -- as with the other Landscape applications -- change this to %.n. The second, %.n in this case, declares that this is not part of the Landscape core suite (this affects how file-server routes).

You can also add any URL to your Landscape homescreen -- ie. any URL, regardless of it being hosted on your ship -- with this command in Dojo:

:launch &launch-action [%add %example [[%basic 'example' 'https://example.com/image.png' 'https://example.com'] %.y]]

In this case, %example is the name of the application within Launch, 'example' is the title on the tile itself, image.png points to the icon URL for the tile, and example.com is where the tile will link to. %.y declares that yes, this tile is shown.

How do I learn to communicate with my ship or write back-end code?

In order to do anything substantial with Gall, see this guide for pointers.

But if this is intimidating, don't panic: create-landscape-app is a fantastic way to start learning by leveraging your strengths. This repository is intended to be a boilerplate for rapid front-end development; it's also a gradual, incremental introduction to Hoon for web developers by allowing for rapid prototyping and experimentation with the Landscape interface.

Happy hacking!

landscapeapp's People

Contributors

serdarkucuklu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.