Skip to content

smellman/ha4db

 
 

Repository files navigation

Ha4db

The Bridge Management System.

Notes

This system will be moved from internal gitlab to github.

If you make issue, don't write issue number in commit log because after moving github the issue number will clear.

Please write issue number in gitlab's MR comments before moving github.

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

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

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.

Deployment instructions

...

About

Bridge Management System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Ruby 68.0%
  • Slim 16.5%
  • TypeScript 5.2%
  • HTML 3.8%
  • JavaScript 3.0%
  • SCSS 3.0%
  • CSS 0.5%