2024-04-22 00:14:48 +00:00
|
|
|
# futureporn.net
|
2024-02-05 14:13:02 -08:00
|
|
|
|
2025-02-13 05:11:50 -08:00
|
|
|

|
|
|
|

|
2025-02-13 12:49:05 -08:00
|
|
|

|
|
|
|

|
2024-07-25 05:53:52 -08:00
|
|
|
[](https://www.jetify.com/devbox/docs/contributor-quickstart/)
|
|
|
|
|
2024-06-26 20:41:16 -08:00
|
|
|
Source Code for https://futureporn.net
|
|
|
|
|
2025-01-10 19:10:04 -08:00
|
|
|
See ./ARCHITECTURE.md for an overview of the infrastructure components.
|
2024-06-14 19:18:00 -08:00
|
|
|
|
2024-07-25 05:53:52 -08:00
|
|
|
## Getting Started
|
|
|
|
|
2025-01-16 12:23:58 -08:00
|
|
|
The main gist is as follows.
|
2024-07-25 05:53:52 -08:00
|
|
|
|
2025-01-16 12:23:58 -08:00
|
|
|
1. install [docker](https://docs.docker.com/engine/install) `wget -O- get.docker.com | bash`
|
|
|
|
1. Install [devbox](https://www.jetify.com/devbox/docs/installing_devbox/) `curl -fsSL https://get.jetify.com/devbox | bash`
|
2024-07-25 05:53:52 -08:00
|
|
|
2. Install development environment & packages using devbox.
|
|
|
|
|
|
|
|
devbox install
|
|
|
|
|
2025-01-16 12:23:58 -08:00
|
|
|
|
2025-03-05 03:03:52 -08:00
|
|
|
3. Run database and other accessories with `docker compose up --watch`
|
|
|
|
4. In another terminal, run the phoenix "bright" app with `devbox run bright:dev`
|
2025-01-16 12:23:58 -08:00
|
|
|
4. Visit http://localhost:4000
|
|
|
|
|
|
|
|
If all went well, editing source code will automatically affect the website running in your browser.
|
2024-07-25 05:53:52 -08:00
|
|
|
|
2025-01-11 04:47:23 -08:00
|
|
|
## backup/restore dev database
|
2024-07-25 05:53:52 -08:00
|
|
|
|
2025-01-11 04:47:23 -08:00
|
|
|
@see https://stackoverflow.com/a/29913462/1004931
|
2024-07-25 05:53:52 -08:00
|
|
|
|
2025-01-11 04:47:23 -08:00
|
|
|
### backup
|
|
|
|
|
|
|
|
Use devbox helper script
|
|
|
|
|
|
|
|
devbox run backup
|
|
|
|
|
|
|
|
### restore
|
|
|
|
|
|
|
|
cat ./backups/your-backup.sql | docker exec -i postgres_db psql -U postgres
|
2024-07-25 05:53:52 -08:00
|
|
|
|
|
|
|
|
2025-02-20 17:44:35 -08:00
|
|
|
## testing
|
|
|
|
|
|
|
|
there is some undesirable behavior when running tests because nektos/act mimicks github actions.
|
|
|
|
we are banned from github so we aren't using that. instead, we use gitea act_runner.
|
|
|
|
github actions Job runner runs on docker 'host' network.
|
|
|
|
gitea act_runner runs on a custom named bridge network. e.g. `GITEA-ACTIONS-TASK-974_WORKFLOW-ci_JOB-Tests-Checks-test_phoenix-network`
|
|
|
|
confusing, right? It totally is!
|
|
|
|
when we are working with gitea act_runner, we can use dns names, e.g. test-db.
|
|
|
|
when we are working with nektos/act, we must use the IP address of the service container.
|
|
|
|
WTF there must be a better way
|