-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[elixir] feat: add admin app #116
base: main
Are you sure you want to change the base?
Conversation
Coverage of commit
|
@paulswartz Would love initial thoughts here. |
config :ex_aws, | ||
# note: 'region' doesn't work. it's inherited from the profile | ||
# region: [{:system, "AWS_REGION"}, {:awscli, "default", 30}, :instance_role], | ||
access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, {:awscli, "default", 30}], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't need these now, but will eventually.
|
||
config :ex_aws, | ||
# overwrite defaults here, so as to only look at instance role | ||
access_key_id: :instance_role, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For RDS connection.
{Admin.Repo, []}, | ||
{Plug.Cowboy, | ||
scheme: :https, | ||
options: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: I need to move this to a config so it can be different on prod, but not sure what the best way to go about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# config/config.exs
config :admin,
cowboy_options: [ scheme: :https, ... ]
# lib/admin/application.ex
{Plug.Cowboy, Application.get_env(:admin, :cowboy_options)}
|
||
@template_dir "lib/admin/templates" | ||
|
||
plug(Plug.SSL, rewrite_on: [:x_forwarded_proto, :x_forwarded_host, :x_forwarded_port]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we still accept 'http'?
render(conn, "index.html") | ||
end | ||
|
||
get "/admin" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like Guardian w/ Keycloak. Any good implemtations to look at? MyCharlie is using it in combination with Phoenix.
@@ -0,0 +1,14 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking of using Tailwind and HTMX. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tailwind seems fine. I'd go with LiveView if you're already in the Elixir world, but I haven't heard many bad things about HTMX either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused, and unfortunately there isn't much detail in the Asana ticket.
Is this an application that a developer will run on their local machine to control the Data Platform tables? If it's expected to be deployed to AWS, then I wouldn't create a parallel application: instead I'd add Phoenix to the existing application and put a load balancer in front of it to handle HTTPS.
{Admin.Repo, []}, | ||
{Plug.Cowboy, | ||
scheme: :https, | ||
options: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# config/config.exs
config :admin,
cowboy_options: [ scheme: :https, ... ]
# lib/admin/application.ex
{Plug.Cowboy, Application.get_env(:admin, :cowboy_options)}
@@ -0,0 +1,42 @@ | |||
defmodule Admin.Schema.CubicOdsTableSnapshot do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: these are the same tables that are maintained by the main application, correct? If so, having two different applications talking to the same database is definitely an anti-pattern.
@@ -0,0 +1,14 @@ | |||
<!DOCTYPE html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tailwind seems fine. I'd go with LiveView if you're already in the Elixir world, but I haven't heard many bad things about HTMX either.
See why here: https://app.asana.com/0/1201290014466247/1206288189629556