wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
12.79k stars 1.14k forks source link

Improve starter templates that are offered on `wasp new` in Wasp CLI #1622

Open Martinsos opened 6 months ago

Martinsos commented 6 months ago

On wasp new, currently we are offered following templates:

  1. basic: just one page with hello world content.
  2. todo-ts: Todo app from tutorial, implemented in Typescript, as a richer starting point.
  3. saas: Open Saas template
  4. embeddings: Wasp app that has stuff needed to embed knowledge in PG database and then provide it to ChatGPT (RAG).
  5. ai-generated: Wasp AI / Mage

I suggest to change this to the following setup:

  1. minimal: previous "basic" -> just one page. (this is also needed in Tutorial)
  2. basic-ts: one page + email/pass auth with pages generated + 1 action and 1 query.
  3. basic-js
  4. saas
  5. ai-generated: Wasp AI / Mage
  6. Idea: would be cool to add analytics so we know how much people use which template.

But I would upgrade "basic" to contain auth and action/query, because that just makes sense, that is what 99% users want to have from the very start. And old "basic" could become the "minimal", so you still have some very basic starter with nothing in it, if you really want to start from very scratch, vanilla. I would remove embeddings as they are quite niche.

Potentially we could replace todo-ts with basic-ts which would be the same as basic but in ts.

infomiho commented 3 months ago

I believe it would be great to add something to the public dir by default like the favicon.ico so it's super obvious to users what they need to change to update their favicon. Discord convo: https://ptb.discord.com/channels/686873244791210014/1220963657073037342/1220963657073037342

I think we did a good job of keeping the vite.config.ts with some simple settings in the project root by default, now people know what to edit. We should do the same with the public dir.

Martinsos commented 3 months ago

I believe it would be great to add something to the public dir by default like the favicon.ico so it's super obvious to users what they need to change to update their favicon. Discord convo: https://ptb.discord.com/channels/686873244791210014/1220963657073037342/1220963657073037342

I think we did a good job of keeping the vite.config.ts with some simple settings in the project root by default, now people know what to edit. We should do the same with the public dir.

Yes I agree! We should actually remove "magical" creation of default favicon if there is none specified, and just start project with default favicon in public/.

nwhitmont commented 3 months ago

@Martinsos It would nice if the template descriptions call out the database type that will be used on a per template basis. Or alternately provide an option to pick the DB type during setup. Or both.

For example, SaaS template uses PostgreSQL in Docker container, while the To-Do app template uses SQLite. I couldn't find that information in the template descriptions in the CLI or on the docs website starter templates section.

CLI (current):

> src wasp new
Enter the project name (e.g. my-project) ▸ example-proj
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)

Nice to have:

  1. CLI - template list include sthe database type used by each template
  2. Docs - https://wasp-lang.dev/docs/data-model/backends - lists the starter templates which use each supported database type
  3. Docs - https://wasp-lang.dev/docs/project/starter-templates - lists the starter templates which use each supported database type
Martinsos commented 3 months ago

@Martinsos It would nice if the template descriptions call out the database type that will be used on a per template basis. Or alternately provide an option to pick the DB type during setup. Or both.

For example, SaaS template uses PostgreSQL in Docker container, while the To-Do app template uses SQLite. I couldn't find that information in the template descriptions in the CLI or on the docs website starter templates section.

CLI (current):

> src wasp new
Enter the project name (e.g. my-project) ▸ example-proj
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)

Nice to have:

  1. CLI - template list include sthe database type used by each template
  2. Docs - https://wasp-lang.dev/docs/data-model/backends - lists the starter templates which use each supported database type
  3. Docs - https://wasp-lang.dev/docs/project/starter-templates - lists the starter templates which use each supported database type

Thanks @nwhitmont for the feedback! I haven't thought of this, would be interesting. One thing though, is that there isn't much choice at the moment -> SQLite is nice in Wasp for getting started with the project, which is why we use it for simpler project, to allow people easier start, but some Wasp features demand Postgres, so a bit more complex starters start with Postgres. And in any case, you will want to switch to Postgres with your Wasp app, as I said SQLite is just for starting. So those starter templates that right now start with Postgres, do so because it is required by Wasp, so no choice there. And those that don't, but start with SQLite -> well, that is ideal for starting, and switching to PostgreSQL is also easy later.

Why do you think this information of which database the template starts with would be valuable, how would you find it valuable? Did you wish project started with SQLite instead of Postgres, or was it vice versa?

nwhitmont commented 3 months ago

Thanks for the context @Martinsos

Why do you think this information of which database the template starts with would be valuable, how would you find it valuable?

Since the database type was not listed in the CLI starter templates descriptions, I did not realize there were two database types supported in the project. I only discovered that after trying out multiple template types.

Did you wish project started with SQLite instead of Postgres, or was it vice versa?

I prefer starting with Postgres, it is already an industry standard. Personally, I would remove the SQLite path completely and support only the Dockerized DB workflow. Technical knowledge is not required to install Docker Desktop and have it running. If the simple template needs to be migrated to Postgres later anyway, then it seems to me that starting a project with SQLite is just creating technical debt (no matter. how small) that is not necessary.

It is also worth noting that SQLite does not support all the same data types as Postgres (not even close). Which under certain certain circumstances could create unnecessary future work during migration or maintenance. For example, PostgreSQL has DATETiME data type but SQLite does not. In fact SQLite only supports 5 data types while PostgresSQL has many more data types.

Martinsos commented 3 months ago

Thanks for the context @Martinsos

Why do you think this information of which database the template starts with would be valuable, how would you find it valuable?

Since the database type was not listed in the CLI starter templates descriptions, I did not realize there were two database types supported in the project. I only discovered that after trying out multiple template types.

Did you wish project started with SQLite instead of Postgres, or was it vice versa?

I prefer starting with Postgres, it is already an industry standard. Personally, I would remove the SQLite path completely and support only the Dockerized DB workflow. Technical knowledge is not required to install Docker Desktop and have it running. If the simple template needs to be migrated to Postgres later anyway, then it seems to me that starting a project with SQLite is just creating technical debt (no matter. how small) that is not necessary.

It is also worth noting that SQLite does not support all the same data types as Postgres (not even close). Which under certain certain circumstances could create unnecessary future work during migration or maintenance. For example, PostgreSQL has DATETiME data type but SQLite does not. In fact SQLite only supports 5 data types while PostgresSQL has many more data types.

That's a very reasonable analysis!

Unfortuantely, we keep witnessing quite some people getting stuck or slowed down when it turns out they don't have Docker, meaning they get confused by the error instructions. Also, we want people to be able to really easily try Wasp, and if it turns out they have to do some Docker setup, that can easily turn them off at that very moment when they are already on the edge of trying or not trying Wasp out. So while it would ideally be nice to drop SQLite completely, it seems there is value to having it as a starting option for trying out Wasp.

That said, it might be good to re-evaluate this in the future!