Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .env.dev.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
DB_USERNAME=postgres
Comment thread
enricoprazeres marked this conversation as resolved.
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=gallium_dev
HOST_URL=http://localhost:4000
ASSET_HOST=http://localhost:4000
DB_USERNAME=postgres
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ gallium-*.tar
# In case you use Node.js/npm, you want to ignore these.
npm-debug.log
/assets/node_modules/

.env.dev
117 changes: 61 additions & 56 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,71 +105,76 @@
/* This file is for your main application CSS */

@font-face {
font-family: 'Amarante';
src: url('/fonts/Amarante/Amarante-Regular.ttf') format('truetype');
font-family: 'Roby Soho';
src: url('/fonts/RobySoho-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Cormorant Garamond';
src: url('/fonts/Cormorant/CormorantGaramond-VariableFont_wght.ttf') format('truetype');
font-family: 'Instrument Sans';
src: url('/fonts/InstrumentSans-Variable.ttf') format('truetype');
font-weight: 100 900;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Glacial Indifference";
src: url("/fonts/Glacial/GlacialIndifference-Regular.otf")
format("truetype");
@theme {
--font-amarante: "Roby Soho", serif;
--font-cormorant: "Instrument Sans", sans-serif;
--font-glacial: "Instrument Sans", sans-serif;

--color-light-muted: #EFC7C2;
--color-beige: #E7D8B5;

--color-blue: #39448B;
--color-blue-50: #F1F1F9;
--color-blue-100: #DBDCF0;
--color-blue-200: #B7BBE1;
--color-blue-300: #9397D2;
--color-blue-400: #6F74C3;
--color-blue-500: #5D67BC;
--color-blue-700: #2A3065;
--color-blue-800: #1E2348;
--color-blue-900: #111429;
--color-blue-950: #0A0B19;

--color-bronze: #7C0B2B;
--color-bronze-50: #FDEDF1;
--color-bronze-100: #F5D1DA;
--color-bronze-200: #EBA3B5;
--color-bronze-300: #E07590;
--color-bronze-400: #D6476B;
--color-bronze-500: #D31249;
--color-bronze-700: #54071D;
--color-bronze-800: #3A0514;
--color-bronze-900: #20030B;
--color-bronze-950: #140207;

--color-olive: #45503B;
--color-olive-50: #F5F6F3;
--color-olive-100: #E8EAE5;
--color-olive-200: #CDD3C8;
--color-olive-300: #B1BCAA;
--color-olive-400: #95A58B;
--color-olive-500: #7E936C;
--color-olive-700: #384130;
--color-olive-800: #262C21;
--color-olive-900: #141710;
--color-olive-950: #0B0E0A;

--color-golden: #B88B4A;
}

/* Roby Soho — títulos apenas, Regular, line-height 100% */
.font-amarante {
line-height: 1;
font-weight: 400;
font-display: swap;
}
}

@theme {
--font-amarante: "Amarante", serif;
--font-cormorant: "Cormorant Garamond", serif;
--font-glacial: "Glacial Indifference", serif;

--color-light-muted: #EEEEE5;
--color-beige: #F5F3E8;

--color-blue: #467486;
--color-blue-50: #eef4f6;
--color-blue-100: #dee9ed;
--color-blue-200: #bcd3dc;
--color-blue-300: #9bbdca;
--color-blue-400: #79a7b9;
--color-blue-500: #5891a7;
--color-blue-700: #355764;
--color-blue-800: #233a43;
--color-blue-900: #121d21;
--color-blue-950: #0c1417;

--color-bronze: #a86824;
--color-bronze-50: #fbf3ea;
--color-bronze-100: #f6e6d5;
--color-bronze-200: #edcdab;
--color-bronze-300: #e4b481;
--color-bronze-400: #db9b57;
--color-bronze-500: #d2822d;
--color-bronze-700: #7e4e1b;
--color-bronze-800: #543412;
--color-bronze-900: #2a1a09;
--color-bronze-950: #1d1206;

--color-olive: #7b8a42;
--color-olive-50: #f5f7ee;
--color-olive-100: #ebeedd;
--color-olive-200: #d7deba;
--color-olive-300: #c3cd98;
--color-olive-400: #aebd75;
--color-olive-500: #9aac53;
--color-olive-700: #5d6732;
--color-olive-800: #3e4521;
--color-olive-900: #1f2211;
--color-olive-950: #16180c;

--color-golden: #cc8235;
--color-green: #a3af71;
/* Instrument Sans — corpo/cabeçalhos, line-height ~137% */
.font-cormorant,
.font-glacial {
line-height: 1.37;
}
20 changes: 20 additions & 0 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import Config

# Auto-load .env.dev variables so they're available via System.get_env/1 below
if File.exists?(".env.dev") do
File.read!(".env.dev")
|> String.split("\n", trim: true)
|> Enum.each(fn line ->
line = String.replace_prefix(line, "export ", "")

case String.split(line, "=", parts: 2) do
["#" <> _, _] -> :ok
[key, value] when byte_size(key) > 0 -> System.put_env(String.trim(key), String.trim(value))
_ -> :ok
end
end)
end

# Configure your database
config :gallium, Gallium.Repo,
username: "postgres",
Expand Down Expand Up @@ -90,3 +105,8 @@ config :phoenix_live_view,

# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false

config :gallium, :midas,
api_key: System.get_env("GALLIUM_API_KEY") || System.get_env("PEARL_API_KEY", "dev_key"),
midas_api_url: System.get_env("MIDAS_API_URL"),
midas_api_key: System.get_env("MIDAS_API_KEY")
15 changes: 15 additions & 0 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,27 @@ config :gallium, GalliumWeb.Endpoint,
hosts: ["localhost", "127.0.0.1"]
]

config :ex_aws,
json_codec: Jason,
access_key_id: {:system, "AWS_ACCESS_KEY_ID"},
secret_access_key: {:system, "AWS_SECRET_ACCESS_KEY"},
region: {:system, "AWS_REGION"},
s3: [
scheme: "https://",
host: {:system, "ASSET_HOST"},
region: {:system, "AWS_REGION"},
access_key_id: {:system, "AWS_ACCESS_KEY_ID"},
secret_access_key: {:system, "AWS_SECRET_ACCESS_KEY"}
]

# Configure Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Req

# Disable Swoosh Local Memory Storage
config :swoosh, local: false

config :gallium, Gallium.Mailer, adapter: Swoosh.Adapters.ExAwsAmazonSES

# Do not print debug messages in production
config :logger, level: :info

Expand Down
15 changes: 15 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,25 @@ if System.get_env("PHX_SERVER") do
config :gallium, GalliumWeb.Endpoint, server: true
end

config :gallium,
from_email_name: System.get_env("FROM_EMAIL_NAME") || "Jantar de Gala",
from_email_address: System.get_env("FROM_EMAIL_ADDRESS") || "no-reply@cesium.pt"

config :gallium, GalliumWeb.Endpoint,
http: [port: String.to_integer(System.get_env("PORT", "4000"))]

if config_env() == :prod do
config :gallium, :midas,
api_key:
System.get_env("GALLIUM_API_KEY") ||
raise("environment variable GALLIUM_API_KEY is missing."),
midas_api_url:
System.get_env("MIDAS_API_URL") ||
raise("environment variable MIDAS_API_URL is missing."),
midas_api_key:
System.get_env("MIDAS_API_KEY") ||
raise("environment variable MIDAS_API_KEY is missing.")

database_url =
System.get_env("DATABASE_URL") ||
raise """
Expand Down
7 changes: 5 additions & 2 deletions lib/gallium/accounts/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defmodule Gallium.Accounts.User do
field :authenticated_at, :utc_datetime, virtual: true

has_one :attendee, Gallium.Ticketing.Attendee
has_one :ticket, Gallium.Ticketing.Ticket

timestamps(type: :utc_datetime)
end
Expand All @@ -39,8 +40,10 @@ defmodule Gallium.Accounts.User do
changeset =
changeset
|> validate_required([:email])
|> validate_format(:email, ~r/^[^@,;\s]+@[^@,;\s]+$/,
message: "must have the @ sign and no spaces"
|> validate_format(
:email,
~r/^[a-zA-Z0-9.!#$%&'*+\/=?^_{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$/,
message: "formato inválido"
)
|> validate_length(:email, max: 160)

Expand Down
Loading
Loading