Skip to content
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install Dependencies
run: bun install --frozen-lockfile

- name: Run Validation Suite
run: bun run validate
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Dependency directories
node_modules/
jspm_packages/

# OS Files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Build outputs
dist/
dist-ssr/
*.local
out/
build/

# IDEs and editors
.idea/
.vscode/
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Environment local files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# TypeScript / Bun / Cache
.tsc/
.tsbuildinfo
.bun/
60 changes: 60 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Project Guidelines & Rules (`AGENTS.md`)

This document defines the architecture, design patterns, coding standards, and submission guidelines for all developers and AI agents working on the **shumai-web** repository.

---

## 🎨 Design & Coding Rules

### 1. Technology Stack & Directory Structure
* **Runtime & Package Manager**: Bun is the standard runtime and package manager. Use `bun` commands instead of `npm`.
* **Framework**: React 19 (Functional Components, Hooks).
* **Styling**: Tailwind CSS. Keep styles clean, modern, and aligned with modern web standards (e.g., tailored color palettes, subtle shadows, transition effects, responsive design).
* **Directory Layout**:
* `src/components/`: Reusable, modular UI components.
* `src/App.tsx`: Main page layout and primary React component.
* `src/main.tsx`: React DOM mounting.
* `src/types.ts`: Shared TypeScript types.
* `assets/`: Static image/media files.

### 2. TypeScript & Code Standards
* **Strict Typing**: Avoid using `any`. Explicitly type function parameters, return values, and component props.
* **Imports**: Use ES Modules. Keep imports clean and organized. Imports are automatically structured and cleaned via Biome (`biome check`).
* **Linter & Formatter**: Biome is used for code quality, styling, and formatting. Do not use ESLint or Prettier.
* **Component Patterns**:
* Prefer functional components with Arrow Functions: `const MyComponent: React.FC<Props> = (...) => { ... }` or standard functions: `export function MyComponent(props: Props) { ... }`.
* Define props interface/type right above the component.
* Use proper React hook dependencies (no missing values, no stale closures).

### 3. Styling & Aesthetics
* **Rich UX**: Use smooth hover states (`hover:scale-[1.02]`, `transition-all duration-300`).
* **Consistent Colors**: Use curated, harmonic Tailwind color schemes. Avoid plain primary colors.
* **No Placeholders**: Use working assets, actual SVGs, or Lucide icons instead of layout placeholders.

---

## 🚀 Submit & Git Rules

### 1. Pre-Submit Checks
Before pushing any commit or submitting a pull request, you **MUST** run the validation suite locally. If any check fails, do not commit.
```bash
bun run validate
```
This script runs:
1. **Biome check**: Lints and formats all files (`biome check .`).
2. **Typecheck**: Checks TypeScript compilation (`tsc --noEmit`).
3. **Build**: Ensures the project builds successfully (`vite build`).

### 2. Commit Message Conventions
Commits must follow the **Conventional Commits** standard:
* `feat`: A new feature (e.g., `feat: add model selector dropdown`)
* `fix`: A bug fix (e.g., `fix: resolve mobile navigation overflow`)
* `chore`: Maintenance tasks (e.g., `chore: update biome dependencies`)
* `docs`: Documentation updates (e.g., `docs: update agents.md guidelines`)
* `style`: Styling or formatting changes (e.g., `style: run biome check --write`)
* `refactor`: Code restructuring without behavior changes
* `ci`: GitHub Actions configuration changes

### 3. Pull Request Requirements
* Every PR must pass the GitHub CI validation suite.
* Ensure code is clean, debug `console.log` statements are removed, and unused imports are cleaned up.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
<div align="center">
<img width="1200" height="475" alt="GHBanner" src="https://ai.google.dev/static/site-assets/images/share-ais-513315318.png" />
</div>
# shumai-web

# Run and deploy your AI Studio app
This is the website of [shumai.one](https://shumai.one).

This contains everything you need to run your app locally.
## Development

View your app in AI Studio: https://ai.studio/apps/79c24a4f-14a8-454b-ba20-49ac152bb16c
This project is built using React 19, Vite, Tailwind CSS, and TypeScript, running on the **Bun** runtime.

## Run Locally
### Setup & Local Run

**Prerequisites:** Node.js
1. **Install dependencies**:
```bash
bun install
```
2. **Configure environment**:
Set `GEMINI_API_KEY` in `.env.local`
3. **Start local development server**:
```bash
bun run dev
```

### Quality Assurance

1. Install dependencies:
`npm install`
2. Set the `GEMINI_API_KEY` in [.env.local](.env.local) to your Gemini API key
3. Run the app:
`npm run dev`
This repository uses **Biome** for formatting, linting, and import organization.
Before committing changes, make sure all validations pass:
```bash
bun run validate
```
50 changes: 50 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "off"
Comment on lines +9 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Disabling noUnusedVariables and noUnusedImports goes against the goal of standardizing code quality and formatting in a production-ready setup. Unused variables and imports can clutter the codebase and hide potential logic bugs. It is highly recommended to enable these rules.

Suggested change
"noUnusedVariables": "off",
"noUnusedImports": "off"
"noUnusedVariables": "error",
"noUnusedImports": "error"

},
"style": {
"noNonNullAssertion": "off"
},
"suspicious": {
"noArrayIndexKey": "off",
"noCommentText": "off"
},
"a11y": {
"noSvgWithoutTitle": "off",
"useValidAnchor": "off",
"useButtonType": "off"
}
}
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100,
"lineEnding": "lf"
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"trailingCommas": "all",
"semicolons": "always"
}
},
"files": {
"includes": ["**", "!**/dist", "!**/node_modules", "!**/bun.lock"]
},
"css": {
"parser": {
"tailwindDirectives": true
}
}
}
Loading
Loading