/hemo

A Hanami demo application.

Primary LanguageRubyOtherNOASSERTION

Hemo

CircleCI GitHub Actions

Hemo is a portmanteau (i.e. [H]anami + D[emo] = Hemo) which is designed to provide a fully working demo Hanami application as built by the Hanamismith gem.

⚠️ This application is meant for demonstration purposes only which means all commits are heavily rebased as new functionality is implemented. You can definitely clone this project — and is encouraged — but I wouldn’t recommend forking this project because the SHAs will be constantly changing since each commit is meant to tell a story so people can learn how this application was architected. If you do clone (or download) a copy of this application, please note you’ll have to re-clone/download with any new changes pushed to this repository.

Features

  • Uses Hanamismith for building the initial project skeleton and application architecture.

  • Uses modern Hanami (backend) and HTMX (frontend) technology to rapidly develop full featured web applications.

  • Provides a simple task management system for demonstration purposes where you can view, create, edit, update, and destroy tasks.

Screencasts

See the Hanamismith for details.

Requirements

  1. Ruby.

  2. PostgreSQL.

  3. Overmind: Optional but recommended for launching your local web server.

Setup

To set up the project, run:

git clone https://github.com/bkuhlmann/hemo
cd hemo
bin/setup

bin/hanami db create
bin/hanami db migrate
bin/hanami db seed

HANAMI_ENV=test bin/hanami db create
HANAMI_ENV=test bin/hanami db migrate

Usage

For access to the console, run:

bin/console

To view all Rake tasks, run:

rake -T

To view all Hanami CLI or CLI subcommand options, run:

bin/hanami -h
bin/hanami db -h

To develop — red, green, refactor — with Guard, run:

bin/guard

To launch the server, use any of the following:

# Create your own specific settings:
echo 'web: rerun --dir app,config,lib,slices --pattern="**/*.{css,erb,js,rb}" -- bundle exec puma --config ./config/puma.rb' > Procfile.dev

# With Overmind (recommended)
overmind start --port-step 10 --procfile Procfile.dev

# Without Overmind
bin/hanami server

Once the server is running, you can view the app via the following URLs:

You can also check the status (health) of the app by hitting the /up endpoint.

Tests

To test, run:

bin/rake

Troubleshooting

There is only one remaining outstanding issue to resolve:

  • There is an issue with running Google Chrome (headless) on Circle CI which is why the build keeps failing due to using an Alpine Linux Docker image.

Credits