React (TypeScript)
A TypeScript web app template using React and Robo.js.
React (TypeScript)
Welcome to your fresh Robo.js project!
Build, deploy, and maintain your web apps with ease. File-based setup, integrated database, TypeScript support, and plugin ecosystem.
Getting Started
Create a project with this template:
npx create-robo@next <project-name> --template web-apps/react-tsThen navigate into your project directory:
cd <project-name>Run development mode:
npm run devA free Cloudflare tunnel is included for easy testing.
App Development
You can find your client-side code in the /src/app folder. This is where you can build your web app using React, but you can switch to any other framework if you prefer.
Things are powered by Vite under the hood, so you get the latest ES modules, hot module reloading, and more!
Try editing the App.tsx file to get started!
Backend Development
Your server-side code is located in the /src/api folder. This is where you can build your API, webhooks, and other server-side features.
This backend is powered by the Server Plugin - a powerful Robo plugin that creates and manages a Node http server for you.
Everything Robo is file-based, so you can create new routes by making new files in the /src/api directory:
export default () => {
return { status: 'ok' }
}export default () => {
return { status: 'ok' }
}Folder Structure
While the api and app folders are reserved for your server and client-side code, you are free to create anything else in the /src directory!
Plugins
This Robo boasts an intuitive plugin system that grants new capabilities instantly!
npx robo add @robojs/ai@nextWith that, your Robo automatically equips itself with all the features the plugin offers.
Deployment
Run the deploy command to automatically deploy to RoboPlay.
npm run deployYou can also self-host your robo anywhere that supports Node:
npm run build
npm start