From 0ab2e5ba2b0631b28b5b1405559237b3913c878f Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Sun, 23 Mar 2025 17:11:39 +0100 Subject: feat: initialize Phoenix application for weather alerts This commit sets up the initial Silmataivas project structure, including: Phoenix web framework configuration, database models for users and locations, weather polling service, notification system, Docker and deployment configurations, CI/CD pipeline setup --- config/dev.exs | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 config/dev.exs (limited to 'config/dev.exs') diff --git a/config/dev.exs b/config/dev.exs new file mode 100644 index 0000000..2c2821e --- /dev/null +++ b/config/dev.exs @@ -0,0 +1,76 @@ +import Config + +# Database configuration is now handled in runtime.exs +# using DB_ADAPTER and DATABASE_URL environment variables +config :silmataivas, Silmataivas.Repo, show_sensitive_data_on_connection_error: true + +# OpenWeatherMap API configuration for development +config :silmataivas, :openweathermap_api_key, System.get_env("OPENWEATHERMAP_API_KEY") + +# 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. +# Binding to loopback ipv4 address prevents access from other machines. +config :silmataivas, SilmataivasWeb.Endpoint, + # Change to `ip: {0, 0, 0, 0}` to allow access from other machines. + http: [ip: {127, 0, 0, 1}, port: 4000], + check_origin: false, + code_reloader: true, + debug_errors: true, + secret_key_base: "2n9j4hR64BSG/CPD59PFf9u2obxbBtOJw2KMeJmXdQDwt4zOFyyIwWX7lamgQJhi", + watchers: [] + +# ## 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, +# keyfile: "priv/cert/selfsigned_key.pem", +# certfile: "priv/cert/selfsigned.pem" +# ], +# +# If desired, both `http:` and `https:` keys can be +# configured to run both http and https servers on +# different ports. + +# Enable dev routes for dashboard and mailbox +config :silmataivas, 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 + +# Disable swoosh api client as it is only required for production adapters. +config :swoosh, :api_client, Swoosh.ApiClient.Hackney + +config :silmataivas, Silmataivas.Mailer, + adapter: Swoosh.Adapters.AmazonSES, + access_key: System.get_env("AWS_ACCESS_KEY_ID"), + secret: System.get_env("AWS_SECRET_ACCESS_KEY"), + region: "eu-central-1" + +# Configure scheuler +config :silmataivas, Silmataivas.Scheduler, + jobs: [ + # {"0 * * * *", {Silmataivas.WeatherPoller, :check_all, []}} + {"*/5 * * * *", {Silmataivas.WeatherPoller, :check_all, []}} + ] -- cgit v1.2.3