Server implementation for kemoner.club
frontend is purely stateless and depends on backend for data storage and retrieval, as well as user session data.
Database schemas may be found in apps/backend/lib/database/*.ex
The actual migrations may be found in apps/backend/priv/repo/migrations/*.exs
Most HTML templates outside of the live editor are stored in apps/frontend/lib/frontend_web/controllers/page_html
Any login/authentication related code is stored in apps/frontend/lib/frontend_web/controllers/auth_*
Any RSS related code is stored in apps/frontend/lib/frontend_web/controllers/rss_controller.ex
The editor template and code is stored in apps/frontend_web/live/
All site endpoints may be found in apps/frontend_web/router.ex
Static files are stored in apps/frontend_web/priv/static
- Ensure that you have both Elixir and Erlang fully installed
- Clone this repo and navigate to the folder
- Run
mix deps.getto fetch necessary dependencies
Note: This is not acceptable practice in production
-
Install postgresql and start the service
-
Create a new superuser named
kemoner_clubusing psql:
CREATE USER kemoner_club WITH PASSWORD 'kemoner_club';
ALTER USER kemoner_club WITH SUPERUSER;Alternatively, use the built-in postgres user and adjust config/dev.exs accordingly.
- Run
./initialize.shin thekemoner_clubfolder to start the database and perform necessary migrations.
This may also be run to restart the state of the database at any time during development.
- Run
iex -S mix phx.serverto start an IEX shell and run the server - The server can be found at http://localhost:4000/
- Authentication emails can be found at http://localhost:4000/dev/mailbox
- To help with development, some functions have been added to
iex:create_user(email_address): Adds a user with a given email address. In a development environment, this really can be anything at all.
No email will actually be sent except to the dev mailbox.
Production instances should only be run as fully compiled mix releases. More to come on this.