{"id":18520832,"url":"https://github.com/kickinespresso/phx_gen_html_json","last_synced_at":"2025-05-14T17:34:53.915Z","repository":{"id":149986308,"uuid":"124578827","full_name":"kickinespresso/phx_gen_html_json","owner":"kickinespresso","description":"Phoenix HTML and JSON Generators Example","archived":false,"fork":false,"pushed_at":"2018-03-09T20:31:59.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T05:15:17.012Z","etag":null,"topics":["elixir","framework","phoenix"],"latest_commit_sha":null,"homepage":"https://kickinespresso.com/posts/generating-html-and-json-scaffold-with-phoenix-1-3-1-3-2-generorators","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/kickinespresso.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":"2018-03-09T18:33:12.000Z","updated_at":"2020-04-27T18:54:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"758afa8e-65b8-46c1-bcb0-14ecf366fb8d","html_url":"https://github.com/kickinespresso/phx_gen_html_json","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickinespresso%2Fphx_gen_html_json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickinespresso%2Fphx_gen_html_json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickinespresso%2Fphx_gen_html_json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickinespresso%2Fphx_gen_html_json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kickinespresso","download_url":"https://codeload.github.com/kickinespresso/phx_gen_html_json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254194766,"owners_count":22030428,"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","framework","phoenix"],"created_at":"2024-11-06T17:23:05.961Z","updated_at":"2025-05-14T17:34:53.867Z","avatar_url":"https://github.com/kickinespresso.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PhxGenHtmlJson\n\n[Blog Post](https://kickinespresso.com/posts/generating-html-and-json-scaffold-with-phoenix-1-3-1-3-2-generorators)\n\n\n## Generators\n\n    mix phx.gen.html Blog Post posts title:string content:string\n    mix phx.gen.json Blog Post posts title:string content:string --web Api --no-context --no-schema\n\n### Other modifications\n\nAdd `as: :api` to `scope \"/api\", PhxGenHtmlJsonWeb.Api do` as shown below: \n\nGenerated Routes \n\n    scope \"/api\", PhxGenHtmlJsonWeb.Api do\n      pipe_through :api\n      ...\n      resources \"/posts\", PostController\n    end\n\nModified for the correct route paths:\n\n    scope \"/api\", PhxGenHtmlJsonWeb.Api, as: :api do\n      pipe_through :api\n      ...\n      resources \"/posts\", PostController\n    end\n\nInitally, for the project, we used the following command with `and`:\n\n    mix phx.gen.json Blog Post posts title:string content:string --web Api --no-context and --no-schema\n\nThis should have been removed and caused some issues with our `PhxGenHtmlJsonWeb.Api.PostControllerTest` test cases. The [8739c189b7c2a5d16e8fc9c047bdf65734beaa47](https://github.com/kickinespresso/phx_gen_html_json/commit/8739c189b7c2a5d16e8fc9c047bdf65734beaa47) change reflects what was needed to fix this issue. \n\n\n## Starting\n\nTo start your Phoenix server:\n\n  * Install dependencies with `mix deps.get`\n  * Create and migrate your database with `mix ecto.create \u0026\u0026 mix ecto.migrate`\n  * Install Node.js dependencies with `cd assets \u0026\u0026 npm install`\n  * Start Phoenix endpoint with `mix phx.server`\n\nNow you can visit [`localhost:4000`](http://localhost:4000) from your browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickinespresso%2Fphx_gen_html_json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkickinespresso%2Fphx_gen_html_json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickinespresso%2Fphx_gen_html_json/lists"}