@appaflytech/create-wappa
v0.0.16
Published
Scaffold a new Wappa CMS project — Next.js or Expo React Native
Readme
@appaflytech/create-wappa
Scaffold a new Wappa CMS project in seconds — Next.js 14 or Expo React Native, with optional gluestack-ui v4 or plain Tailwind/NativeWind.
Usage
npm create @appaflytech/wappa@latest
# or
npx @appaflytech/create-wappa@latest
# or
pnpm create @appaflytech/wappa@latest
# or
bunx @appaflytech/create-wappa@latestRunning the command launches an interactive prompt:
◆ create-wappa
◇ Project type?
│ ● Web (Next.js 14) ○ Mobile (Expo React Native)
◇ UI framework?
│ ● gluestack-ui v4 (Recommended) ○ Tailwind CSS only
◇ Project name?
│ my-wappa-app
◇ Target directory?
│ my-wappa-app
◇ Wappa site key?
│ my-site-key
◇ Wappa API URL?
│ https://api.example.com
◇ CDN URL?
│ https://cdn.example.com
◇ Default language?
│ ● Turkish (tr-tr) ○ English (en-us) ○ ...
◆ ✓ Project "my-wappa-app" created successfully!
Next steps:
cd my-wappa-app
npm install
npm run devWhat gets scaffolded
Web (Next.js 14)
| UI Framework | Stack | | --------------------- | ---------------------------------------------------------------------------- | | gluestack-ui v4 | Next.js 14 · App Router · gluestack-ui v4 · NativeWind tokens · Tailwind CSS | | Tailwind CSS only | Next.js 14 · App Router · Tailwind CSS · plain HTML components |
Scaffolded files include:
app/layout.tsx— root layout (withGluestackUIProviderif gluestack)app/page.tsx— entry page usingWapScreencomponents/WapScreen.tsx— Wappa page renderercore/render.tsx— Wappa component render systemcomponents/index.tsx— 36 component registryservices/contextService.ts—@appaflytech/wappa-clientintegrationstore/store.ts— Zustand storenext.config.js,tailwind.config.js,tsconfig.json,.env,.gitignore
Mobile (Expo React Native)
| UI Framework | Stack | | ------------------- | ---------------------------------------------------------- | | gluestack-ui v4 | Expo SDK · gluestack-ui v4 · NativeWind · React Navigation | | NativeWind only | Expo SDK · NativeWind · React Native primitives |
Scaffolded files include:
app/_layout.tsx— root layout (withGluestackUIProviderif gluestack)app/index.tsx— entry screen usingWapScreencomponents/WapScreen.tsx— Wappa page renderercore/render.tsx— Wappa component render system (React Native)components/index.tsx— 29 mobile component registryservices/contextService.ts—@appaflytech/wappa-clientintegrationstore/store.ts— Zustand storeutils/path.ts— CDN image helpersapp.json,babel.config.js,metro.config.js,tailwind.config.js,.env
Included components
Web (36 components)
box · center · hstack · vstack · grid · pressable · heading · paragraph · icon · image · video · embed · button · link · fab · card · card-list · avatar · badge · divider · data-table · skeleton · spinner · alert · progress · toast · accordion · tabs · modal · drawer · actionsheet · menu · alert-dialog · tooltip · form-control · input · switch · checkbox · radio · textarea · slider · select · date-picker
Mobile (29 components)
box · center · hstack · vstack · grid · pressable · heading · paragraph · icon · image · video · button · link · fab · card · card-list · avatar · badge · divider · skeleton · spinner · alert · progress · toast · accordion · tabs · modal · actionsheet · menu · alert-dialog · tooltip · form-control · input · switch · checkbox · radio · textarea · slider
Environment variables
The generated .env file contains:
# Web (Next.js)
NEXT_PUBLIC_WAP_SITE_KEY=your-site-key
NEXT_PUBLIC_WAP_API=https://api.example.com
NEXT_PUBLIC_WAP_CDN=https://cdn.example.com
NEXT_PUBLIC_WAP_LANGUAGE=tr-tr# Mobile (Expo)
EXPO_PUBLIC_WAP_SITE_KEY=your-site-key
EXPO_PUBLIC_WAP_API=https://api.example.com
EXPO_PUBLIC_WAP_CDN=https://cdn.example.com
EXPO_PUBLIC_WAP_LANGUAGE=tr-trHow it works
The CLI uses @appaflytech/wappa-client to fetch page context from Wappa CMS. Each page renders dynamically via the Wappa render system — a component registry that maps Wappa widget types to your UI components:
// core/render.tsx (simplified)
import { components } from "@/components";
export function WapRender({ elements }) {
return elements.map((el) => {
const Component = components[el.type];
return Component ? <Component key={el.id} {...el.props} /> : null;
});
}You can extend the registry by adding components to components/index.tsx.
Requirements
| Web | Mobile | | ----------- | ------------------ | | Node.js 18+ | Node.js 18+ | | Next.js 14 | Expo SDK 51+ | | React 18 | React Native 0.74+ |
Publishing (maintainers)
npm run build
npm publish --access publicLicense
MIT © appaflytech
