Skip to content

maxvoltage/ai

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai (あい)

CircleCI Coveralls branch Phoenix StackShare

Phoenix & Elixir JSON API powering mirai.audio

Docs

Prerequisites

You will need the following tools properly installed:

brew install elixir  # installs Erlang & Elixir
mix local.hex  # install hex package manager
brew cask install docker  # used to run PostgreSQL

Running / Development

Run the PostgreSQL db server (via Docker)

docker run -it -p 5432:5432 --rm \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=postgres \
  --name postgres \
  postgres

Environment variables

The following environment variables are available to override fallback (dev) configuration, it works best to add them to a .env file.

ENV_AI_MIR_URL=https://mirai.audio       # URL of Mir, frontend
ENV_AI_DB_URL=ecto://postgres:postgres@localhost/ai_dev
ENV_AI_HOST=api.mirai.audio
ENV_AI_PORT=4000
ENV_AI_SECRET_KEY_BASE=<64-char string>
ENV_AI_GUARDIAN_SECRET_KEY=<64-char random string>
ENV_AI_DB_POOL_SIZE=20
ENV_AI_TWITTER_CONSUMER_KEY=changeme     # Twitter OAuth Consumer Key (API Key)
ENV_AI_TWITTER_CONSUMER_SECRET=changeme  # Twitter OAuth Consumer Secret (API Secret)

To create the database schema, run migrations and start Phoenix:

# set .env file environment variables 
export $(cat .env | xargs) && \
  mix ecto.setup && \
  mix phx.server

Now you can visit localhost:4000 from your browser.

Running Tests

mix test

LICENSE

MIT

A product of (せい)(しん)(こう)() (seishinkouki) Co., Ltd

About

ai 愛(あい) — JSON API powering mirai.audio

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 95.3%
  • HTML 4.7%