{"id":15589784,"url":"https://github.com/spapas/phxcrd","last_synced_at":"2025-07-22T16:08:02.564Z","repository":{"id":66174526,"uuid":"185398414","full_name":"spapas/phxcrd","owner":"spapas","description":"A crud app for phoenix / elixir","archived":false,"fork":false,"pushed_at":"2023-03-16T19:23:26.000Z","size":9088,"stargazers_count":61,"open_issues_count":5,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T19:45:40.987Z","etag":null,"topics":["elixir","phoenix"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/spapas.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}},"created_at":"2019-05-07T12:34:26.000Z","updated_at":"2024-12-02T22:09:31.000Z","dependencies_parsed_at":"2024-10-11T19:11:43.517Z","dependency_job_id":"d993ad1d-bf32-4eb9-8a06-40f3452ee989","html_url":"https://github.com/spapas/phxcrd","commit_stats":{"total_commits":198,"total_committers":2,"mean_commits":99.0,"dds":0.005050505050505083,"last_synced_commit":"27564d19dc006db5e5f126306f7fec7f1bf844bc"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/spapas/phxcrd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spapas%2Fphxcrd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spapas%2Fphxcrd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spapas%2Fphxcrd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spapas%2Fphxcrd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spapas","download_url":"https://codeload.github.com/spapas/phxcrd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spapas%2Fphxcrd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266525173,"owners_count":23942889,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-10-02T23:09:43.008Z","updated_at":"2025-07-22T16:07:57.534Z","avatar_url":"https://github.com/spapas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phxcrd\n\n**Updated with Phoenix 1.7.x**\n\nA project-template for starting CRUD apps with Phoenix framework. This is based mainly on my own requirements.\n\nThis doesn't include webpack or any other JS bundlers; just use good ol' vanilla JS! Everything client-side phoenix (presense, live views etc) is  working!\n\n\n## Things that *are* included:\n\n* A custom user model\n* Multiple authentication with both LDAP (using exldap) and database (using comeonin and argon for password hashing)\n* A permission model to add permissions to users (i.e Administrator, Editor etc)\n* An authority model to assign users to authorities (i.e directorates, groups etc)\n* Authorization using cancan (i.e only Administrators can access this view, only users belonging to the same Authority can edit a user's process)\n* Creating PDFs with pdf_generator\n* Creating xlsxs with elixlsx\n* Local time support with timex\n* Use accessible to be able to properly \"Access\" schema attributes\n* Scrievner for pagination (check authority_controller for usage)\n* Auditing models with ex_audit\n* Send mails with bamboo (smtp)\n* A bootstrap 5 styled template\n* A script to easily *rename* this project so it can be used as a template for your own projects\n* A way to define filters for a query among joins etc (check authority_controller for example - https://spapas.github.io/2019/07/25/declarative-ecto-query-filters/)\n* Allow sorting pages with click (https://spapas.github.io/2019/10/17/declarative-ecto-query-sorting/)\n* Integration of select2 with ajax (https://spapas.github.io/2019/06/04/phoenix-form-select2-ajax/)\n* Sentry integration for error reporting\n* Configuration using secrets and a secret template\n* Multiple environments (dev/uat/prod) each with its own secret (copy the template and rename it)\n* A fabric (https://www.fabfile.org/ for fabric 1.x) script to quickly deploy changes\n* A config file for supervisord (http://supervisord.org)\n* Custom JS includes on specific controller actions\n* A i18n enabled Phoenix datepicker\n* Properly configure phoenix presence along with a small demonstration\n* Properly configure phoenix live view along with a small demonstration\n* Proper CRUD handling with Phoenix Live View (add/edit/show/delete)\n* An example of file uploading and usage of sendfile to implement authorization on uploaded files\n* Phoenix Live Dashboard\n* Custom handlers for alerts (https://spapas.github.io/2020/05/15/elixir-osmon-alerts/)\n\n## Missing stuff\n\n* Fix all tests\n* Various refactoring decisions\n* Check out `phx mix.digest`\n\n## Compiling comeonin-argon\n\n~~Read this first: https://github.com/riverrun/comeonin/wiki/Requirements~~\n\n~~TL;DR: You'll need to install the MS VS Build tools and then run vcvarsall.bat amd64. Notice that the location of vcvaralls.bat is different for different versions so just search it. Then run `mix compile` to properly compile argon.~~\n\nDepracated! I changed it with `pbkdf2_elixir` to avoid the compilation step on Windows!\n\n## Requirements\n\nI've tested it on  Windows 10 with\n\n```\nErlang/OTP 24 [erts-12.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]\n\nElixir 1.12.3 (compiled with Erlang/OTP 22)\n```\n\n\n## Deploying\n\nI propose deploying with a fabric script or something similar; i.e pull the changes from your VCS and run required commands. This doesn't support distillery yet.\n\nFor the first time you want to deploy should just clone it from GH like\n\n```\ngit clone https://github.com/spapas/phxcrd\n```\n\nand then go to the phxcrd directory and copy the `config/secret.exs.template` to `env_name.secret.exs` where `env_name` is either `dev`, `uat` or `prod`.\n\nThen you should properly edit the secrets file for your environment.\n\nAfter that you should set your mix environment ie run something like `export MIX_ENV=uat` on unix/bash or `set MIX_ENV=uat` on windows and finally you'll\nbe able to run `mix`. The following steps will be run anyway each time you deploy something from fabric but I recommend running them once to see the\noutput. So try running:\n\n```\nmix ecto.create # to create the env's db\nmix ecto.migrate # to create tables in the database\nmix run mix run priv/repo/seeds.exs # to seed the database\nmix phx.server # to make sure that everything works fine\n```\n\nTo auto-start the server I use supervisord; just copy `/etc/phxcrd-supervisor.conf` to your `/etc/supervisord.d/` directory.\n\n## Templating\n\nYou can use the `renameproj.bat` file to create a project with different name than phxcrd. The script is for windows cmd but you can take a look\nat it and convert it to unix/bash or take a look at this gist: https://gist.github.com/krystofbe/92aed7cd03c9a631eb3c7af490525c4e\n\nBefore starting the script you must set the following variables like so:\n\n```\nset CURRENT_NAME=\"Phxcrd\"\nset CURRENT_OTP=\"phxcrd\"\n\nset NEW_NAME=\"NewName\"\nset NEW_OTP=\"new_name\"\n```\n\nAlso notice it needs some utilities like sed and xargs which must be available to your github for windows installation folder.\n\n## Deploying changes\n\nI've provided a simple fabric script for that: The script will\n\n* Add / commit and push local changes\n* Retrieve and merge changes to server\n* Install deps and run migrations\n* Restart server (using supervisorctl)\n\nJust run `fab env full_deploy` (env = uat or prod) and you should be good to go. Notice that I use the fabric 1.x syntax (because fabric 2.x does not support various things) thus you'll need to use fab-classic (`pip install fab-classic`).\n\n## Signal handling\n\nIt may be worth it to respond to signals for restarting using `:init.restart`.\n\n* http://erlang.org/doc/man/kernel_app.html#erl_signal_server\n* https://medium.com/@ellispritchard/graceful-shutdown-on-kubernetes-with-signals-erlang-otp-20-a22325e8ae98\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspapas%2Fphxcrd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspapas%2Fphxcrd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspapas%2Fphxcrd/lists"}