Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(none): 📖 refine readme #19

Merged
merged 6 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dev.vars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TURNSTILE_SECRET_KEY=xxxxxx
[email protected]
RESEND_API_KEY=xxxxxx
LOCAL_DB_PATH=.wrangler\\state\\v3\\d1\\miniflare-D1DatabaseObject\\xxxxxx.sqlite
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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
66 changes: 65 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,76 @@ 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

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: `<type>(<scope>): 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/"