Template for web apps with Seed (Rust framework), TailwindCSS and Webpack.
OTHER License
I want to write fast, reliable and efficient web apps. Quickly. And I like Rust and documentation.
!!! New Rust-only quickstart in development! => Seeder !!!
LIVE DEMO: quickstart-webpack.seed-rs.org
Main components:
.github/workflows/main.yml
and netlify.toml
). Linters are very strict.How to create your new app, modify it and deploy it - step by step guide.
I want to show you how to create, build and host your website for free, so we will need a public GitHub repository.
The simplest way how to do it is to click on the green button Use this template on the GitHub profile of this quickstart.
Make sure Git doesn't automatically convert your newlines to CLRF because linters don't like it.
$ git config --global core.autocrlf
in your terminal and it should return input
or false
. See Git docs for more info.Clone your new repository to your local machine. I use GitKraken, but you are probably better developer than me - use your favorite terminal.
Make sure you have basic tools installed:
Platform-specific tools like ssl
and pkg-config
:
These tools are required by some commands:
$ wasm-pack -V
=> wasm-pack 0.9.1
$ cargo install wasm-pack
$ cargo make -V
=> cargo-make 0.30.7
$ cargo install cargo-make
$ cargo +nightly fmt -- -V
=> rustfmt 1.4.14-nightly (a5cb5d26 2020-04-14)
$ rustup toolchain install nightly
$ rustup component add rustfmt --toolchain nightly
$ yarn
$ yarn start
- and then open localhost:8000 in a browser.Ctrl+c
).$ cargo make verify_only
- you shouldn't see any errors.LICENCE
, README.md
and Cargo.toml
as you wish and push changes into GitHub.$ yarn start
in terminal.192.168.1.5:8000
) on your phone.Note: You don't have to follow all steps below - reuse starter project code as you need.
src/page/partial/header.rs
in your IDE.header_visibility
.view
.src/page/partial/footer.rs
in your IDE.view
.src/page/not_found.rs
in your IDE.view
.src/page/home.rs
in your IDE.view
.src/page/about.rs
in your IDE.view
.src/lib.rs
in your IDE.TITLE_SUFFIX
value.MAIL_TO_KAVIK
and MAIL_TO_HELLWEB
.view
./favicons
.static/templates/favicons.hbs
in your IDE.static/templates/loading_page.hbs
in your IDE.static/templates/social_media.hbs
in your IDE.static/index.hbs
in your IDE.static/fonts
./css/fonts.css
in your IDE.static/images
.static/Martin_Kavik_resume.pdf
.tailwind.config.js
in your IDE.module.exports = {
theme: {},
variants: {},
plugins: []
};
/css/custom.css
in your IDE.How to format, lint and test your project.
And how to setup Github Actions with deploy into Netlify.
$ cargo make fmt
(it overwrites files) or only $ cargo make fmt_check
rustfmt.toml
Makefile.toml
- tasks fmt
and fmt_check
$ cargo make clippy
Makefile.toml
- task clippy
$ cargo make test_h firefox
for headless testing in Firefox.
Makefile.toml
tests/test.rs
), see seed-rs-realworld for more examples.$ yarn build:prerender
$ yarn serve:dist
$ cargo make verify
before push to make sure CI pipeline will accept your code.
Makefile.tom
- task verify
(similar task verify_only
is used in CI)./README.md
(Site detail > Settings
> General
> Status badges
).Settings
> General
> API ID)User settings
> Applications
> New access token
> Name it for instance GitHub
)/netlify.toml
to suit your needs. Netlify docs.Settings
and then on Secrets
.NETLIFY_SITE_ID
and set it's value to Site id.NETLIFY_ACCESS_TOKEN
and set it's value to Access token.Actions
in the side menu and make sure that Actions
are enabled./.github/workflows/main.yml
.
yarn build:prerender
with yarn build:release
if you don't want to prerender pages.Actions
to check that everything works.yarn build:realease
.yarn serve:dist
and view in a browser.dist
directory to a web server.Settings
.NETLIFY_SITE_ID
and set it's value to Site id.NETLIFY_ACCESS_TOKEN
and set it's value to Access token.Current
and click Activate repository
./README.md
(Repository detail > Click on badge next to the rep. name > IMAGE URL
change to MARKDOWN
)/.travis.yml
.
yarn build:prerender
with yarn build:release
if you don't want to prerender pages.More options
> Requests
.Note: Please squash commits and rebase before creating PR. Thanks!