A comprehensive project scaffolder for creating EMD Cloud applications with your choice of framework, language, styling, and state management solutions.
npm create @emd-cloud/app@latestOr with a specific project name:
npm create @emd-cloud/app@latest my-emd-app✨ Multiple Framework Support
- Vite + React (Standard and SWC)
- Next.js 15+ (App Router)
- Future: Vue, Svelte, Solid, Vanilla
🎯 Language & Compiler Options
- JavaScript
- TypeScript
- SWC Compiler (Rust-based, faster builds)
🎨 Styling Solutions
- Vanilla CSS
- SCSS/SASS
- Tailwind CSS
- Tailwind CSS + shadcn/ui (TypeScript only)
⚡ State Management
- None (basic setup)
- Redux Toolkit
- Effector
- TanStack Query
🛠️ Developer Tools
- ESLint (Standard, Airbnb, or None)
- Prettier formatting
- Git initialization
- Auto package manager detection
npm create @emd-cloud/app@latestyarn create @emd-cloud/apppnpm create @emd-cloud/appbun create @emd-cloud/appWhen you run the command, you'll be guided through the following options:
- Project Name - The name of your new project
- Framework - Choose between React (Vite) or Next.js
- Language - JavaScript or TypeScript
- Styling - CSS approach (options depend on your selections)
- State Management - State solution (Redux, Effector, TanStack Query, or None)
- Package Manager - npm, yarn, pnpm, or bun (auto-detected by default)
- Git Repository - Initialize git with first commit
- ESLint/Prettier - Code quality configuration
- Lightweight and fast development experience
- Hot Module Replacement (HMR)
- Instant startup
- Optimized production builds with Rollup
- Best for SPAs and component libraries
Compiler Options:
- Standard: Uses Babel for transformation
- SWC: Uses SWC (Speedy Web Compiler) for 20x faster compilation
- Full-stack capabilities with server and client components
- Built-in API routes
- Image optimization
- Font optimization
- SEO-friendly by default
- App Router (newest architecture)
- A lightweight, fast SPA
- Maximum control over build configuration
- Faster development experience
- Smaller bundle size
- Full-stack capabilities
- Server-side rendering
- Static site generation
- API routes
- Image/font optimization
- Built-in SEO features
- No dependencies
- Smallest footprint
- Full control
- Best for simple projects
- Variables and mixins
- Nested selectors
- Mixins and functions
- Better organization for larger projects
- Utility-first approach
- Rapid UI development
- Consistent design system
- Smaller final bundle (with purging)
- Pre-built, accessible components
- Built on Radix UI
- Customizable with Tailwind
- TypeScript first
- Best for feature-rich applications
- Suitable for simple applications
- Use React Context or local state
- Recommended for getting started
- Predictable state management
- Great for large applications
- Large ecosystem
- DevTools for debugging
- Learning curve
- Modern, fast state management
- TypeScript-first
- Great DX with TypeScript
- Less boilerplate than Redux
- Smaller bundle size
- Server state management
- Perfect for data fetching
- Automatic caching and synchronization
- Excellent for REST/GraphQL APIs
- Works with any state manager
Once your project is created, navigate to it and follow the displayed instructions:
cd my-emd-app
npm install # or your preferred package manager
npm run dev # Start development servernpm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
npm run type-check # Check TypeScript types (TS only)npm run dev # Start dev server
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLintAll templates come pre-configured with @emd-cloud/react-components, which provides React hooks and components for seamless EMD Cloud integration.
The templates are pre-configured with ApplicationProvider wrapping your app:
React (Vite):
import { ApplicationProvider } from '@emd-cloud/react-components'
function App() {
return (
<ApplicationProvider
app={import.meta.env.VITE_EMD_APP_ID || 'your-app-id'}
apiUrl="https://api.emd.one"
authToken={localStorage.getItem('emd_auth_token') || undefined}
>
<YourComponents />
</ApplicationProvider>
)
}Next.js:
import { ApplicationProvider } from '@emd-cloud/react-components'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<ApplicationProvider
app={process.env.NEXT_PUBLIC_EMD_APP_ID || 'your-app-id'}
apiUrl="https://api.emd.one"
>
{children}
</ApplicationProvider>
</body>
</html>
)
}import { useAuth, useDatabase, useWebhook } from '@emd-cloud/react-components'
function MyComponent() {
const { userInfo, logInUser, logOutUser } = useAuth()
const { getRows, createRow } = useDatabase()
const { callWebhook } = useWebhook()
// Use the hooks in your component
}For full documentation on available hooks and components, visit the @emd-cloud/react-components documentation.
Create a .env.local file in your project root:
# For Vite projects
VITE_API_URL=https://api.example.com
# For Next.js projects
NEXT_PUBLIC_API_URL=https://api.example.comAfter project creation, you can:
- Modify ESLint config (
.eslintrc.json) - Update Prettier config (
.prettierrc.json) - Configure Tailwind (for Tailwind projects)
- Add environment variables
- Install additional dependencies
my-emd-app/
├── src/ # Vite + React only
│ ├── App.jsx/tsx
│ ├── main.jsx/tsx
│ └── ...
├── app/ # Next.js only
│ ├── layout.jsx/tsx
│ ├── page.jsx/tsx
│ └── ...
├── public/ # Static assets
├── package.json
├── tsconfig.json # TypeScript config
├── .eslintrc.json # ESLint config
├── .prettierrc.json # Prettier config
├── .gitignore
└── README.md
For issues, feature requests, or questions:
- GitHub Issues: Create an issue
- Documentation: EMD Cloud Docs
MIT
Contributions are welcome! Please feel free to submit PRs.
See CHANGELOG.md for version history.