Create a new project πŸ‘‰ npm init ic

For those JavaScript developers of you who primarily use npm as I do, I published a new cli to kickstart quickly applications on the IC:

$ npm init ic
  • It install dfx if needed
  • It checks dfx version and ask if you want to upgrade if a new version is available
  • Ask for name of the project
  • Ask for Motoko or Rust
  • Init a new project
  • Done

Links:

demo

16 Likes

@peterparker Spider-Man you rock!

2 Likes

Just published an update of my cli that can now init backend only projects (--no-frontend) and can also set up the authentication - i.e. can add Internet Identity to the project your create automatically :love_you_gesture:

$: npm init ic

demo

2 Likes

Does it support custom frontend frameworks like React, Vue, etc?

Not yet.

I was thinking about it, particularly because I mostly use SvelteKit for dapps, but, I feel like I don’t have currently the resources to maintain multiple sample repo up-to-date or write the jobs that would keep them up-to-date (because if I do, I would like to provide only sample code that remains up-to-date).

It might come someday but, if someone would be interested to contribute in that sense, reach out!

2 Likes

I was introduced to a package like yours in the Motoko BootCamp,
that works for other frontend frameworks: GitHub - MioQuispe/create-ic-app: Use your favourite frontend framework with the Internet Computer

Btw Great job on this project @peterparker

2 Likes


What can be wrong?

npm init ic does not support Windows yet (issue).

As my focus is on simplifying IC development for frontend developers using Juno, I do not currently have plans to add this feature to this Cli.

However, PR welcome. :wink:

It is not Windows. It is Ubuntu. And it is not WSL, just pure Ubuntu 22.04.2 LTS

Interesting. What version of Node, LTS?

v18.16.0 with npm 9.6.6

Can this be a solution? https://stackoverflow.com/a/59830014/5404186