|
1 | | -# README |
2 | | - |
3 | | -This README would normally document whatever steps are necessary to get the |
4 | | -application up and running. |
5 | | - |
6 | | -Things you may want to cover: |
7 | | - |
8 | | -* Ruby version |
9 | | - |
10 | | -* System dependencies |
11 | | - |
12 | | -* Configuration |
13 | | - |
14 | | -* Database creation |
15 | | - |
16 | | -* Database initialization |
17 | | - |
18 | | -* How to run the test suite |
19 | | - |
20 | | -* Services (job queues, cache servers, search engines, etc.) |
21 | | - |
22 | | -* Deployment instructions |
23 | | - |
24 | | -* ... |
| 1 | +# Hackorum |
| 2 | + |
| 3 | +Rails 8 app backed by Postgres. Use the Docker-based development setup below for a quick start; production deploy lives under `deploy/` with its own `README`. |
| 4 | + |
| 5 | +Live application is available at https://hackorum.dev |
| 6 | + |
| 7 | +## Development (Docker) |
| 8 | +1) Copy the sample env and adjust as needed: |
| 9 | +```bash |
| 10 | +cp .env.development.example .env.development |
| 11 | +``` |
| 12 | +2) Build and start the stack (web + Postgres): |
| 13 | +```bash |
| 14 | +docker compose -f docker-compose.dev.yml up --build |
| 15 | +``` |
| 16 | +* App: http://localhost:3000 |
| 17 | +* Postgres: localhost:15432 (user/password: hackorum/hackorum by default) |
| 18 | +* Emails sent by the application use `letter_opener`, will be opened by the browser automatically |
| 19 | +* If you run into a Postgres data-dir warning, clear the old volume: `docker volume rm hackorum_db-data` |
| 20 | + |
| 21 | +Useful commands: |
| 22 | +* Shell: `docker compose -f docker-compose.dev.yml exec web bash` |
| 23 | +* Rails console: `docker compose -f docker-compose.dev.yml exec web bin/rails console` |
| 24 | +* Migrations/seeds: `docker compose -f docker-compose.dev.yml exec web bin/rails db:prepare` |
| 25 | +* Tests: `docker compose -f docker-compose.dev.yml exec web bundle exec rspec` |
| 26 | + |
| 27 | +Makefile shortcuts: |
| 28 | +* `make dev` / `make dev-detach` / `make down` |
| 29 | +* `make shell` / `make console` / `make logs` |
| 30 | +* `make test` |
| 31 | +* `make db-migrate` / `make db-reset` |
| 32 | +* `make psql` |
| 33 | + |
| 34 | +Optional IMAP worker (off by default): |
| 35 | +```bash |
| 36 | +docker compose -f docker-compose.dev.yml --profile imap up --build |
| 37 | +``` |
| 38 | +Configure IMAP via `.env.development` (`IMAP_USERNAME`, `IMAP_PASSWORD`, `IMAP_MAILBOX_LABEL`, `IMAP_HOST`, `IMAP_PORT`, `IMAP_SSL`). |
| 39 | +Shortcut: `make imap` |
| 40 | + |
| 41 | +Host, Port and ssl settings default to the gmail imap server. |
| 42 | + |
| 43 | +The imap worker will connect to the specified imap, fetch all messages with the given label, import them to the database, and mark them as "read" on the server. |
| 44 | +It should point to a label subscribed to the pg-hackers list. |
| 45 | +It can't be INBOX, it has to be a specific label. |
| 46 | + |
| 47 | +## Production |
| 48 | +See `deploy/README.md` for the single-host Docker Compose deployment (Puma + Caddy + Postgres + backups). |
0 commit comments