|
1 | | -# Basilic |
| 1 | +# Basilic: Web3 & AI App Starters |
2 | 2 |
|
3 | | -TypeScript monorepo with REST API architecture. |
| 3 | +Full-stack monorepo starter for Web3 and AI applications. |
4 | 4 |
|
| 5 | +> 🚧 **Active development** — Explore, fork, and contribute. 🏗️ |
5 | 6 |
|
| 7 | +## Features |
6 | 8 |
|
| 9 | +- 🤖 **AI-first dev workflow** — Optimized Cursor rules, skills, MCP integrations (ShadcnUI, Supabase, V0, GitHub), and automated CodeRabbit reviews. |
| 10 | +- 🔌 **REST API & JWT** — OpenAPI spec, Swagger UI, JWT auth for all clients. |
| 11 | +- 📦 **SDK generation** — Type-safe clients from OpenAPI via HeyAPI. |
| 12 | +- 🧩 **Web3 & AI starters** — Ready-to-use templates for Next.js, React, Expo, Fastify, and Ponder. |
| 13 | +- 🔓 **Zero vendor lock-in** — Run on VPS, AWS, Vercel, or local. |
| 14 | +- 🎨 **Turbo monorepo + design system** — ShadcnUI components with shared utilities. |
| 15 | +- ⚙️ **Preconfigured dev tools** — Biome, Git workflows, hooks, and security checks. |
| 16 | +- 🛡️ **Security & quality** — Automated checks in CI (e.g. Gitleaks, OSV). |
| 17 | +- ⛓️ **Multichain** — EVM, Solana, Cosmos; tooling and smart contract dev environments. |
| 18 | +- 📐 **Conventions** — Cursor rules per domain, @repo/sentry, Pino logging, shared TS and style. |
| 19 | +- 🧑💻 **TypeScript-first** — End-to-end types from database to frontend. |
7 | 20 |
|
8 | | -``` |
| 21 | +## Technology stack |
9 | 22 |
|
10 | | -## Quick Start |
11 | | -
|
12 | | -```bash |
13 | | -pnpm install |
14 | | -pnpm dev |
15 | | -``` |
16 | | - |
17 | | -## Commands |
18 | | - |
19 | | -### Development |
20 | | -- `pnpm dev` - Start all apps in development mode (see [Development Workflow](#development-workflow)) |
21 | | -- `pnpm build` - Build all apps and packages |
22 | | -- `pnpm lint` - Lint all code (Biome + ESLint) |
23 | | -- `pnpm lint:fix` - Auto-fix lint issues (Biome + ESLint) |
24 | | -- `pnpm format` - Format all code (Biome) |
25 | | -- `pnpm checktypes` - Type check all TypeScript |
26 | | -- `pnpm test` - Run all tests |
27 | | -- `pnpm qa` - Quality assurance: install dependencies, lint, type-check, build, and test everything |
28 | | - |
29 | | -## Development Workflow |
30 | | - |
31 | | -### Turborepo Setup |
32 | | - |
33 | | -This monorepo uses **Turborepo** for task orchestration and caching. Turborepo provides: |
34 | | - |
35 | | -- **Intelligent caching** - Only rebuilds what changed |
36 | | -- **Parallel execution** - Runs independent tasks simultaneously |
37 | | -- **Task dependencies** - Ensures correct build order |
38 | | -- **Remote caching** - Share cache across team and CI/CD |
39 | | - |
40 | | -### `pnpm dev` - Development Mode |
41 | | - |
42 | | -The `pnpm dev` command starts all development servers with watch mode: |
43 | | - |
44 | | -```bash |
45 | | -pnpm dev |
46 | | -``` |
47 | | - |
48 | | -This runs: |
49 | | -- **`@repo/core`** - Watches for OpenAPI changes and regenerates API client |
50 | | -- **`@repo/react`** - Watches for OpenAPI changes and regenerates React hooks, watches TypeScript for rebuilds |
51 | | -- **`@repo/sentry`** - Watches TypeScript for rebuilds |
52 | | -- **`@repo/utils`** - Watches TypeScript for rebuilds |
53 | | -- **`@repo/fastify`** - Starts Fastify API server with OpenAPI generation watcher |
54 | | -- **`@repo/next`** - Starts Next.js development server |
55 | | - |
56 | | -**Key Features:** |
57 | | -- **Watch mode** - All packages automatically rebuild when source files change |
58 | | -- **OpenAPI regeneration** - `core` and `react` packages watch for OpenAPI spec changes and regenerate clients |
59 | | -- **Hot reload** - Next.js and Fastify support hot module replacement |
60 | | - |
61 | | -### `pnpm qa` - Quality Assurance |
62 | | - |
63 | | -The `pnpm qa` command runs a complete quality check: |
64 | | - |
65 | | -```bash |
66 | | -pnpm qa |
67 | | -``` |
68 | | - |
69 | | -This executes: |
70 | | -1. **`pnpm i`** - Install/update dependencies |
71 | | -2. **`turbo run checktypes`** - Type-check all packages |
72 | | -3. **`pnpm lint:fix`** - Auto-fix linting (ESLint + Biome) |
73 | | -4. **`pnpm build`** - Build all packages (excluding contracts) |
74 | | -5. **`turbo run test`** - Test all packages (excluding contracts) |
75 | | - |
76 | | -**Use Cases:** |
77 | | -- Before committing changes |
78 | | -- Before opening a pull request |
79 | | -- In CI/CD pipelines |
80 | | -- When verifying the entire codebase |
81 | | - |
82 | | -### Running Individual Apps |
83 | | - |
84 | | -You can run individual apps directly, but remember to build dependencies first: |
85 | | - |
86 | | -```bash |
87 | | -# Build required packages |
88 | | -pnpm build --filter=@repo/core --filter=@repo/react --filter=@repo/sentry --filter=@repo/utils |
89 | | - |
90 | | -# Then run the app |
91 | | -cd apps/next |
92 | | -pnpm dev |
93 | | -``` |
94 | | - |
95 | | -See individual app READMEs (e.g., `apps/next/README.md`) for app-specific instructions. |
96 | | - |
97 | | -### Security |
98 | | -- `pnpm secrets:scan:staged` - Scan staged files for secrets (gitleaks) |
99 | | -- `pnpm secrets:scan` - Scan entire repository for secrets (gitleaks) |
100 | | -- `pnpm deps:osv` - Scan dependencies for vulnerabilities (OSV Scanner) |
101 | | -- `pnpm deps:audit` - Run pnpm audit for dependency vulnerabilities |
102 | | - |
103 | | -## CI/CD Workflows |
104 | | - |
105 | | -GitHub Actions workflows automate quality checks: |
106 | | - |
107 | | -### Lint Workflow (`.github/workflows/lint.yml`) |
108 | | - |
109 | | -Runs on all pull requests to ensure code quality: |
110 | | -- Executes `pnpm lint` (Biome + ESLint) |
111 | | -- Catches linting errors before merge |
112 | | -- Can be manually triggered via `workflow_dispatch` |
113 | | - |
114 | | -### Security Workflow (`.github/workflows/security.yml`) |
115 | | - |
116 | | -Runs on all pull requests and pushes to main: |
117 | | -- **Secret scanning** - Scans repository with gitleaks and TruffleHog |
118 | | -- **Dependency scanning** - Checks for vulnerabilities with OSV Scanner and pnpm audit |
119 | | -- **Git history scan** - Scans entire git history for exposed secrets |
120 | | -- All checks must pass for CI to succeed |
121 | | - |
122 | | -See [Security Guide](@apps/docu/content/docs/security/index.mdx) for complete details. |
123 | | - |
124 | | -## Structure |
125 | | - |
126 | | -- **`apps/`** - Applications (API, Web, Docs) |
127 | | -- **`packages/`** - Shared packages (core, react, ui, utils) |
128 | | -- **`tools/`** - Shared development tooling (eslint, typescript configs) |
| 23 | +- **AI:** AI SDK, OpenAI, Claude, Grok |
| 24 | +- **Frontend:** Next.js 16, React 19, Tailwind, ShadcnUI |
| 25 | +- **Backend:** Fastify, PostgreSQL, Supabase |
| 26 | +- **Web3:** Solidity, Viem, Wagmi, Ponder, Solana |
| 27 | +- **DevOps:** pnpm, TurboRepo, TypeScript, Biome, ESLint |
129 | 28 |
|
130 | 29 | ## Documentation |
131 | 30 |
|
132 | | -Full documentation: [https://basilic-docs.vercel.app/docs](https://basilic-docs.vercel.app/docs) |
133 | | - |
134 | | -### Get Started |
135 | | -- [Getting Started](@apps/docu/content/docs/development/index.mdx) - 15-minute setup guide |
136 | | -- [AI-Driven Development](@apps/docu/content/docs/development/ai-workflow.mdx) - Recommended workflow with Cursor |
137 | | - |
138 | | -### Architecture |
139 | | -- [Monorepo Structure](@apps/docu/content/docs/architecture/monorepo.mdx) - Package organization |
140 | | -- [API Development](@apps/docu/content/docs/architecture/api.mdx) - REST API with OpenAPI and client generation |
141 | | -- [Portability Strategy](@apps/docu/content/docs/architecture/portability.mdx) - Zero vendor lock-in |
142 | | - |
143 | | -### Guides |
144 | | -- [Development Tooling](@apps/docu/content/docs/development/dev-tooling.mdx) - Turborepo setup, pnpm dev, and pnpm qa workflows |
145 | | -- [Security Guide](@apps/docu/content/docs/architecture/security.mdx) - Security baseline and secret scanning |
146 | | -- [Error Handling Guide](@apps/docu/content/docs/architecture/error-handling.mdx) - Error handling with Sentry integration |
147 | | -- [Deployment Guide](@apps/docu/content/docs/deployment/index.mdx) - Deployment options and strategies |
148 | | -- [Publishing Guide](@apps/docu/content/docs/deployment/publishing.mdx) - Publishing packages to npm |
149 | | - |
150 | | -### Cursor Setup |
151 | | -- [Cursor Setup Guide](@apps/docu/content/docs/development/cursor-setup.mdx) - Configure IDE and MCP servers |
| 31 | +Full docs: [basilic-docs.vercel.app](https://basilic-docs.vercel.app/docs) |
152 | 32 |
|
153 | | -### Deep Dives |
154 | | -- [Architecture](@apps/docu/content/docs/architecture/index.mdx) - Architecture overview |
0 commit comments