GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — api/apps/api_accounts/README.md at master · mbta/api

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
64 lines (48 loc) · 1.32 KB
/

README.md

Copy path

File metadata and controls

64 lines (48 loc) · 1.32 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

ApiAccounts

Manages API accounts and API keys

Defining a Schema

Look at ApiAccounts.Table for full details on how create a schema for a table.

defmodule User do
  use ApiAccounts.Table

  table "users" do
    field :email, :string, primary_key: true
    field :name, :string
    field :active, :boolean, default: true
    schema_version 1
  end
end

Setting Up DynamoDB Local

Make sure you have Colima and Docker installed and configured and then run:

docker compose up

Once DynamoDB is running, you can create a new admin user:

  • Run the server in interactive shell:
    iex -S mix phx.server
    
  • In the shell,
    • create User table:
      ApiAccounts.Dynamo.create_table(ApiAccounts.User)
      
    • create Key table:
      ApiAccounts.Dynamo.create_table(ApiAccounts.Key)
      
    • create a new user:
      ApiAccounts.create_user(%{email: "[email protected]", password: "test", role: "administrator"})
      

Installation

To use in another OTP app in this umbrella project

  1. Add api_accounts to your list of dependencies in mix.exs

    def deps do [{:api_accounts, in_umbrella: true}] end

  2. Ensure api_accounts is started before your application:

    def application do [applications: [:api_accounts]] end

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.