API for a web application that enables users to create flashcards that support markdown and code snippets.
Demo version available here (it may take a minute to load).
React frontend using this API can be found here.
-
Install dependencies:
mix deps.get
-
You will need to run your own local Postgres database and to fill out the database configuration in
config/dev.exs
accordingly. -
Create and migrate your database:
mix ecto.steup
-
You will need to run a frontend locally using the instructions here.
-
This app uses OAuth for user authentication. You will need to create your own OAuth app for either Google or Github.
-
Create a root-level
.env
file that contains the following credentials:export GOOGLE_CLIENT_ID=your_google_client_id export GOOGLE_CLIENT_SECRET=your_google_client_secret export GITHUB_CLIENT_ID=your_github_client_id export GITHUB_CLIENT_SECRET=your_github_client_secret # must match exactly the URL of your local frontend export ALLOWED_ORIGIN_URL=your_frontend_url
-
Source your
.env
file so that the server process can read it:source .env
-
Start the Phoenix server:
mix phx.server
mix run priv/repo/database_seeder.exs
mix test