|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to AI Coding Agents(Claude Code, Codex, etc) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Android Dagashi is a Nuxt 3-based static site that aggregates and displays Android development news and resources. The site uses GitHub Issues as a CMS, fetching data via GitHub API and generating static pages. |
| 8 | + |
| 9 | +## Architecture |
| 10 | + |
| 11 | +### Monorepo Structure (Yarn Workspaces) |
| 12 | + |
| 13 | +- **packages/site** - Main Nuxt 3 application with Vue 3, Tailwind CSS |
| 14 | +- **packages/site-api** - Generates JSON API files from GitHub Issues |
| 15 | +- **packages/site-api-github** - GitHub API integration layer |
| 16 | +- **packages/site-rss** - RSS feed generation |
| 17 | +- **packages/sns-updater** - Social media update automation |
| 18 | +- **packages/site-config** - Shared configuration |
| 19 | +- **packages/site-types** - TypeScript type definitions |
| 20 | +- **packages/site-common** - Shared utilities |
| 21 | + |
| 22 | +### Key Technologies |
| 23 | + |
| 24 | +- **Frontend**: Nuxt 3, Vue 3, Tailwind CSS, Pinia (state management) |
| 25 | +- **Build**: Yarn 4 with workspaces, TypeScript, ESLint, Prettier |
| 26 | +- **Deployment**: GitHub Actions → GitHub Pages (master branch) |
| 27 | + |
| 28 | +## Essential Commands |
| 29 | + |
| 30 | +```bash |
| 31 | +# Initial setup (requires mise and direnv) |
| 32 | +make bootstrap |
| 33 | + |
| 34 | +# Development workflow |
| 35 | +yarn install # Install all dependencies |
| 36 | +yarn api:generate # Fetch GitHub issues and generate JSON API files |
| 37 | +yarn rss:generate # Generate RSS feed |
| 38 | +yarn site:dev # Start dev server at localhost:3000 |
| 39 | +yarn site:generate # Build static site for production |
| 40 | + |
| 41 | +# Code quality |
| 42 | +yarn site:lint # Run ESLint |
| 43 | +yarn site:format # Fix ESLint issues |
| 44 | + |
| 45 | +# Social media |
| 46 | +yarn sns:update # Update social media with new content |
| 47 | +``` |
| 48 | + |
| 49 | +## Development Requirements |
| 50 | + |
| 51 | +1. **Environment Setup**: |
| 52 | + - Copy `envrc.template` to `.envrc` |
| 53 | + - Add GitHub Personal Access Token to `GH_READONLY_TOKEN` in `.envrc` |
| 54 | + - Install direnv and allow the `.envrc` file |
| 55 | + |
| 56 | +2. **Prerequisites**: |
| 57 | + - Node.js (managed via mise) |
| 58 | + - Yarn 4 (via corepack) |
| 59 | + - GitHub Personal Access Token (read-only permissions sufficient) |
| 60 | + |
| 61 | +## Data Flow |
| 62 | + |
| 63 | +1. GitHub Issues in AndroidDagashi/AndroidDagashi repo serve as CMS |
| 64 | +2. `yarn api:generate` fetches issues via GitHub API and creates JSON files in `packages/site/public/api/` |
| 65 | +3. Nuxt reads these JSON files during build to generate static pages |
| 66 | +4. Static site deployed to GitHub Pages on master branch |
| 67 | + |
| 68 | +## Configuration Files |
| 69 | + |
| 70 | +- **nuxt.config.ts** - Main Nuxt configuration, defines routes from JSON data |
| 71 | +- **site-config** package - Shared configuration across workspaces |
| 72 | +- **mise.toml** - Node.js version management |
| 73 | +- **.yarnrc.yml** - Yarn 4 configuration with PnP mode |
| 74 | + |
| 75 | +## Deployment |
| 76 | + |
| 77 | +GitHub Actions workflow (`.github/workflows/deploy.yml`): |
| 78 | + |
| 79 | +- Triggers on push to development branch |
| 80 | +- Builds static site with `nuxi build --preset github_pages` |
| 81 | +- Deploys to master branch for GitHub Pages hosting |
| 82 | + |
| 83 | +## Important Patterns |
| 84 | + |
| 85 | +- All API data must be generated before running dev server or building |
| 86 | +- The site uses static generation with pre-rendered routes based on issue IDs |
| 87 | +- Custom OGP meta tag generation for social sharing |
| 88 | +- TypeScript strict mode is enabled across all packages |
0 commit comments