Skip to content
Draft
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: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"rules": {
"@next/next/no-img-element": "off",
"react/no-unescaped-entities": "off",
"eqeqeq": "warn"
"eqeqeq": "warn",
"react/jsx-no-comment-textnodes": "off",
"react/no-unknown-property": "off"
}
}
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn install
- run: yarn lint
117 changes: 98 additions & 19 deletions AGENT.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,104 @@
# AGENT.md - Hack Club Site Development Guide
# AGENT.md — Happy Hacking Space Main Site (`site/`)

This is the main website for **Happy Hacking Space (HHS)** deployed to `happyhacking.space`. It is a Next.js 15 application using the Pages Router.

## Commands
- **Dev**: `yarn dev` (start development server)
- **Build**: `yarn build` (production build)
- **Lint**: `yarn lint` (Next.js ESLint)
- **Format**: `yarn format` (Prettier formatting)
- **Start**: `yarn start` (production server)
- **Test**: No test framework configured

All commands must be run from within the `site/` directory:

```bash
cd site/
yarn install # install dependencies (uses yarn, not npm)
yarn dev # start development server (localhost:3000)
yarn build # production build
yarn start # start production server
yarn lint # Next.js ESLint
yarn format # Prettier formatting
yarn analyze # bundle analysis (ANALYZE=true)
```

## Technology Stack

- **Framework**: Next.js 15 (Pages Router), React 19
- **Styling**: Theme UI (`theme-ui`), Emotion (`@emotion/react`, `@emotion/styled`), some `styled-components`
- **UI Components**: Hack Club icons (`@hackclub/icons`), custom components in `components/`
- **Content**: MDX via `@next/mdx` and `@mdx-js/loader`
- **Animation**: `animejs`, `framer-motion`, `vanilla-tilt`, `react-snowfall`, `react-tsparticles`, Three.js / `@react-three/fiber`
- **Bundle Optimization**: `million/compiler` (Million.js), `next-transpile-modules`
- **Data Fetching**: `swr`, `axios`
- **Analytics**: Plausible Analytics

## Code Style
- **Imports**: Use relative imports (`../components/nav`), Theme UI components (`{ Box, Text }`)
- **Formatting**: Single quotes, no semicolons, no trailing commas, 80 char width
- **Components**: Functional components with destructured props, default exports
- **Styling**: Theme UI `sx` prop for styling, styled components with @emotion/styled
- **Types**: TypeScript enabled but strict mode off, prefer implicit typing
- **Naming**: camelCase for variables/functions, PascalCase for components

- **Formatter**: Prettier with these settings:
- `singleQuote: true`
- `trailingComma: 'none'`
- `semi: false`
- `arrowParens: 'avoid'`
- `printWidth: 80`
- **Linting**: ESLint (`next/core-web-vitals`), with these overrides:
- `@next/next/no-img-element`: off
- `react/no-unescaped-entities`: off
- `eqeqeq`: warn
- **Types**: TypeScript is enabled but strict mode is off. Prefer implicit typing.
- **Imports**: Use relative imports for local modules (`../components/nav`). Use named imports from Theme UI (`{ Box, Text }`).
- **Components**: Functional components with destructured props, default exports for pages.
- **Naming**: `camelCase` for variables/functions, `PascalCase` for components.

## Architecture
- Next.js app with pages/ directory structure
- MDX support for content pages
- Theme UI for consistent styling with Hack Club theme
- Components in components/ directory, modular cards in components/index/cards/
- Static assets in public/
- Configuration in next.config.mjs includes essential redirects/rewrites

### Directory Structure

- `pages/` — Next.js pages (file-system routing). Each `.js`/`.tsx` file is a route.
- `pages/_app.js` — Custom app wrapper
- `pages/_document.js` — Custom document
- `pages/api/` — API routes
- `components/` — Reusable React components. Some subdirectories group related components (e.g., `components/index/cards/`).
- `hooks/` — Custom React hooks
- `lib/` — Utility functions and shared logic
- `languages/` — i18n translation files (English, Turkish, Korean)
- `public/` — Static assets served at root path
- `middleware.js` — Next.js Edge Middleware (handles geolocation for `/slack` routes)

### Notable Patterns

- **i18n**: Custom lightweight i18n system with `localStorage` persistence and IP-based locale detection (`ipapi.co`). Translation files live in `languages/`.
- **Redirects / Rewrites**: `next.config.mjs` contains extensive legacy path redirects, subdomain rewrites, and proxies to external Vercel apps (e.g., `/workshops/`, `/map/`, `/letters/`).
- **Middleware**: `middleware.js` sets a `continent` cookie based on the user's country via `country-list-js` for `/slack` routes.
- **Shared Packages**: Consumes `@happyhackingspace/theme`, `@happyhackingspace/meta`, `@happyhackingspace/banner`, `@happyhackingspace/markdown` from the `theme/` workspace.

## Environment Variables

The site may require a `.env.local` file for local development. Key variables (check `.env.local` if present):

- API keys for external services (GitHub, SendGrid, OpenAI, Mapbox, Airtable, etc.)
- Analytics configuration

`.env.local` is gitignored. Do not commit secrets.

## Testing

**No test framework is configured.** Testing is done via:
- Manual testing in dev mode
- `yarn lint` for static analysis
- Vercel preview deployments

## Deployment

- **Host**: Vercel
- **CI**: `.github/workflows/ci.yml` runs `yarn lint` on push/PR
- **Dependabot**: Weekly npm updates configured in `.github/dependabot.yml`

## Security Notes

- Never commit `.env.local` or any secrets
- Some pages use `dangerouslySetInnerHTML` — ensure content is sanitized
- The `markdown` package from `@happyhackingspace/markdown` does not use `rehype-sanitize` (it is commented out in the pipeline)

## Working with This Project

- When adding new pages, place them in `pages/` with the appropriate file name for the route
- When adding new components, place them in `components/` or an appropriate subdirectory
- Use Theme UI's `sx` prop for styling when possible
- Keep components modular and reusable
- Respect existing patterns in the codebase
8 changes: 7 additions & 1 deletion components/arcade/showcase/project-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ const ProjectEditForm = ({ project }) => {
<Text>Screenshot link (required)</Text>
<Text variant="caption">
Demo your work! Post an image in{' '}
<a href="https://hackclub.slack.com/archives/C016DEDUL87" target="_blank">#cdn</a>{' '}
<a
href="https://hackclub.slack.com/archives/C016DEDUL87"
target="_blank"
rel="noopener noreferrer"
>
#cdn
</a>{' '}
on Slack and paste the link here.
</Text>
<Input
Expand Down
32 changes: 16 additions & 16 deletions components/bin/footer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading