{"id":25072507,"url":"https://github.com/cr0t/lexin","last_synced_at":"2025-10-12T22:13:03.965Z","repository":{"id":43660269,"uuid":"409643853","full_name":"cr0t/lexin","owner":"cr0t","description":"Swedish Dictionary App","archived":false,"fork":false,"pushed_at":"2025-04-14T11:48:36.000Z","size":1049,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T12:47:18.217Z","etag":null,"topics":["elixir","phoenix"],"latest_commit_sha":null,"homepage":"https://lexin.mobi","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cr0t.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-23T15:20:21.000Z","updated_at":"2025-04-14T11:48:39.000Z","dependencies_parsed_at":"2023-11-08T04:42:54.265Z","dependency_job_id":"56f5da42-75fe-4939-871e-a235264b0ec8","html_url":"https://github.com/cr0t/lexin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0t%2Flexin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0t%2Flexin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0t%2Flexin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0t%2Flexin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cr0t","download_url":"https://codeload.github.com/cr0t/lexin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968737,"owners_count":21191158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","phoenix"],"created_at":"2025-02-06T22:29:40.571Z","updated_at":"2025-10-12T22:12:58.934Z","avatar_url":"https://github.com/cr0t.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lexin.mobi\n\nIt's a small web and mobile application for the Swedish dictionary.\n\n## Intro\n\nLexin.mobi provides a new, modern, and responsive user interface to the [Lexin](http://lexin2.nada.kth.se/lexin/) dictionary service. You can find some [historical notes](docs/HISTORY.md) about the creation and first visuals of this application.\n\nLexin.mobi is written as [a Progressive Web App (PWA)](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps) and can be installed and used on mobile devices or on desktops.\n\n### Screenshots\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg width=\"612\" alt=\"image\" src=\"https://user-images.githubusercontent.com/113878/196228786-299064e9-909a-4dac-9af3-6aebc148ef13.png\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg width=\"612\" alt=\"image\" src=\"https://user-images.githubusercontent.com/113878/196228913-e5491fb7-7992-4075-bccd-a9ea58d33254.png\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Development\n\nClone the repository on your development machine. To run the app, we have two approaches: native and Docker.\n\nWhichever approach you choose, you can visit [`localhost:4000`](http://localhost:4000) from your browser, when you've successfully run the Phoenix server locally. See the details below.\n\n### Native\n\n#### Pre-requisites\n\nYou need to have Elixir installed and available in your environment.\n\nThe preferred way is to install the [asdf](https://asdf-vm.com/) utility: then it will be possible to use the same version of Elixir/Erlang/Node.js, which is defined in the `.tool-versions` file in the repository root.\n\n#### Run a Phoenix Server\n\nTo start your local development server:\n\n1. Install dependencies with `mix deps.get`.\n2. Convert or use a demo dictionary file (see the section below in this README).\n3. Start Phoenix endpoint with `mix phx.server` or `iex -S mix phx.server`.\n\n### Docker \u0026 Docker Compose\n\nAlternatively, you can use Docker and have nothing but an editor on your host machine to work with the project.\n\n\u003e **For the first time** (or if you want to install/update dependencies), you need to run `mix deps.get` command inside the `phoenix` service container: `docker-compose run --rm phoenix mix deps.get`.\n\nNow, we can run `docker-compose up` (to run interactively) or `docker-compose --detach` (to run in the background).\n\nCheck the [`docker-compose.yml`](docker-compose.yml) file for details.\n\n### Testing\n\nStraightforward way: `mix test`. _(To run all the tests)_\n\nAdvanced way: `fswatch lib test | mix test --listen-on-stdin`.\n\n\u003e If you want to run tests automatically every time you save the files in `lib` or `test` directories – useful when focusing on writing tests.\n\n#### Integration Testing\n\nWe use [Wallaby](https://hexdocs.pm/wallaby) and [ChromeDriver](https://sites.google.com/chromium.org/driver/) to run integration tests. Read example code in our `tests/integration` directory or on Wallaby's documentation page.\n\n### Releasing\n\nWhen you're done with the development and the tests are green, we can run the release script. It compiles the app inside a Docker container, cleans it, prepares the runner image, and uploads it to the GitHub Container Registry.\n\n\u003e [!warning]\n\u003e\n\u003e **Before Release Checklist**\n\u003e\n\u003e - check or bump the app version in the `mix.exs`\n\u003e - ensure that `.env` and `.tool-versions` files are in harmony\n\u003e - run and check `mix test` for the last time\n\nTo execute a release, we can run this from the project's root directory:\n\n```console\n./scripts/release.sh\n```\n\n\u003e [!tip]\n\u003e\n\u003e **GitHub Container Registry Login**\n\u003e\n\u003e If you see _\"unauthorized: unauthenticated: User cannot be authenticated with the token provided\"_ error at the attempt to push the new image into the container repository, you might need to run this:\n\u003e\n\u003e ```console\n\u003e docker login --username cr0t ghcr.io\n\u003e # use `--password \u003cghcr_token\u003e` option to avoid interactive prompt for the token\n\u003e ```\n\u003e\n\u003e _You can generate a token at https://github.com/settings/tokens._\n\nTo run the container, we must mount two directories (and configure corresponding environment variables): for dictionaries and for sitemaps, as these files are outside the release image. Check [`docker-compose.prod.yml`](docker-compose.prod.yml) as an example.\n\n## Dictionary Files\n\nTo make this app work properly, we need to provide it with a directory with `.sqlite` dictionary files, which contain definitions data.\n\n\u003e To run this app locally, you must create `priv/dictionaries` directory, then copy files from `test/fixtures/dictionaries/` there (fixtures are extremely limited, and contain only ~7 words definitions).\n\u003e\n\u003e You can request access to the original XML files from authors of the original Lexin service (check [https://lexin.nada.kth.se/lexin/](https://lexin.nada.kth.se/lexin/) for the contact information). These files stored in the SVN repository, and we do not want to copy them here and store in this GitHub repository, as they might become out of sync.\n\nYou can convert all of them, or just a few selected ones.\n\n\u003e **It is important** to name output files according to the list of supported languages options (see [`lib/lexin_web/live/components/search_form_component.ex`](lib/lexin_web/live/components/search_form_component.ex)). Our application filters shown list of languages according to available dictionaries it finds in the corresponding directory.\n\nYou might have a similar conversion sequence of commands:\n\n```console\n$ mix run scripts/converter.exs --input dictionaries/swe_ara.xml --output dictionaries/arabic.sqlite\nResetting database...\nParsing input XML...\nInserting into SQLite...\n22014 / 22014\nDone!\n$ mix run scripts/converter.exs --input dictionaries/swe_azj.xml --output dictionaries/azerbaijani.sqlite\nResetting database...\nParsing input XML...\nInserting into SQLite...\n5539 / 5539\nDone!\n$ mix run scripts/converter.exs --input dictionaries/swe_eng.xml --output dictionaries/english.sqlite\nResetting database...\nParsing input XML...\nInserting into SQLite...\n22013 / 22013\nDone!\n```\n\n`scripts/converter.exs` uses `XMLConverter`, see more in the corresponding [module](lib/lexin/dictionary/xml_converter.ex).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0t%2Flexin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcr0t%2Flexin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0t%2Flexin/lists"}