This box comes with everything you need to start using smart contracts from a SvelteKit app.
The goal of this project was to create a base for building an Ethereum dapp using Truffle with a SvelteKit frontend.
Truffle Boxes are helpful boilerplates that allow you to focus on what makes your dapp unique.
SvelteKit is an application framework powered by Svelte. Used for building web applications of all sizes, with a beautiful development experience and flexible filesystem-based routing.
First ensure you are in a new and empty directory.
Install Truffle globally.
npm install -g truffle
Download the box. This also takes care of installing the necessary dependencies.
truffle unbox kaspergff/SvelteKit-box
Compile and migrate the smart contracts..
truffle compile
truffle migrate
Run the next.js server for the front-end. Smart contract changes must be manually recompiled and migrated.
// Change directory to the front-end folder
cd client
// Serves the front-end on http://localhost:3000
npm run dev
Truffle can run tests written in Solidity or JavaScript against your smart contracts.
truffle test
To build the application for production, use the build script. A production build will be in the client/build folder.
// ensure you are inside the client directory when running this
npm run build