Getting Started
CRAX (Create React App Xtended) is a lightweight React framework built on Vite. It's a Next.js alternative that brings back the simplicity of Create React App. This guide takes you from zero to a running app in a couple of minutes.
Prerequisites
- Node.js 18 or higher
- pnpm (recommended) or npm/yarn
Create your app
This scaffolds a new directory called my-app with the complete Crax starter project.
Start the dev server
Your app is now running at http://localhost:5173.
Project structure
Conventions
- Import aliases. Always use
@/for src imports.@/components/Buttonnot../../components/Button. The alias is preconfigured intsconfig.json. - Centralize stores. Put stores in
src/stores/. Single file for small projects, separate files per feature for larger ones. Don't scattercreateStorecalls across page files. - Don't remove modules unnecessarily. The framework is minimal. Keep
.crax/modules unless they cause build errors or you genuinely don't use them. - Configure via
crax.config.mjs. Image sizes, OG settings, PWA options — all go in config, not framework source.
Add a new page
Create src/pages/about.tsx:
Navigate to /about and it works. No config required.
Build for production
Output goes to dist/. Deploy to any static host (Vercel, Netlify, Cloudflare Pages, etc.) and it works. Open source and no vendor lock-in.
