aprs.me/config/dev.exs
Graham McIntire 7dc6c616a2
Bundle all vendor JavaScript files locally instead of loading from CDNs
This change eliminates all external CDN dependencies by bundling JavaScript
libraries locally using esbuild. All vendor files are now served from the
application's own assets, improving reliability and privacy.

Changes:
- Created assets/js/vendor.js to bundle all external libraries
- Added vendor bundle configuration to esbuild in config files
- Updated all templates to use local vendor.js instead of CDN scripts
- Created download-vendor-files.sh script to fetch vendor libraries
- Added vendor files to .gitignore (they're downloaded during setup)
- Updated CSS imports to include vendor stylesheets
- Added vendor build step to assets.deploy mix task

Bundled libraries:
- Leaflet 1.9.4 (mapping library)
- Leaflet.heat 0.2.0 (heatmap plugin)
- Leaflet.markercluster 1.5.3 (marker clustering)
- OverlappingMarkerSpiderfier 0.2.6 (overlapping marker handling)
- Chart.js 4.5.0 (charting library)
- chartjs-adapter-date-fns 3.0.0 (date adapter for Chart.js)

All functionality tested and working correctly with local bundles.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 09:52:39 -05:00

121 lines
3.7 KiB
Elixir

import Config
# Configure your database
config :aprsme, Aprsme.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 use it
# with esbuild to bundle .js and .css sources.
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "aprsme_dev",
stacktrace: true,
show_sensitive_data_on_connection_error: true,
# Optimized pool settings for development (increased from 15)
pool_size: 30,
pool_timeout: 10_000,
timeout: 30_000,
queue_target: 100,
queue_interval: 1_000,
# log: :debug,
log: false,
types: Aprsme.PostgresTypes,
# Use unnamed prepared statements for better development flexibility
prepare: :unnamed,
# Socket options for better performance
socket_options: [
keepalive: true,
nodelay: true
],
# Development-specific parameters matching PostgreSQL config
parameters: [
application_name: "aprsme_dev",
work_mem: "16MB",
statement_timeout: "60s"
]
config :aprsme, AprsmeWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
adapter: Bandit.PhoenixAdapter,
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
secret_key_base: "Vv8Uh9w7tSoac1wBo7A8MyTSE9J+RzNeAzPTGcsW2InUBHpPBgt1dACJrIZorfdH",
watchers: [
esbuild:
{Esbuild, :install_and_run,
[
:default,
~w(--sourcemap=inline --watch --loader:.ts=ts)
]},
esbuild_vendor:
{Esbuild, :install_and_run,
[
:vendor,
~w(--sourcemap=inline --watch)
]},
tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
]
# Watch static and templates for browser reloading.
config :aprsme, AprsmeWeb.Endpoint,
live_reload: [
web_console_logger: true,
patterns: [
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/temp_web/(?:controllers|live|components|router)/?.*\.(ex|heex)$"
]
]
# Enable dev routes for dashboard and mailbox
#
# Run `mix help phx.gen.cert` for more information.
config :aprsme, dev_routes: true
# Mailer configuration for development
# Using Swoosh.Adapters.Local from config.exs which stores emails locally
# Access sent emails at http://localhost:4000/dev/mailbox
# Configure Hammer for development environment
config :hammer,
backend: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}
# Do not include metadata nor timestamps in development logs
#
# The `http:` config above can be replaced with:
#
# https: [
config :logger, :console, format: "[$level] $message\n"
# Initialize plugs at runtime for faster development compilation
# port: 4001,
# cipher_suite: :strong,
# keyfile: "priv/cert/selfsigned_key.pem",
config :phoenix, :plug_init_mode, :runtime
# Set a higher stacktrace during development. Avoid configuring such
# certfile: "priv/cert/selfsigned.pem"
# Disable swoosh api client as it is only required for production adapters.
# in production as building large stacktraces may be expensive.
# different ports.
# ],
#
# If desired, both `http:` and `https:` keys can be
# configured to run both http and https servers on
config :phoenix, :stacktrace_depth, 20
# Configure Sentry for development (disabled by default)
config :sentry,
environment_name: :dev,
enable_source_code_context: true,
root_source_code_paths: [File.cwd!()],
before_send: {Aprsme.SentryFilter, :before_send}
config :swoosh, :api_client, false