Carbon
User library for phoenix and elixir.
Installation
Carbon is available in Hex, and can be installed as:
Add
carbonto your list of dependencies inmix.exs:def deps do
[{:carbon, "~> 0.1.3"}]end
Ensure
carbonis started before your application:def application do
[applications: [:carbon]]end
Usage
To install carbon in your application
mix carbon.installAbove command generates a migration, that is all you need to install Carbon, you can modify the migration to add your custom fields, Carbon only requires following fields
* email
* password_hashTo install and migrate database use –migrate switch
mix carbon.install --migrateconfigure Carbon
config :carbon,
repo: MyApp.RepoSetup a mailer to send out emails, Carbon uses swoosh email library to send out emails, please visit (Swoosh)[https://github.com/swoosh/swoosh] for more details
config :carbon, Carbon.Mailer,
adapter: Swoosh.Adapters.Logger,
level: :debugRegister Carbon routes in your web/router.ex
use Carbon.RoutesCarbon registers few routes, and can be overridden
/login
/logout
/register
/password/resetRoadmap
We are using carbon in production already, we have plans for Carbon some of the stuff in pipeline:
* generators for migration, controllers, views, models, mailers
* mailers for welcome,signup,reset emails
* oauth integration
* multiple adapter support session,jwt and more
* and perhaps memberships out of the boxContributing
Contributions are welcome! We love you if you send a PR with some tests.
License
Copyright (c) 2016, al-razi.
Apache 2 License.