Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zeropsio/recipe-elixir
A Basic Elixir Recipe on Zerops
https://github.com/zeropsio/recipe-elixir
elixir-lang zerops zerops-recipe
Last synced: 25 days ago
JSON representation
A Basic Elixir Recipe on Zerops
- Host: GitHub
- URL: https://github.com/zeropsio/recipe-elixir
- Owner: zeropsio
- License: mit
- Created: 2024-11-21T13:37:39.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-21T15:17:12.000Z (about 1 month ago)
- Last Synced: 2024-11-21T15:26:00.513Z (about 1 month ago)
- Topics: elixir-lang, zerops, zerops-recipe
- Language: Elixir
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zerops x Elixir
This is a bare-bones example of an Elixir application running on [Zerops](https://zerops.io) — as few libraries as possible, just a simple endpoint with connnect, read and write to a Zerops PostgreSQL database.![elixir](https://github.com/zeropsio/recipe-shared-assets/blob/main/covers/svg/cover-elixir.svg)
## Deploy on Zerops
You can either click the deploy button to deploy directly on Zerops, or manually copy the [import yaml](zerops.yml) to the import dialog in the Zerops app.[![Deploy on Zerops](https://github.com/zeropsio/recipe-shared-assets/blob/main/deploy-button/green/deploy-button.svg)](https://app.zerops.io/recipe/elixir)
## Recipe features
- **Plug** + **Cowboy** HTTP server running on a load balanced **Zerops Elixir** service
- Zerops **PostgreSQL** service as database
- Built with `plug_cowboy` for HTTP server functionality
- **Ecto** for database interactions
- Health check endpoint at `/status`
- Utilization of Zerops' built-in **environment variables** system
- JSON response handling with **Jason**
## Project Structure
The application consists of:
- HTTP Router handling incoming requests
- Database integration using Ecto
- Simple entry creation and counting system
- JSON response formattingKey endpoints:
- `GET /` - Creates a new entry and returns count
- `GET /status` - Health check endpoint
## Production vs. Development
Base of the recipe is ready for production. For production deployment, consider:- Using highly available version of the PostgreSQL database (change `mode` from `NON_HA` to `HA` in recipe YAML)
- Using at least two containers for the Elixir service (add `minContainers: 2` in recipe YAML)Additional production considerations:
- Use Zerops object storage for file storage
- Implement Redis (Valkey) for caching and session management
- Add comprehensive logging and monitoring
- Implement proper error handling and reporting
Need help setting your project up? Join [Zerops Discord community](https://discord.com/invite/WDvCZ54).