picaosgeo / ha4db

Bridge Management System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ha4db ci ha4db coverage

Ha4db

The Bridge Management System.

Ha4 mean?

  • Hashi means Bridge in Japanese.
  • The Japanese pronounce the 4 as shi.
  • Ha4 = The bridge.

System requirement

  • Ruby 2.7
  • PostgreSQL
  • PostGIS
  • NodeJS + yarn
  • Redis
  • ImageMagick
  • vips
  • pdal
  • docker

Configration for development

bundle
yarn
export HA4DB_DEVELOPMENT_DATABASE_URL=postgis://myuser:mypass@localhost/ha4db_development
rails db:create RAILS_ENV=development
rails db:gis:setup RAILS_ENV=development
rails db:migrate RAILS_ENV=development

Start redis server

docker run --rm -p 6379:6379 redis

Running development server

Open two terminal or use tmux or GNU screen.

In one terminal, run webpack-dev-server.

bin/webpack-dev-server

In other terminal, run rails s.

bin/rails s

Indeed running only rails s is ok, but webpack-dev-server runs background and compiles at the moment when you modify something, so recommend to run both webpack-dev-server and rails s.

Create Administrator User

You may need to add AdminUser.

First, run rails console :

bin/rails c

And add user in console.

a = AdminUser.new
a.name = 'foo'
a.password = 'sp0mhamegg'
a.save

Development entry points

Running test suite

export HA4DB_TEST_DATABASE_URL=postgis://myuser:mypass@localhost/ha4db_test
rails db:create RAILS_ENV=test
rails db:gis:setup RAILS_ENV=test
rails db:migrate RAILS_ENV=test
bin/rspec

After run rspec, the coverage generated in coverage/index.html.

guard

This project supports guard.

bin/guard

Lint

bin/rubocop
yarn eslint . --ext .js,.jsx,.ts,.tsx

Translation

We use i18n_generators.

Currently we support Japanese and English.

Add the language

rails g i18n <your_language>

Update model translation

After you create or modify model schema, re-generate config/locales/translation_*.yml via following tasks:

rails g i18n_translation en
rails g i18n_translation ja
# rails g i18n_translation <your_language>

You need to check config/locales/translation_*.yml manually.

About

Bridge Management System

License:MIT License


Languages

Language:Ruby 53.8%Language:Slim 30.9%Language:TypeScript 11.7%Language:SCSS 1.4%Language:HTML 1.1%Language:JavaScript 0.8%Language:CSS 0.2%Language:Dockerfile 0.1%Language:Shell 0.0%