{"id":18111718,"url":"https://github.com/afaur/elixir-plug-api","last_synced_at":"2025-09-07T18:41:36.976Z","repository":{"id":83721532,"uuid":"148180839","full_name":"afaur/elixir-plug-api","owner":"afaur","description":"Starter for working with Elixir, Plug, and Cowboy.  Provides an example of how to use a compiled eex template for a route. Has one API route with a test that validates it. Uses HTTPoison for testing a remote web request. Uses Poison for JSON encoding an API response. See `with_new_relic_agent` branch for an example of using new relic monitoring. Has code comments and getting started guide in readme.","archived":false,"fork":false,"pushed_at":"2018-09-27T19:31:07.000Z","size":49,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T13:56:54.299Z","etag":null,"topics":["boilerplate-application","comments","cowboy","documentation","elixir","env","example-app","http2","httpoison","https","justfile","makefile","newrelic","plug","poison","starter-project","unlicense"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afaur.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-09-10T15:54:01.000Z","updated_at":"2024-12-13T16:40:41.000Z","dependencies_parsed_at":"2023-03-11T10:00:19.940Z","dependency_job_id":null,"html_url":"https://github.com/afaur/elixir-plug-api","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/afaur%2Felixir-plug-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaur%2Felixir-plug-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaur%2Felixir-plug-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afaur%2Felixir-plug-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afaur","download_url":"https://codeload.github.com/afaur/elixir-plug-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247452779,"owners_count":20941168,"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":["boilerplate-application","comments","cowboy","documentation","elixir","env","example-app","http2","httpoison","https","justfile","makefile","newrelic","plug","poison","starter-project","unlicense"],"created_at":"2024-11-01T01:07:17.034Z","updated_at":"2025-04-06T08:22:16.377Z","avatar_url":"https://github.com/afaur.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/afaur/elixir-plug-api.svg?branch=master)](https://travis-ci.org/afaur/elixir-plug-api)\n\n## Project Overview\n  - Exposes one `GET` route\n    - GET `/api/users` returns `200 OK` result of `[\"Mary\", \"John\", \"Jill\"]`\n  - Includes e2e test to check that the endpoint responds correctly\n  - Uses four dependencies\n    - [Cowboy](https://github.com/ninenines/cowboy)\n      - Small Fast Http2 / Websocket Server\n    - [Plug](https://github.com/elixir-plug/plug)\n      - Middleware / Composable Modules \n    - [Poison](https://github.com/devinus/poison)\n      - JSON Encoding / Decoding\n    - [HTTPoison](https://github.com/edgurgel/httpoison)\n      - Testing Endpoints (Elixir CURL / Fetch)\n      - Uses binaries instead of string lists\n    - These deps do have [sub deps](https://github.com/afaur/elixir-plug-api/blob/master/.lab/mix.lock)\n      - Goal is to minimize dep reliance as much as possible\n  - See [with_env_config](https://github.com/afaur/elixir-plug-api/tree/with_env_config)\n    branch which adds a `make config` task for creating `.env` from a `.env_sample`.\n  - See [with_new_relic_agent](https://github.com/afaur/elixir-plug-api/tree/with_new_relic_agent)\n    branch for an example of new relic monitoring.\n  - See [with_new_relic_agent_and_env_config](https://github.com/afaur/elixir-plug-api/tree/with_new_relic_agent_and_env_config)\n    branch for an example that combines the two individual branches together.\n\n## Organization\n  - Uses a `.lab` folder, a `Makefile`, and a `Justfile`\n    - `.lab` contains all `mix new` generated files / folders\n    - Uses symlinks to / from `.lab` to simplify organization\n    - Has a `Makefile` and `Justfile` to manage project commands\n\n## Laboratory Folder\n  - Allows important folders / files to stay in the primary project dir\n    - `.lab` folder is short for `laboratory` (where we `mix` our `elixir` :D)\n      - `src` folder is linked to the `lib` folder in `.lab`\n      - `conf` folder contains both the:\n        - `mix.exs` from the root of `.lab` folder\n        - `config.exs` from the `config` dir of `.lab` folder\n      - `test` folder is linked to the `test` folder in `.lab`\n\n## Install Elixir\n  - [OSX](https://elixir-lang.org/install.html#mac-os-x)\n  - [Linux](https://elixir-lang.org/install.html#unix-and-unix-like)\n  - [Windows](https://elixir-lang.org/install.html#windows)\n\n## Using Make / Just\n  - This project uses `Make` or `Just` to simplify `mix` and `iex` commands\n  - If using `just`, replace all commands starting with `make` to `just`\n\n## Installing Make / Just\n  - Having either one on your machine will work and setup is easy\n    - OSX / Linux\n      - By default you should already have `make` on your machine\n      - If you want to install `just` you can get it here\n        - [Just Github Repository](https://github.com/casey/just)\n      - On OSX you can run `brew install just`\n    - Windows\n      - Make doesn't come by default \n        - [Using Make On Windows](https://stackoverflow.com/questions/12881854/how-to-use-gnu-make-on-windows)\n      - If you want to install `just` you can get it here\n        - [Just Github Repository](https://github.com/casey/just)\n\n## Install Dependencies\n  - `make deps`\n    - See code in `conf/mix.exs`\n\n## Build Project\n  - `make build`\n    - See code in `conf/*.exs`\n\n## Running Project\n  - Start the server\n    - `make run`\n  - See code in `src/*.ex`\n\n## Testing\n  - How to test either manually or automatically\n  ### Manual Testing\n  - After running `make run` you can either:\n    - Use CURL\n      - `curl -v \"http://127.0.0.1:8085/api/users\"`\n    - Use Browser\n      - `open http://127.0.0.1:8085/api/users`\n  ### Automatic Testing\n  - ExUnit\n    - `make test`\n      - Runs project and asserts correct response is returned\n      - See code in `test/http_app_test.ex`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaur%2Felixir-plug-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafaur%2Felixir-plug-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaur%2Felixir-plug-api/lists"}