Add Styler

This commit is contained in:
2025-01-27 14:44:09 +01:00
parent c5b01954d7
commit df1b84d5f4
34 changed files with 198 additions and 193 deletions

View File

@@ -7,46 +7,23 @@
# General application configuration
import Config
config :tradex, Oban,
engine: Oban.Engines.Basic,
notifier: Oban.Notifiers.Postgres,
queues: [default: 10],
repo: Tradex.Repo
config :tradex,
ecto_repos: [Tradex.Repo],
generators: [timestamp_type: :utc_datetime]
# Configures the endpoint
config :tradex, TradexWeb.Endpoint,
url: [host: "localhost"],
adapter: Bandit.PhoenixAdapter,
render_errors: [
formats: [html: TradexWeb.ErrorHTML, json: TradexWeb.ErrorJSON],
layout: false
],
pubsub_server: Tradex.PubSub,
live_view: [signing_salt: "i4cu1T7m"]
# Configures the mailer
#
# By default it uses the "Local" adapter which stores the emails
# locally. You can see the emails in your browser, at "/dev/mailbox".
#
# For production it's recommended to configure a different adapter
# at the `config/runtime.exs`.
config :tradex, Tradex.Mailer, adapter: Swoosh.Adapters.Local
# Configure esbuild (the version is required)
config :esbuild,
version: "0.17.11",
tradex: [
args:
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
args: ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason
# Configure tailwind (the version is required)
config :tailwind,
version: "3.4.3",
@@ -59,14 +36,36 @@ config :tailwind,
cd: Path.expand("../assets", __DIR__)
]
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
config :tradex, Oban,
engine: Oban.Engines.Basic,
notifier: Oban.Notifiers.Postgres,
queues: [default: 10],
repo: Tradex.Repo
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason
# Configures the mailer
#
# By default it uses the "Local" adapter which stores the emails
# locally. You can see the emails in your browser, at "/dev/mailbox".
#
# For production it's recommended to configure a different adapter
# at the `config/runtime.exs`.
config :tradex, Tradex.Mailer, adapter: Swoosh.Adapters.Local
# Configures the endpoint
config :tradex, TradexWeb.Endpoint,
url: [host: "localhost"],
adapter: Bandit.PhoenixAdapter,
render_errors: [
formats: [html: TradexWeb.ErrorHTML, json: TradexWeb.ErrorJSON],
layout: false
],
pubsub_server: Tradex.PubSub,
live_view: [signing_salt: "i4cu1T7m"]
config :tradex,
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
ecto_repos: [Tradex.Repo],
generators: [timestamp_type: :utc_datetime]
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"

View File

@@ -1,24 +1,59 @@
import Config
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime
# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20
config :phoenix_live_view,
# Include HEEx debug annotations as HTML comments in rendered markup
debug_heex_annotations: true,
# Enable helpful, but potentially expensive runtime checks
enable_expensive_runtime_checks: true
# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false
# Configure your database
config :tradex, Tradex.Repo,
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we can use it
# ## SSL Support
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "tradex_dev",
stacktrace: true,
# to bundle .js and .css sources.
#
# In order to use HTTPS in development, a self-signed
show_sensitive_data_on_connection_error: true,
pool_size: 10
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we can use it
# to bundle .js and .css sources.
config :tradex, TradexWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# certificate can be generated by running the following
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
# Mix task:
#
# mix phx.gen.cert
#
# Run `mix help phx.gen.cert` for more information.
#
# The `http:` config above can be replaced with:
#
# https: [
# port: 4001,
# cipher_suite: :strong,
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: false,
code_reloader: true,
@@ -29,21 +64,7 @@ config :tradex, TradexWeb.Endpoint,
tailwind: {Tailwind, :install_and_run, [:tradex, ~w(--watch)]}
]
# ## SSL Support
#
# In order to use HTTPS in development, a self-signed
# certificate can be generated by running the following
# Mix task:
#
# mix phx.gen.cert
#
# Run `mix help phx.gen.cert` for more information.
#
# The `http:` config above can be replaced with:
#
# https: [
# port: 4001,
# cipher_suite: :strong,
# Watch static and templates for browser reloading.
# keyfile: "priv/cert/selfsigned_key.pem",
# certfile: "priv/cert/selfsigned.pem"
# ],
@@ -52,7 +73,6 @@ config :tradex, TradexWeb.Endpoint,
# configured to run both http and https servers on
# different ports.
# Watch static and templates for browser reloading.
config :tradex, TradexWeb.Endpoint,
live_reload: [
patterns: [
@@ -64,22 +84,3 @@ config :tradex, TradexWeb.Endpoint,
# Enable dev routes for dashboard and mailbox
config :tradex, dev_routes: true
# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20
# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime
config :phoenix_live_view,
# Include HEEx debug annotations as HTML comments in rendered markup
debug_heex_annotations: true,
# Enable helpful, but potentially expensive runtime checks
enable_expensive_runtime_checks: true
# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false

View File

@@ -1,20 +1,21 @@
import Config
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix assets.deploy` task,
# which you should run after static files are built and
# before starting your production server.
config :tradex, TradexWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
# Configures Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Tradex.Finch
# Disable Swoosh Local Memory Storage
config :swoosh, local: false
# Do not print debug messages in production
config :logger, level: :info
# Configures Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Tradex.Finch
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# Disable Swoosh Local Memory Storage
# manifest is generated by the `mix assets.deploy` task,
# which you should run after static files are built and
# before starting your production server.
config :swoosh, local: false
config :tradex, TradexWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
# Runtime production configuration, including reading
# of environment variables, is done on config/runtime.exs.

View File

@@ -30,12 +30,6 @@ if config_env() == :prod do
maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
config :tradex, Tradex.Repo,
# ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
socket_options: maybe_ipv6
# The secret key base is used to sign/encrypt cookies and other secrets.
# A default value is used in config/dev.exs and config/test.exs but you
# want to use a different value for prod and you most likely don't want
@@ -51,7 +45,11 @@ if config_env() == :prod do
host = System.get_env("PHX_HOST") || "example.com"
port = String.to_integer(System.get_env("PORT") || "4000")
config :tradex, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
config :tradex, Tradex.Repo,
# ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
socket_options: maybe_ipv6
config :tradex, TradexWeb.Endpoint,
url: [host: host, port: 443, scheme: "https"],
@@ -65,6 +63,8 @@ if config_env() == :prod do
],
secret_key_base: secret_key_base
config :tradex, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
# ## SSL Support
#
# To get SSL working, you will need to add the `https` key

View File

@@ -1,35 +1,8 @@
import Config
config :tradex, Oban, testing: :manual
# Only in tests, remove the complexity from the password hashing algorithm
config :bcrypt_elixir, :log_rounds, 1
# Configure your database
#
# The MIX_TEST_PARTITION environment variable can be used
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :tradex, Tradex.Repo,
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "tradex_test#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: System.schedulers_online() * 2
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :tradex, TradexWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
secret_key_base: "pP8HLCaUfsAaCuJWdmHExGTUqj83ZvuIvjiWhCcXZx/FeGvxTukgbhirVEby/WHn",
server: false
# In test we don't send emails
config :tradex, Tradex.Mailer, adapter: Swoosh.Adapters.Test
# Disable swoosh api client as it is only required for production adapters
config :swoosh, :api_client, false
# Print only warnings and errors during test
config :logger, level: :warning
@@ -39,3 +12,31 @@ config :phoenix, :plug_init_mode, :runtime
# Enable helpful, but potentially expensive runtime checks
config :phoenix_live_view,
enable_expensive_runtime_checks: true
# Disable swoosh api client as it is only required for production adapters
config :swoosh, :api_client, false
# Configure your database
#
# The MIX_TEST_PARTITION environment variable can be used
config :tradex, Oban, testing: :manual
# In test we don't send emails
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :tradex, Tradex.Mailer, adapter: Swoosh.Adapters.Test
config :tradex, Tradex.Repo,
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "tradex_test#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox,
# We don't run a server during test. If one is required,
# you can enable the server option below.
pool_size: System.schedulers_online() * 2
config :tradex, TradexWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
secret_key_base: "pP8HLCaUfsAaCuJWdmHExGTUqj83ZvuIvjiWhCcXZx/FeGvxTukgbhirVEby/WHn",
server: false