From 9104f0ee5aba7c18fb3e4f748daec24ba07af398 Mon Sep 17 00:00:00 2001 From: Echo Date: Sun, 18 May 2025 16:51:33 -0400 Subject: [PATCH] better docs --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c0cdd15..d887948 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ $ cp .env.example .env Edit your `.env` file to include the following: -``` +```env # Database configurations - these work with the Docker setup DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_development WAKATIME_DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_development @@ -29,27 +29,32 @@ ENCRYPTION_DETERMINISTIC_KEY=32characterrandomstring12345678902 ENCRYPTION_KEY_DERIVATION_SALT=16charssalt1234 ``` +Comment out the `LOOPS_API_KEY` for the local letter opener, otherwise the app will try to send out a email and fail. ## Build & Run the project -``` + +```sh $ docker compose run --service-ports web /bin/bash # Now, setup the database using: app# bin/rails db:create db:schema:load db:seed -# Now you're inside docker & you can do all the fun rails things... -app# bin/rails s -b 0.0.0.0 # this hosts the server on your computer w/ default port 3000 +# Now start up the app: +app# bin/rails s -b 0.0.0.0 +# This hosts the server on your computer w/ default port 3000 + +# Want to do other things? app# bin/rails c # start an interactive irb! app# bin/rails db:migrate # migrate the database ``` You can now access the app at http://localhost:3000/ -Use email authentication from the homepage with test@example.com (you can view emails at http://localhost:3000/letter_opener)! +Use email authentication from the homepage with `test@example.com` or create a new user (you can view outgoing emails at http://localhost:3000/letter_opener)! Ever need to setup a new database? -``` +```sh # inside the docker container, reset the db app# $ bin/rails db:drop db:create db:migrate db:seed ```