Skip to content

Simple POC using Rails 7 Hotwire libs for visualizing a German Parser Tree

License

Notifications You must be signed in to change notification settings

gorillalogic/langwire

Repository files navigation

README

German grammar tree visualizer.

imageimage

This repository purpose is:

  • POC new features of rails 7: hotwire, turbo drive, frame, streams, stymulus.
  • POC new featuers of ruby 3.x type system tools like rbs, steep & typeprof.
  • Visualize a Grammar Tree of a sentence in German using ParZu.

Architecture Documentation

RFC - Hotwire POC

Infrastructure

See infra repo, using terraform and gorillalogiclabs AWS Account

https://github.com/gorillalogic/langwire-infra

Dependencies

  1. ruby 3.1.2, It is recommended to use rbenv as version manager.
  2. ParZu Grammar Tree Parser, which is available here https://github.com/rsennrich/ParZu. To pull the image:
docker pull rsennrich/parzu

Private Docker Registry

It uses AWS ECR (Elastic Container Registry), to setup run:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <aws-account-id>.dkr.ecr.us-east-1.amazonaws.com

then, to build and push:

docker build . --tag <aws-account-id>.dkr.ecr.us-east-1.amazonaws.com/langwire
docker push <aws-account-id>.dkr.ecr.us-east-1.amazonaws.com/langwire

to deploy, run on the infra repository:

terraform apply -replace="aws_ecs_task_definition.main"

To fetch the ip used to access the server, run on the infra repository ./describe-ip.sh

Local setup

  1. Clone the repo
git clone [email protected]:gorillalogic/langwire.git
  1. Run the following commands either locally or inside a container:
bundle install
bundle exec rake db:create
bundle exec rake db:schema:load
  1. To run tests
bundle exec rspec

Troubleshooting

  1. If the S3 bucket or the container repository fail to be provisioned because they already exist, we can import them into the local terraform state:
terraform import aws_s3_bucket.bucket langwire-labs
terraform import aws_ecr_repository.main langwire 
  1. If terraform fails because of missing sso options in the aws profile files, this is because the aws provider only supports legacy sso configurations at the time. See https://www.reddit.com/r/aws/comments/zk456d/new_aws_cli_and_sso_sessions_profiles_and_legacy/

Future Work

  • Replace sqlite(default) with DynamoDB. Done
  • CI/CD

About

Simple POC using Rails 7 Hotwire libs for visualizing a German Parser Tree

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published