Urbit Developers
  • Lightning Tutorials

    • Introduction
    • Build a Groups App
    • Build a Chat App
    • Build a Voting App
    • Core Curriculum

      • Hoon School

        • Introduction
        • 1. Hoon Syntax
        • 2. Azimuth (Urbit ID)
        • 3. Gates (Functions)
        • 4. Molds (Types)
        • 5. Cores
        • 6. Trees and Addressing
        • 7. Libraries
        • 8. Testing Code
        • 9. Text Processing I
        • 10. Cores and Doors
        • 11. Data Structures
        • 12. Type Checking
        • 13. Conditional Logic
        • 14. Subject-Oriented Programming
        • 15. Text Processing II
        • 16. Functional Programming
        • 17. Text Processing III
        • 18. Generic and Variant Cores
        • 19. Mathematics
        • App School I

          • Introduction
          • 1. Arvo
          • 2. The Agent Core
          • 3. Imports and Aliases
          • 4. Lifecycle
          • 5. Cards
          • 6. Pokes
          • 7. Structures and Marks
          • 8. Subscriptions
          • 9. Vanes
          • 10. Scries
          • 11. Failure
          • 12. Next Steps
          • Appendix: Types
          • App School II (Full-Stack)

            • Introduction
            • 1. Types
            • 2. Agent
            • 3. JSON
            • 4. Marks
            • 5. Eyre
            • 6. React app setup
            • 7. React app logic
            • 8. Desk and glob
            • 9. Summary
          • Environment Setup
          • Additional Guides

            • Threads

              • Fundamentals
              • Bind
              • Input
              • Output
              • Summary
              • Hoon Workbook

                • Rhonda Numbers
                • Roman Numerals
                • Solitaire Cipher
              • Writing Aqua Tests
              • CLI Apps
              • Serving a Browser Game
              • Using the HTTP API
              • Working with JSON
              • Parsing
              • Sail: HTML in Hoon
              • Distributing Software
              • Working with Strings
              • Writing Unit Tests
              Urbit Developers
              • Lightning Tutorials

                • Introduction
                • Build a Groups App
                • Build a Chat App
                • Build a Voting App
                • Core Curriculum

                  • Hoon School

                    • Introduction
                    • 1. Hoon Syntax
                    • 2. Azimuth (Urbit ID)
                    • 3. Gates (Functions)
                    • 4. Molds (Types)
                    • 5. Cores
                    • 6. Trees and Addressing
                    • 7. Libraries
                    • 8. Testing Code
                    • 9. Text Processing I
                    • 10. Cores and Doors
                    • 11. Data Structures
                    • 12. Type Checking
                    • 13. Conditional Logic
                    • 14. Subject-Oriented Programming
                    • 15. Text Processing II
                    • 16. Functional Programming
                    • 17. Text Processing III
                    • 18. Generic and Variant Cores
                    • 19. Mathematics
                    • App School I

                      • Introduction
                      • 1. Arvo
                      • 2. The Agent Core
                      • 3. Imports and Aliases
                      • 4. Lifecycle
                      • 5. Cards
                      • 6. Pokes
                      • 7. Structures and Marks
                      • 8. Subscriptions
                      • 9. Vanes
                      • 10. Scries
                      • 11. Failure
                      • 12. Next Steps
                      • Appendix: Types
                      • App School II (Full-Stack)

                        • Introduction
                        • 1. Types
                        • 2. Agent
                        • 3. JSON
                        • 4. Marks
                        • 5. Eyre
                        • 6. React app setup
                        • 7. React app logic
                        • 8. Desk and glob
                        • 9. Summary
                      • Environment Setup
                      • Additional Guides

                        • Threads

                          • Fundamentals
                          • Bind
                          • Input
                          • Output
                          • Summary
                          • Hoon Workbook

                            • Rhonda Numbers
                            • Roman Numerals
                            • Solitaire Cipher
                          • Writing Aqua Tests
                          • CLI Apps
                          • Serving a Browser Game
                          • Using the HTTP API
                          • Working with JSON
                          • Parsing
                          • Sail: HTML in Hoon
                          • Distributing Software
                          • Working with Strings
                          • Writing Unit Tests
                          Guides/Core Curriculum/App School II (Full-Stack)

                          Introduction

                          This series walks through the writing of a full Gall agent, and then the process of integrating it with a React front-end. This series follows on from App School I. If you haven't completed that, or otherwise aren't familiar with the basics of writing Gall agents, it's strongly recommended to work through that guide first.

                          The app we'll be looking at is a simple journal with an agent called %journal. In the browser, users will be able to add plain text journal entries organized by date. Entries may be scrolled through in ascending date order, with more entries loaded each time the bottom of the list is reached. Old entries will be able to be edited and deleted, and users will be able to search through entries by specifying a date range.

                          The Journal app we'll be looking at can be installed on a live ship from ~pocwet/journal, and its source code is available here.

                          journal ui screenshot

                          This walkthrough does not contain exercises, nor does it completely cover every aspect of building the app in full depth. Rather, its purpose is to demonstrate the process of creating a full-stack Urbit app, showing how everything fits together, and how concepts you've previously learned are applied in practice.

                          The primary focus of the walkthrough is to show how a Javascript front-end is integrated with a Gall agent and distributed as a complete app. Consequently, the example app is fairly simple and runs on a local ship only, rather than one with more complex inter-ship networking.

                          Each section of this walkthrough will list additional resources and learning material at the bottom of the page, which will cover the concepts discussed in a more comprehensive manner.

                          Here is the basic structure of the app we'll be building:

                          journal app
diagram

                          Sections

                          Introduction

                          An overview of the guide and table of contents.

                          1. Types

                          Creating the /sur structure file for our %journal agent.

                          2. Agent

                          Creating the %journal agent itself.

                          3. JSON

                          Writing a library to convert between our agent's marks and JSON. This lets our React front-end poke our agent, and our agent send updates back to it.

                          4. Marks

                          Creating the mark files for the pokes our agent takes and updates it sends out.

                          5. Eyre

                          A brief overview of how the webserver vane Eyre works.

                          6. React App Setup

                          Creating a new React app, installing the required packages, and setting up some basic things for our front-end.

                          7. React App Logic

                          Analyzing the core logic of our React app, with particular focus on using methods of the Urbit class from @urbit/http-api to communicate with our agent.

                          8. Desk and Glob

                          Building and "globbing" our front-end, and putting together a desk for distribution.

                          9. Summary

                          Some final comments and additional resources.

                          1. Types

                          ->

                          Edit this page on GitHub

                          Last modified October 31, 2022