Available File Templates in Fastree

Fastree provides several built-in file templates to streamline your project structure. You can reference these templates in your fastree.config.json file.

πŸ“œ List of Templates

Template NameDescription
ReactComponentGenerates a React functional component.
ReactHookCreates a custom React hook.
ReactContextSets up a React context provider.
ServiceGenerates a service file (e.g., API calls, business logic).
ConfigCreates a configuration file.
ExpressRouteGenerates an Express.js route handler.
ConstantDefines a constants file.
MiddlewareCreates an Express.js middleware function.
NextApiRouteSets up an API route for a Next.js project.
NextLayoutGenerates a Next.js layout component.
NextPageCreates a Next.js page component.

πŸ›  How to Use

To use a template, define it in fastree.config.json like this:

{
  "name": "<feature-name>-component.tsx",
  "template": "ReactComponent"
}

When you run:

npx fastree generate auth

It will create:

src/components/auth/
β”œβ”€β”€ auth-component.tsx

✨ Customize your setup by mixing different templates as needed!

Now you’re ready to supercharge your project generation with Fastree’s templates! πŸš€