@aksh_npm/firstbase
v0.0.1
Published
A small CLI for scaffolding React or Next.js projects with a theme-first baseline.
Maintainers
Readme
Firstbase
CLI scaffold for starting a React or Next.js app with a production-oriented Tailwind foundation.
What it does
- Creates a new project folder from an interactive prompt
- Supports
Next.jsandReact + Vite - Targets the current stable React 19 and Next.js 16 lines
- Writes a Tailwind theme, starter page, and shared CSS variables
- Adds optional shadcn-ready component wiring
- Adds an optional Husky pre-commit hook
- Writes a minimal Axios client with a response interceptor
- Generates
.env.localand.env.example - Generates a production
.gitignore - Adds Prettier with import sorting
- Adds a GitHub Actions CI workflow with dependency audit
- Adds a PR-only GitHub Dependency Review workflow
- Adds an optional Socket Security workflow when
SOCKET_SECURITY_API_KEYandSOCKET_ORGare configured in GitHub - Generates a production
.gitignorewith build, cache, log, editor, and env entries - Offers a fast default setup or an advanced mode with React Query, SEO metadata, tests, and language support
- Advanced mode can also add auth scaffolding, validated forms, a toast system, and an i18n language switcher
- Generates a stack-aware README inside the created app so the selected tech choices are documented automatically
- Includes a version manifest in the generated app README so installed package versions are visible after setup
- Generates
docs/production-setup.mdinside each app with package versions, selected modules, quality commands, and integration steps - Adds secure defaults for project-name validation, env placeholders, secret file ignores, Axios timeouts, Next.js security headers, and release guardrails
- Generates a Vite alias config for React so shadcn-style imports work in the browser too
- Uses animated CLI step messages
Install
npx @aksh_npm/firstbase@latestIf you are developing this package locally:
npm install
npm run build
npm run startUsage
Run the CLI and answer the prompts:
npx @aksh_npm/firstbaseThe prompts let you choose:
- Project name
- Framework:
React (Vite)orNext.js - Language:
JavaScriptorTypeScript - Next.js routing:
App RouterorPages Router - UI library:
NoneorShadcn UI - Husky pre-commit hook: on or off
- Advanced setup:
Skip extra setuporGo advanced - Advanced mode extras:
- React Query
- Auth scaffold
- Forms stack
- Toast system
- Language support
- SEO metadata for Next.js
- Test setup
Generated foundation
The theme setup writes:
tailwind.config.jsortailwind.config.tsapp/globals.cssfor Next.js App Routerstyles/globals.cssfor Next.js Pages Routersrc/index.cssfor React + Vite- a starter page that uses Tailwind utility classes immediately
- a floating dark/light theme toggle on the starter page
The optional shadcn setup writes:
components.jsoncomponents/ui/button,components/ui/card,components/ui/badge,components/ui/input,components/ui/label,components/ui/textarea, andcomponents/ui/separatorlib/utilsorsrc/lib/utils
The optional Husky setup writes:
prepareandcheckscripts in the generatedpackage.json.husky/pre-commit- a pre-commit quality gate that runs
npm run check - no network calls in the default hook
The API client writes:
lib/api.jsorlib/api.tsfor Next.jssrc/lib/api.jsorsrc/lib/api.tsfor React + Vitelib/env.jsorlib/env.tsfor Next.jssrc/lib/env.jsorsrc/lib/env.tsfor React + Vite- a basic response interceptor that redirects
401responses to/login - a 15 second timeout
- same-origin request enforcement for the configured API instance
.env.localand.env.examplewith the API base URL variable
The formatting and CI setup writes:
.prettierrc.cjs.prettierignore.github/workflows/ci.yml.github/workflows/socket.yml.nvmrcand.node-versionpinned to Node20.19.0eslint.config.mjsfor Next.js projectsnext.config.*with baseline security headers for Next.js projectsformatandformat:checkscripts in the generatedpackage.jsoncheckscript in the generatedpackage.json.gitignore
The advanced setup can additionally write:
query-clientandProvidersfor React Queryauthprovider and demo auth panelcontact-formscaffold built with React Hook Form and Zodtoast-demoscaffold andsonnerwiringi18nprovider and language switcher- homepage feature sections that appear based on the advanced selections
vitest.config.*,test/setup.*, and a sample component test- selected-module tests for auth and forms when those modules are enabled
- SEO metadata for Next.js App Router or Pages Router
The generated app also receives:
docs/production-setup.md- a package version manifest tailored to the selected setup
- integration steps for env setup, local development, tests, Husky, CI, and production builds
Notes
- The generator now writes starter content with real Tailwind classes so the build does not start from an empty content scan.
- The API client now validates the env value before creating Axios, so a missing URL fails fast with a clear error.
- Prettier is configured to sort imports consistently.
- Generated projects include a production
.gitignoreand an initial README note about the first commit being prepared. - The CLI now animates the major scaffold steps, not just the intro banner.
- The generator keeps the fast path short and only asks advanced questions when you choose
Go advanced. - The advanced flow now includes auth, forms, toast, and language prompts in addition to React Query, SEO, and tests.
- The generated homepage now visibly shows the selected advanced sections.
- The generated homepage now includes an interactive showcase for auth, forms, and toasts.
- The generated app README is tailored to the selected stack, features, and layout.
- React + Vite projects now get a runtime
@alias invite.config.*plus matching shadcn alias config. - React projects target React
19.2.5; Next.js projects target Next.js16.2.4and React19.2.5. - Next.js 16 uses Turbopack by default, and the generator uses
eslint .instead of the removednext lintcommand. - Direct CLI package dependencies are pinned exactly, and generated app install commands use exact versions with
--save-exact. - Generated CI runs
npm audit --audit-level=high; Husky does not run audit so commits do not trigger network calls. - Generated GitHub Dependency Review runs in its own pull-request workflow so push CI does not show a skipped dependency-review step. It passes with a plain log message until GitHub dependency graph support is enabled for the repository.
- Generated Socket Security workflow always runs a preflight job, skips cleanly when the Socket token is not configured, and requires the repository variable
SOCKET_ORGto contain the Socket organization slug. - npm publishing is guarded by CI-only release workflow checks, npm provenance, dry-run package inspection, and release checksums.
- The CLI does not collect telemetry.
- The CLI refuses to scaffold into a non-empty folder so stale files do not leak into new runs.
- The CLI now prints a friendly error instead of a raw stack trace when setup fails.
- If you want a clean fresh generation, delete the output folder and rerun the CLI.
Development
npm install
npm run buildThe compiled binary is written to dist/bin/firstbase.js.
