W
Wasp4mo ago
Ghar

How to create and use a custom template?

How do I create a template and how do I use it once it is created?
3 Replies
kapa.ai
kapa.ai4mo ago
Hi @Ghar. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain information on how to create a custom template in Wasp. However, they do provide information on how to use existing templates when creating a new Wasp project. To use an existing template when creating a new Wasp project, you can use the wasp new command in the interactive mode. This command will prompt you to input the project name and to select a template. The chosen template will then be used to generate the project directory with the specified name. Here is an example:
$ wasp new
Enter the project name (e.g. my-project) ▸ MyFirstProject
Choose a starter template
[1] basic (default)
Simple starter template with a single page.
[2] todo-ts
Simple but well-rounded Wasp app implemented with Typescript & full-stack type safety.
[3] saas
Everything a SaaS needs! Comes with Auth, ChatGPT API, Tailwind, Stripe payments and more. Check out <https://opensaas.sh/> for more details.
[4] embeddings
Comes with code for generating vector embeddings and performing vector similarity search.
[5] ai-generated
🤖 Describe an app in a couple of sentences and have Wasp AI generate initial code for you. (experimental)
1

🐝 --- Creating your project from the "basic" template... -------------------------

Created new Wasp app in ./MyFirstProject directory!

To run your new app, do:
cd MyFirstProject
wasp db start
$ wasp new
Enter the project name (e.g. my-project) ▸ MyFirstProject
Choose a starter template
[1] basic (default)
Simple starter template with a single page.
[2] todo-ts
Simple but well-rounded Wasp app implemented with Typescript & full-stack type safety.
[3] saas
Everything a SaaS needs! Comes with Auth, ChatGPT API, Tailwind, Stripe payments and more. Check out <https://opensaas.sh/> for more details.
[4] embeddings
Comes with code for generating vector embeddings and performing vector similarity search.
[5] ai-generated
🤖 Describe an app in a couple of sentences and have Wasp AI generate initial code for you. (experimental)
1

🐝 --- Creating your project from the "basic" template... -------------------------

Created new Wasp app in ./MyFirstProject directory!

To run your new app, do:
cd MyFirstProject
wasp db start
To skip the interactive mode and create a new Wasp project with the default template, you can use wasp new <project-name>.
$ wasp new MyFirstProject
🐝 --- Creating your project from the "basic" template... -------------------------

Created new Wasp app in ./MyFirstProject directory!

To run your new app, do:
cd MyFirstProject
wasp db start
$ wasp new MyFirstProject
🐝 --- Creating your project from the "basic" template... -------------------------

Created new Wasp app in ./MyFirstProject directory!

To run your new app, do:
cd MyFirstProject
wasp db start
For more information, you can refer to the Wasp documentation (https://wasp-lang.dev/docs/project/starter-templates). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
miho
miho4mo ago
Wasp doesn't currently support creating templates that you can use within the CLI e.g. wasp new app -t my-template-name You can always create a project that you copy paste every time you need to start with your custom setup. There is also this thing called giget which you can use to get some folder from some Github repo e.g. this is how I do it with my Typescript starter: npx giget gh:infomiho/typescript-starter my-project which is located here: https://github.com/infomiho/typescript-starter
GitHub
GitHub - infomiho/typescript-starter: Simple Typescript starter, ru...
Simple Typescript starter, run npx degit infomiho/typescript-starter folder - infomiho/typescript-starter
Ghar
GharOP4mo ago
great tip 'giget' thanks
Want results from more Discord servers?
Add your server