diff --git a/.dev.vars.example b/.dev.vars.example new file mode 100644 index 00000000..f52b91d7 --- /dev/null +++ b/.dev.vars.example @@ -0,0 +1,4 @@ +TURNSTILE_SECRET_KEY=xxxxxx +MY_CUSTOM_EMAIL_ADDRESS=xxxxxx@xxxxxx.xxx +RESEND_API_KEY=xxxxxx +LOCAL_DB_PATH=.wrangler\\state\\v3\\d1\\miniflare-D1DatabaseObject\\xxxxxx.sqlite diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..a2f50392 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +UNSPLASH_API_ACCESS_KEY=xxxxxx +PUBLIC_TURNSTILE_SITE_KEY=xxxxxx +CLOUDFLARE_ACCOUNT_ID=xxxxxx +D1_DB_ID=xxxxxx +D1_DB_API_TOKEN=xxxxxx diff --git a/README.md b/README.md index 852c2c48..68806993 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,12 @@ A website where Nagi, just another engineer & creator, posts his work and writin - [Textlint](https://textlint.github.io/): The pluggable linting tool for text and markdown - **Git hooks manager:** - [Lefthook](https://github.com/evilmartians/lefthook): A polyglot Git hooks manager +- **Email sender:** + - [Resend](https://resend.com/docs/introduction): A simple email API for developers -## Ready, set, go! +## Ready, Set, Go! + +This section is a memo for myself assuming there are other project members or contributers. ### Prerequisites @@ -59,3 +63,63 @@ You need to: - install [VSCode](https://code.visualstudio.com/) on your local machine - install [the Remote Development extension](https://github.com/Microsoft/vscode-remote-release) in your VSCode editor + +> [!IMPORTANT] +> You can also start coding without them, but need to install required packages and libraries in your local in that case. + +### The Dev Workflow + +This project adopts Issue-driven Development. + +> [!NOTE] +> Issue-driven Development is a dev process where: +> - developers are always supposed to create a Github issue first whenever starting coding +> - issues are associated with specific branches one-to-one, in which development proceeds +> - After peer code reviews and passing your team's conventional rules, changes are finally merged into the main branch + +1. On [the issue page](https://github.com/brklntmhwk/younagi.dev/issues), create an issue + - Preferably add a label that matches the purpose of your issue + - In your issue, clarify the following points + - The purpose + - As-is + - To-be +2. Select "Create a branch for this issue or link a pull request" to create a branch for your issue + - e.g., "18-refine-readme" for an issue #18 to refine the README doc +3. In your local dev environment, execute `git switch -c [[the branch name]]` + - If you haven't had a clone of this project, execute `git clone https://github.com/brklntmhwk/younagi.dev.git` first + - In a real project run by a team, fork this project first via [the Github repo](https://github.com/brklntmhwk/younagi.dev) and then clone it + - Hereafter, you're supposed to be at the project root +4. Execute `git pull origin [[the branch name]]` to keep your local up to date +5. Start coding! + 1. [Setup](#setup-for-coding) + 2. Open the VSCode command palette + 3. Select "Dev Containers: Reopen Container" + - It starts rebuilding the container if needed + - It might take longer the first time + 4. [Setup](#setup-for-coding) +6. After you're finished coding, execute `git add .` > `git cz`, add commit info answering prompts, and then execute `git push origin [[the branch name]]` +7. Go to [the project's repo](https://github.com/brklntmhwk/younagi.dev) and create a pull request for changes you've made + - The title of pull requests must be in this format: `(): detailed descriptions here...` + - Check the changelog config or dangerfile for allowed types & scopes + - e.g., "feat(ui): 🆕 add a likes button" + - In your pull request, clarify the following points: + - Changes + - Checklist +8. Fix your code over the course of peer code review on an as-needed basis + - Once the whole team gives you the green light, changes you've made will be merged into the main branch +9. Confirm if the merge is done without any problem and then delete the remote branch from [this page](https://github.com/brklntmhwk/younagi.dev/branches) + - Execute `git switch main` > `git branch -d [[the branch name]]` to delete the one in local + +### Setup for coding + +#### Outside the container + +1. Create `.env` and `.env.vars` at the root + - see `.env.example` and `.env.vars.example` for reference, respectively + - At this moment, you can't set the `LOCAL_DB_PATH` var yet + +#### Inside the container + +1. Set the `LOCAL_DB_PATH` var looking up the dir ".wrangler/state/v3/d1/miniflare-D1DatabaseObject/" +2. Run `bun dev --host` to start the dev server +3. Go to "http://localhost:4321/"