Compare commits
4 Commits
8c3e7b3ee8
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 643b252a17 | |||
| 851794ba44 | |||
| 0a30fda9a4 | |||
| b2ef39df76 |
53
README.md
@ -9,13 +9,19 @@ Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
|
||||
|
||||
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
|
||||
|
||||
# Configure for deployment environment
|
||||
|
||||
Replace beetround.example.com in prod.exs for "url" & "check_origin"
|
||||
|
||||
TODO: verify that "url" replacement in config.exs ins't necessary (should be overruled by prod.exs, right?)
|
||||
|
||||
# Deployment on new uberspace asteroid
|
||||
|
||||
## Initial deployment
|
||||
|
||||
### Add subdomain
|
||||
|
||||
uberspace web domain add beetround.example.com
|
||||
`uberspace web domain add beetround.example.com`
|
||||
|
||||
### Init database
|
||||
|
||||
@ -24,57 +30,58 @@ https://lab.uberspace.de/guide_postgresql/
|
||||
|
||||
#### Configure database
|
||||
|
||||
createuser beetround_admin -P
|
||||
`createuser beetround_admin -P`
|
||||
|
||||
createdb --encoding=UTF8 --owner=beetround_admin --template=template0 beetround_server
|
||||
`createdb --encoding=UTF8 --owner=beetround_admin --template=template0 beetround_server`
|
||||
|
||||
## Configure Elixir/Phoenix
|
||||
|
||||
uberspace tools version use erlang 27
|
||||
`uberspace tools version use erlang 27`
|
||||
|
||||
## Build & run BeetRound
|
||||
|
||||
cd ~/
|
||||
`cd ~/`
|
||||
|
||||
mkdir develop
|
||||
`mkdir develop`
|
||||
|
||||
git clone https://git.working-copy.org/bent/BeetRoundServer.git
|
||||
`git clone https://git.working-copy.org/bent/BeetRoundServer.git`
|
||||
|
||||
cd develop
|
||||
`cd develop`
|
||||
|
||||
export MIX_ENV=prod
|
||||
`export MIX_ENV=prod`
|
||||
|
||||
mix deps.get
|
||||
`mix deps.get`
|
||||
|
||||
mix phx.gen.secret
|
||||
`mix phx.gen.secret`
|
||||
|
||||
export SECRET_KEY_BASE=<SECRET_KEY>
|
||||
`export SECRET_KEY_BASE=<SECRET_KEY>`
|
||||
|
||||
export DATABASE_URL=ecto://beetround_admin:<DB_PASSWORD>@localhost/beetround_server
|
||||
`export DATABASE_URL=ecto://beetround_admin:<DB_PASSWORD>@localhost/beetround_server`
|
||||
|
||||
mix assets.deploy #throws "'mix tailwind beet_round_server --minify' exited with 1" error
|
||||
`mix assets.deploy` #throws "'mix tailwind beet_round_server --minify' exited with 1" error
|
||||
|
||||
Workaround: copy assets from develop machine
|
||||
|
||||
mix compile
|
||||
`mix compile`
|
||||
|
||||
PHX_HOST=beetround.example.com PORT=4005 mix ecto.migrate
|
||||
`PHX_HOST=beetround.example.com PORT=4005 mix ecto.migrate`
|
||||
|
||||
### Create webbackend
|
||||
|
||||
uberspace web backend set beetround.example.com --http --port 4005
|
||||
`uberspace web backend set beetround.example.com --http --port 4005`
|
||||
|
||||
#### Test backend
|
||||
|
||||
PHX_HOST=beetround.example.com PORT=4005 mix phx.server
|
||||
`PHX_HOST=beetround.example.com PORT=4005 mix phx.server`
|
||||
|
||||
#### Create mix release
|
||||
|
||||
mix release
|
||||
`mix release`
|
||||
|
||||
### Create service
|
||||
|
||||
nvim ~/etc/services.d/beetround_server.ini
|
||||
Create service file:
|
||||
`~/etc/services.d/beetround_server.ini:`
|
||||
|
||||
```
|
||||
[program:beetround_server]
|
||||
@ -94,11 +101,11 @@ environment =
|
||||
SECRET_KEY_BASE=<SECRET_KEY>
|
||||
```
|
||||
|
||||
supervisorctl reread
|
||||
`supervisorctl reread`
|
||||
|
||||
supervisorctl update
|
||||
`supervisorctl update`
|
||||
|
||||
supervisorctl status
|
||||
`supervisorctl status`
|
||||
|
||||
## Updates (TODO old content. needs to be adjusted/checked)
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
Server zum Sammeln der digital abgegeben Gebote.
|
||||
</p>
|
||||
|
||||
<%= if true do %>
|
||||
<br />
|
||||
<a
|
||||
href={~p"/biddings"}
|
||||
@ -28,7 +27,6 @@
|
||||
>
|
||||
Zu meinen Geboten
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
<div class="flex">
|
||||
<div class="w-full sm:w-auto">
|
||||
|
||||
@ -10,7 +10,7 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
|
||||
~H"""
|
||||
<Layouts.app flash={@flash} current_scope={@current_scope}>
|
||||
<.header>
|
||||
{@page_title}
|
||||
{@page_title} ({@current_scope.user.email})
|
||||
<:subtitle>Bitte gib hier den Betrag ein, den Du monatlich bezahlen willst.</:subtitle>
|
||||
</.header>
|
||||
<%= if @bidding.bidding_round == 0 do %>
|
||||
@ -20,46 +20,58 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
|
||||
</footer>
|
||||
<% else %>
|
||||
<.form for={@form} id="bidding-form" phx-change="validate" phx-submit="save">
|
||||
<.input field={@form[:amount]} type="number" label="Betrag" />
|
||||
<.input
|
||||
field={@form[:depot_wish_one]}
|
||||
type="select"
|
||||
label="Depot Wunsch 1"
|
||||
options={[
|
||||
{"", ""},
|
||||
{"KlimaWerkStadt (1)", "KlimaWerkStadt"},
|
||||
{"Puramila (2)", "Puramila"},
|
||||
{"Eine Welt Aktion (3)", "Eine Welt Aktion"},
|
||||
{"Hof Buntentor (4)", "Hof Buntentor"},
|
||||
{"Mädchen-Kulturhaus (5)", "Mädchen-Kulturhaus"},
|
||||
{"neues Depot im Viertel (6)", "neues Depot im Viertel"},
|
||||
{"Creative Hub (7)", "Creative Hub"},
|
||||
{"Klimazone (8)", "Klimazone"},
|
||||
{"Garage Walle (9)", "Garage Walle"},
|
||||
{"Hof Riede (A)", "Hof Riede"},
|
||||
{"Thedinghausen (B)", "Thedinghausen"}
|
||||
]}
|
||||
/>
|
||||
<.input
|
||||
field={@form[:depot_wish_two]}
|
||||
type="select"
|
||||
label="Depot Wunsch 2"
|
||||
options={[
|
||||
{"", ""},
|
||||
{"KlimaWerkStadt (1)", "KlimaWerkStadt"},
|
||||
{"Puramila (2)", "Puramila"},
|
||||
{"Eine Welt Aktion (3)", "Eine Welt Aktion"},
|
||||
{"Hof Buntentor (4)", "Hof Buntentor"},
|
||||
{"Mädchen-Kulturhaus (5)", "Mädchen-Kulturhaus"},
|
||||
{"neues Depot im Viertel (6)", "neues Depot im Viertel"},
|
||||
{"Creative Hub (7)", "Creative Hub"},
|
||||
{"Klimazone (8)", "Klimazone"},
|
||||
{"Garage Walle (9)", "Garage Walle"},
|
||||
{"Hof Riede (A)", "Hof Riede"},
|
||||
{"Thedinghausen (B)", "Thedinghausen"}
|
||||
]}
|
||||
/>
|
||||
<.input field={@form[:bidding_round]} type="number" readonly hidden />
|
||||
<p>
|
||||
Wenn du für einen halben Anteil bietest, orientiere dich bitte an einen Richtwert von 56 €.
|
||||
</p>
|
||||
<br />
|
||||
<p><b>Bietrunde: {@bidding.bidding_round}</b></p>
|
||||
<%= if @bidding.bidding_round == 1 do %>
|
||||
<.input field={@form[:amount]} type="number" label="Betrag/Monat" />
|
||||
<.input
|
||||
field={@form[:depot_wish_one]}
|
||||
type="select"
|
||||
label="Depot Wunsch 1"
|
||||
options={[
|
||||
{"", ""},
|
||||
{"Puramila (1)", "Puramila"},
|
||||
{"Eine Welt Aktion (2)", "Eine Welt Aktion"},
|
||||
{"KlimaWerkStadt (3)", "KlimaWerkStadt"},
|
||||
{"Buntentorsteinweg 231, Abholschrank (4)", "Buntentorsteinweg 231, Abholschrank"},
|
||||
{"Klimazone (5)", "Klimazone"},
|
||||
{"Hof von bude e.V., Abholschrank(6)", "Hof von bude e.V., Abholschrank"},
|
||||
{"Lagerhaus, Abholschrank (7)", "Lagerhaus, Abholschrank"},
|
||||
{"KARL, Abholschrank (8)", "KARL, Abholschrank"},
|
||||
{"Hof Riede (A)", "Hof Riede"},
|
||||
{"Thedinghausen (B)", "Thedinghausen"},
|
||||
{"Achim (Planung ab April) (C)", "Achim"}
|
||||
]}
|
||||
/>
|
||||
<.input
|
||||
field={@form[:depot_wish_two]}
|
||||
type="select"
|
||||
label="Depot Wunsch 2"
|
||||
options={[
|
||||
{"", ""},
|
||||
{"Puramila (1)", "Puramila"},
|
||||
{"Eine Welt Aktion (2)", "Eine Welt Aktion"},
|
||||
{"KlimaWerkStadt (3)", "KlimaWerkStadt"},
|
||||
{"Buntentorsteinweg 231, Abholschrank (4)", "Buntentorsteinweg 231, Abholschrank"},
|
||||
{"Klimazone (5)", "Klimazone"},
|
||||
{"Hof von bude e.V., Abholschrank(6)", "Hof von bude e.V., Abholschrank"},
|
||||
{"Lagerhaus, Abholschrank (7)", "Lagerhaus, Abholschrank"},
|
||||
{"KARL, Abholschrank (8)", "KARL, Abholschrank"},
|
||||
{"Hof Riede (A)", "Hof Riede"},
|
||||
{"Thedinghausen (B)", "Thedinghausen"},
|
||||
{"Achim (Planung ab April) (C)", "Achim"}
|
||||
]}
|
||||
/>
|
||||
<.input field={@form[:bidding_round]} type="hidden" readonly />
|
||||
<% else %>
|
||||
<.input field={@form[:amount]} type="number" label="Betrag/Monat" />
|
||||
<.input field={@form[:depot_wish_one]} type="hidden" readonly />
|
||||
<.input field={@form[:depot_wish_two]} type="hidden" readonly />
|
||||
<.input field={@form[:bidding_round]} type="hidden" readonly />
|
||||
<% end %>
|
||||
<footer>
|
||||
<.button phx-disable-with="Bearbeitung..." variant="primary">Gebot abgeben</.button>
|
||||
<.button navigate={return_path(@current_scope, @return_to, @bidding)}>Abbrechen</.button>
|
||||
@ -96,15 +108,33 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
|
||||
defp apply_action(socket, :new, _params) do
|
||||
current_round = BiddingRoundFacade.get_current_round()
|
||||
|
||||
bidding = %Bidding{
|
||||
user_id: socket.assigns.current_scope.user.id,
|
||||
bidding_round: current_round
|
||||
}
|
||||
current_bidding = Biddings.get_most_recent_bidding(socket.assigns.current_scope)
|
||||
|
||||
socket
|
||||
|> assign(:page_title, "Neues Gebot")
|
||||
|> assign(:bidding, bidding)
|
||||
|> assign(:form, to_form(Biddings.change_bidding(socket.assigns.current_scope, bidding)))
|
||||
case current_bidding do
|
||||
nil ->
|
||||
bidding = %Bidding{
|
||||
user_id: socket.assigns.current_scope.user.id,
|
||||
bidding_round: current_round
|
||||
}
|
||||
|
||||
socket
|
||||
|> assign(:page_title, "Neues Gebot")
|
||||
|> assign(:bidding, bidding)
|
||||
|> assign(:form, to_form(Biddings.change_bidding(socket.assigns.current_scope, bidding)))
|
||||
|
||||
%Bidding{} ->
|
||||
bidding = %Bidding{
|
||||
user_id: socket.assigns.current_scope.user.id,
|
||||
bidding_round: current_round,
|
||||
depot_wish_one: current_bidding.depot_wish_one,
|
||||
depot_wish_two: current_bidding.depot_wish_two
|
||||
}
|
||||
|
||||
socket
|
||||
|> assign(:page_title, "Neues Gebot")
|
||||
|> assign(:bidding, bidding)
|
||||
|> assign(:form, to_form(Biddings.change_bidding(socket.assigns.current_scope, bidding)))
|
||||
end
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 15 KiB |
BIN
priv/static/favicon-16x16-95aa891154156d09d23a5ee8ee9f0fb1.png
Normal file
|
After Width: | Height: | Size: 791 B |
BIN
priv/static/favicon-32x32-3ca765f2920b1d0ae0f6b5107dd043a3.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
priv/static/favicon-3559b2855f4d8d5997d4f6752de495ca.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 791 B |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
priv/static/images/favicon-3559b2855f4d8d5997d4f6752de495ca.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
5
priv/static/robots-c9e52225d69203eceb967fc6fad66420.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
||||
#
|
||||
# To ban all spiders from the entire site uncomment the next two lines:
|
||||
User-agent: *
|
||||
Disallow: /
|
||||