All Projects → Nebo15 → Renew

Nebo15 / Renew

Licence: mit
Mix task to create mix projects that builds into Docker containers.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Renew

lowcode
React Lowcode - prototype, develop and maintain internal apps easier
Stars: ✭ 32 (-3.03%)
Mutual labels:  generator, code
Swiftcolorgen
A tool that generate code for Swift projects, designed to improve the maintainability of UIColors
Stars: ✭ 152 (+360.61%)
Mutual labels:  generator, code
Blog App Buffalo
A blogging app built with Buffalo.
Stars: ✭ 27 (-18.18%)
Mutual labels:  generator
Learningprocess
💥 本仓库用于记录我的学习历程和学习笔记
Stars: ✭ 31 (-6.06%)
Mutual labels:  code
Pinecoders.github.io
PineCoders Web Site
Stars: ✭ 30 (-9.09%)
Mutual labels:  code
Larawiz
Larawiz is a easy project scaffolder for Laravel
Stars: ✭ 28 (-15.15%)
Mutual labels:  generator
Git Changelog
Automatic Changelog generator using Jinja2 templates.
Stars: ✭ 30 (-9.09%)
Mutual labels:  generator
May
rust stackful coroutine library
Stars: ✭ 909 (+2654.55%)
Mutual labels:  generator
Sao
⚔ Futuristic scaffolding tool
Stars: ✭ 966 (+2827.27%)
Mutual labels:  generator
Catalyst
Typescript NodeJS Microservices Boilerplate with Generator CLI - Moleculer, GraphQL, REST, OAuth2, Jaeger, Grafana, Prometheus, Ory Hydra, Ory Keto w/ Access Control middleware, Moleculer-DB GraphQL mixin, Pug, Redis, sibling client repo (login, persistance layer, react-native-web, ios, android)
Stars: ✭ 30 (-9.09%)
Mutual labels:  generator
Rispa Cli
Modular project management
Stars: ✭ 30 (-9.09%)
Mutual labels:  generator
Image To Image Papers
🦓<->🦒 🌃<->🌆 A collection of image to image papers with code (constantly updating)
Stars: ✭ 949 (+2775.76%)
Mutual labels:  code
Jaymock
Minimal fake JSON test data generator.
Stars: ✭ 28 (-15.15%)
Mutual labels:  generator
Sao Nm
Scaffold out a node module.
Stars: ✭ 30 (-9.09%)
Mutual labels:  generator
Swiftproject
🏆 Generate Swift project with necessary toolings
Stars: ✭ 27 (-18.18%)
Mutual labels:  generator
React Colorful
🎨 A tiny (2,5 KB) color picker component for React and Preact apps
Stars: ✭ 951 (+2781.82%)
Mutual labels:  hex
Prompt Checkbox
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (-36.36%)
Mutual labels:  generator
Generator Express Es6
Yeoman generator for Express.js
Stars: ✭ 28 (-15.15%)
Mutual labels:  generator
Fundamentals Of Python Data Structures
《数据结构(Python语言描述)》"Fundamentals of Python:Data Structures" 电子书和配套代码
Stars: ✭ 30 (-9.09%)
Mutual labels:  code
Jsontocodable
A generating tool from Raw JSON to Codable (Swift4) text written in Swift4.
Stars: ✭ 33 (+0%)
Mutual labels:  generator

Renew

This is a universal project generator that grow out of Nebo #15 requirements:

  • We use micro-service architecture, so we used to have many projects that start with a same boilerplate that differs by included features. (As rule of thumb we use a separate micro-service for each part that we want to deploy in isolation.)
  • We want our code to have consistent style.
  • We want our API responses to have consistent structure and logic in all our products.
  • And we want to have it covered with tests.
  • We follow the twelve-factor methodology, especially we are trying to use environment variables in all application configurations. This allows us to build Docker containers and use them in different environments. In this way we can be sure that everything works on production in a same way as in environment where we test our products.
  • We use Docker since it allows to deploy binaries and run acceptance/performance tests against them in a release cycle.
  • We use Travis-CI to run tests and to build Docker containers.
  • We use Kubernetes clusters with many docker containers inside.
  • We want Docker containers be as small as possible, Alpine Linux is the best for it.
  • We use Ecto and Phoenix (only in places where we need them), also we use RabbitMQ to guarantee message processing.

So it includes:

  • Distillery release manager.

  • Confex environment variables helper.

  • Ecto database wrapper with PostreSQL and MySQL adapters.

  • Phoenix Framework.

  • Multiverse response compatibility layers.

  • RBMQ RabbitMQ wrapper.

  • EView Phoenix response and views wrapper.

  • LoggerJSON - JSON console back-end for Elixir Logger.

  • Code Coverage, Analysis and Benchmarking tools:

    • Benchfella - Microbenchmarking tool.
    • ExCoveralls - Coverage report tool with coveralls.io integration.
    • Dogma - A code style linter.
    • Credo - A static code analysis tool with a focus on code consistency and teaching.
  • Setup for Travis-CI Continuous Integration. And many scripts that makes simpler to work with it.

  • Pre-Commit hooks to keep code clean.

  • Docker container configuration and helper scripts.

  • Heroku auto-deploy script for Travis-Ci.

  • API Blueprint and DevOps docs templates.

Installation

Install this package globally:

mix archive.install https://github.com/Nebo15/renew/releases/download/0.20.0/renew.ez

Usage

Usage is very similar to mix new, but with many additional feature flags:

  • docker - include Docker setup.
  • ci - include Travis-Ci setup.
  • ecto and ecto_db - include Ecto adapter.
  • amqp - include RBMQ setup.
  • phoenix - include Phoenix setup.

Run renew mix task to create new projects:

mix renew myapp --ecto --ci --docker --phoenix

You can get more info in renew mix task.

Docker Helpers

Dockerfile needs enhancements, so take look in it's source. Sometimes you need to expose some ports to talk to a container, and change CMD of your application.

There are ./bin/build.sh script that removes routine in building container for production.

$ ./bin/build.sh
[I] Building a Docker container 'myapp' from path '/Users/andrew/Projects/www/myapp'..
Sending build context to Docker daemon 24.96 MB
Step 1 : FROM trenpixster/elixir:1.3.2
 ---> e22fdfc62c5a
...
Successfully built eae970501b13

Another one is ./bin/start.sh that will run your app in detached mode.

Environment variables

Use ${ENV_VAR} inside config/config.exs since Distillery is configured to replace OS vars on each run of application.

config :myapp, :mykey,
  db_user: "${DB_USER}"

When configuring your code you can also use Confex and {:system, VAR_NAME, default_value} tuples:

config :myapp, :mykey,
  somevar: {:system, "MY_VAR_NAME", "default"}

and read it later:

Confex.get_map(:myapp, :mykey)

Later you can start Docker container passing .env file to set appropriate configuration of your application:

$ docker run --env-file .env [rest..]

Migrations

Whenever you make a release for your app you can't use mix anymore, but you still want to be able to run migrations. For this cases we include migrator module. This post tells how to run migration without mix.

Your migrations will be preserved within container in ./priv/repo folder.

To run a migration set DB_MIGRATE=true in your environment.

Useful links

Thanks

  • bitwalker for his Docker container script and for being proactive while helping in Distillery issues.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].