Quick Start
Get your first Catalyst app running in under 5 minutes. This guide will have you building a universal React application with server-side rendering in no time.
Prerequisites
Before you begin, make sure you have:
- Node.js 20.4.0 or later - Download here
- npm or yarn package manager
- A code editor (VS Code recommended)
Step 1: Create Your App
Open your terminal and run:
npx create-catalyst-app@latest my-app
You'll be prompted with a few questions:
? Enter the name of your Catalyst application: my-app? Enter a description: My first Catalyst app? Enable TypeScript support? (Y/n) Y? Include Tailwind CSS? (Y/n) n? Add MCP support? (Y/n) n? Choose a state management option: None
Pro tip: Hit Enter to accept the defaults for a minimal setup.
Step 2: Start Development Server
Navigate to your new project and start the dev server:
cd my-appnpm run start
You should see:
Catalyst development server starting...✓ Server running at http://localhost:3005✓ Client bundle built successfully
Step 3: View Your App
Open your browser and visit:
You'll see your Catalyst app running! 🎉
The page is server-side rendered - view the page source to see the HTML was generated on the server.
Step 4: Make Your First Edit
Open src/js/pages/Home/index.js in your editor:
export default function Home() {return (<div className="home-page"><h1>Welcome to Catalyst</h1><p>Edit this file and save to see hot reload in action!</p></div>);}
Change the heading to something else:
export default function Home() {return (<div className="home-page"><h1>My First Catalyst App</h1><p>This is server-side rendered and ready for mobile!</p></div>);}
Save the file - your browser will automatically update! That's Hot Module Replacement (HMR) in action.
Step 5: Add Data Fetching
Let's fetch some data on the server. Update your Home/index.js:
// Fetch data on the server before renderingexport const serverFetcher = async () => {// This runs on the server during SSRconst response = await fetch('https://jsonplaceholder.typicode.com/users/1');const user = await response.json();return { user };};// Component receives the fetched dataexport default function Home({ data }) {return (<div className="home-page"><h1>Hello, {data.user.name}!</h1><p>Email: {data.user.email}</p><p>Company: {data.user.company.name}</p></div>);}
Refresh your browser - the data was fetched on the server and rendered in the HTML!
Step 6: Add a New Route
Create a new page at src/js/pages/About/index.js:
export default function About() {return (<div className="about-page"><h1>About</h1><p>This is a universal React app built with Catalyst.</p><ul><li>Server-side rendering</li><li>Hot module replacement</li><li>Automatic code splitting</li><li>Ready for iOS and Android</li></ul></div>);}
Register your route in src/js/routes/index.js:
import Home from '../pages/Home';import About from '../pages/About';const routes = [{path: '/',component: Home},{path: '/about',component: About}];export default routes;
Visit http://localhost/about - your new route works!
Step 7: Add Navigation
Let's add links between pages. Create src/js/components/Navigation.js:
import { Link } from 'react-router';export default function Navigation() {return (<nav style={{ padding: '1rem', background: '#f0f0f0' }}><Link to="/" style={{ marginRight: '1rem' }}>Home</Link><Link to="/about">About</Link></nav>);}
Add it to your pages:
import Navigation from '../../components/Navigation';export default function Home({ data }) {return (<><Navigation /><div className="home-page"><h1>Hello, {data.user.name}!</h1>{/* ... rest of your content */}</div></>);}
Now you can navigate between pages with instant client-side routing!
🎉 Congratulations!
In just 5 minutes, you've:
- Created a Catalyst app
- Ran a development server
- Used server-side rendering
- Fetched data from an API
- Added routes and navigation
- Experienced hot module replacement
What's Next?
Build for Mobile (Optional - 10 minutes)
Want to see your app on iOS or Android?
# For Androidnpm run buildApp:android# For iOS (macOS only)npm run buildApp:ios
Learn more in the Universal Apps guide.
Learn More
Now that you have the basics, explore these topics:
Core Concepts
- Routing - Nested routes, dynamic parameters, layouts
- Data Fetching - Server and client fetchers, caching
- App Shell - Layout and app structure
- State Management - Redux integration
Building Features
- Styling - CSS Modules, Sass, Tailwind
- Code Splitting - Optimize bundle size
- Middleware - Add authentication, logging
- Assets - Images and static files
Universal Apps
- First Universal App - Complete walkthrough
- Hooks - Camera, storage, haptics
- Android Setup - Configure Android development
- iOS Setup - Configure iOS development
Tutorials
- Pet Adoption App - Build a full-featured app step-by-step
Project Structure
Your Catalyst app has this structure:
my-app/├── config/│ └── config.json # App configuration├── src/│ ├── js/│ │ ├── pages/ # Page components│ │ ├── components/ # Shared components│ │ └── routes/ # Route definitions│ └── static/ # CSS, images, fonts├── server/│ ├── document.js # HTML template│ └── server.js # Express server├── client/│ └── index.js # Client entry point└── package.json
Learn more in Project Structure.
Common Commands
# Developmentnpm run start # Start dev servernpm run start:prod # Start production server# Buildingnpm run build # Build for productionnpm run analyze # Analyze bundle size# Universal Appsnpm run buildApp:android # Build Android appnpm run buildApp:ios # Build iOS app (macOS only)npm run installApp:android # Install on Android device
See all commands in CLI Reference.
Need Help?
- 📖 Full Documentation - Comprehensive guides
- 💬 Discord - Chat with the community
- 🐛 GitHub Issues - Report bugs
- Discussions - Ask questions
Tips for Success
1. Use TypeScript
Get better autocomplete and catch errors early:
npx create-catalyst-app@latest my-app --typescript
2. Leverage Server Fetchers
Fetch data on the server for better performance and SEO:
export const serverFetcher = async () => {const data = await fetchData();return { data };};
3. Keep Components Small
Break down large components for better code splitting:
import { lazy } from 'react';const HeavyComponent = lazy(() => import('./HeavyComponent'));
4. Split Fetching Between Server and Client
Use serverFetcher for data needed in the initial HTML, and clientFetcher for data that can load
after hydration. This keeps the server response small without leaving the page empty:
Home.serverFetcher = async () => ({ listing: await fetchListing() });Home.clientFetcher = async () => ({ recommendations: await fetchRecommendations() });
You are now ready to build production-ready universal applications.
Continue with the Installation Guide for more detailed setup options, or jump into Core Concepts to learn how Catalyst works under the hood.