Yōten: A social tracker for your language learning journey built on the atproto.

docs: add hacking and contributing docs

brookjeynes.dev 7a1ae22e 7b4371df

verified
Changed files
+163 -5
docs
internal
server
config
+1 -1
.dockerignore
··· 1 1 *.db 2 2 *.db-* 3 - jwks.json 3 + .env 4 4 fly.toml 5 5 6 6 */**/*templ.go
+1 -1
.gitignore
··· 1 1 *.db 2 2 *.db-* 3 - jwks.json 3 + .env 4 4 5 5 */**/*templ.go 6 6
+8 -2
README.md
··· 1 1 # Yōten 2 2 3 3 A social platform for tracking the essential points of your language learning. 4 - Log your study sessions, visualize your progress, and share your milestones 5 - with a community of fellow learners on the [AT Protocol](https://atproto.com). 4 + 5 + Read our [devlogs](https://yoten.leaflet.pub/). 6 + Join the [Discord](https://discord.gg/XAUWY3zvD4). 7 + 6 8 Find your focus and turn daily practice into visible results. 9 + 10 + ## docs 11 + - [contributing guide - **please read before opening a PR**](./docs/contributing.md) 12 + - [hacking on yōten](./docs/hacking.md)
+109
docs/contributing.md
··· 1 + # Contributing guide 2 + 3 + ## Commit guidelines 4 + 5 + We follow a commit style similar to the Go project. Please keep commits: 6 + 7 + - **Atomic**: Each commit should represent one logical change. 8 + - **Descriptive**: The commit message should clearly describe what the change 9 + does and why it's needed. 10 + 11 + ### Message format 12 + 13 + ``` 14 + <type>(affected system): <short summary of change> 15 + 16 + 17 + Optional longer description, if necessary. Explain what the change does and 18 + why. Reference relevant issues or PRs when applicable via links. 19 + ``` 20 + 21 + Examples 22 + 23 + ``` 24 + fix(xp): update xp when a study session is deleted 25 + ``` 26 + 27 + ``` 28 + refactor(views/edit-activity): remove page handler in favor of direct invocation 29 + ``` 30 + 31 + ### General notes 32 + 33 + - PRs get merged "as-is" (fast-forward) - like applying a patch-series using 34 + `git am`. There is no squashing so please author your commits as they would 35 + appear on `master`, following the above guidelines. 36 + - Keep commits lowercased with no trailing period. 37 + - Use the imperative mood in the summary line (e.g., "fix bug" not "fixed bug" 38 + or "fixes bug"). 39 + - Try to keep the summary line under 72 characters. 40 + - Follow the same formatting for PR titles if filled manually. 41 + - Don't include unrelated changes in the same commit. 42 + - Avoid noisy commit messages like "wip" or "final fix". Rewrite history before 43 + submitting if necessary. 44 + 45 + ## Code formatting 46 + 47 + Format templates and code before submitting for final review. 48 + ``` 49 + go tool templ fmt ./internal/server/views/ && go fmt ./... 50 + ``` 51 + 52 + ## Proposals for bigger changes 53 + 54 + Small fixes like typos, minor bugs, or trivial refactors can be submitted 55 + directly as PRs. 56 + 57 + For larger changes—especially those introducing new features, significant 58 + refactoring, or altering system behavior—please open a proposal first. This 59 + helps us evaluate the scope, design, and potential impact before 60 + implementation. 61 + 62 + ### Proposal format 63 + 64 + Create a new issue titled: 65 + 66 + ``` 67 + proposal: <affected scope>: <summary of change> 68 + ``` 69 + 70 + In the description, explain: 71 + 72 + - What the change is 73 + - Why it's needed 74 + - How you plan to implement it (roughly) 75 + - Any open questions or tradeoffs 76 + 77 + We'll use the issue thread to discuss and refine the idea before moving 78 + forward. 79 + 80 + ## Developer certificate of origin (DCO) 81 + 82 + We require all contributors to certify that they have the right to submit the 83 + code they're contributing. To do this, we follow the [Developer Certificate of 84 + Origin (DCO)](https://developercertificate.org/). 85 + 86 + By signing your commits, you're stating that the contribution is your own work, 87 + or that you have the right to submit it under the project's license. This helps 88 + us keep things clean and legally sound. 89 + 90 + To sign your commit, just add the `-s` flag when committing: 91 + 92 + ```sh 93 + git commit -s -m "your commit message" 94 + ``` 95 + 96 + This appends a line like: 97 + 98 + ``` 99 + Signed-off-by: Your Name <your.email@example.com> 100 + ``` 101 + 102 + We won't merge commits if they aren't signed off. If you forget, you can amend 103 + the last commit like this: 104 + 105 + ```sh 106 + git commit --amend -s 107 + ``` 108 + 109 + If you're submitting a PR with multiple commits, make sure each one is signed.
+43
docs/hacking.md
··· 1 + # Hacking guide 2 + 3 + ## Required tools 4 + - [tailwind-cli](https://tailwindcss.com/docs/installation/tailwind-cli) 5 + - [templ](https://templ.guide/quick-start/installation) 6 + 7 + ## Running yōten 8 + 9 + To authenticate, you will need OAUTH JWKs to be setup: 10 + ```bash 11 + go build -o genjwks.out ./cmd/genjwks 12 + export YOTEN_OAUTH_JWKS="$(./genjwks.out)" 13 + ``` 14 + 15 + You will need to fetch a series of static assets yōten depends on: 16 + ```bash 17 + mkdir -p ./static/files 18 + 19 + # HTMX 20 + curl -sLo ./static/files/htmx.min.js https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js 21 + # Lucide (icons) 22 + curl -sLo ./static/files/lucide.min.js https://unpkg.com/lucide@0.525.0/dist/umd/lucide.min.js 23 + # AlpineJS 24 + curl -sLo ./static/files/alpinejs.min.js https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js 25 + # Toast components 26 + curl -sLo ./static/files/htmx-toaster.min.js https://unpkg.com/htmx-toaster@0.0.20/dist/htmx-toaster.min.js 27 + ``` 28 + 29 + To run: 30 + ```bash 31 + YOTEN_DEV=true go run cmd/server/main.go 32 + ``` 33 + 34 + If you modified the views, you will need to regenerate them: 35 + ```bash 36 + go tool templ generate 37 + go tool templ fmt ./internal/server/views/ 38 + ``` 39 + 40 + If you modified the tailwind styles, you will need to regenerate the css: 41 + ```bash 42 + tailwindcss -i ./input.css -o ./static/files/style.css 43 + ```
+1 -1
internal/server/config/config.go
··· 7 7 ) 8 8 9 9 type CoreConfig struct { 10 - CookieSecret string `env:"COOKIE_SECRET,required"` 10 + CookieSecret string `env:"COOKIE_SECRET, default=00000000000000000000000000000000"` 11 11 DbPath string `env:"DB_PATH, default=web.db"` 12 12 Port string `env:"PORT, default=8080"` 13 13 Host string `env:"HOST, default=https://yoten.app"`