Skip to content

rotteegher/farmtasker-au

Repository files navigation

Leptos Logo

Leptos Axum Application.

This is an application of Leptos web framework and the cargo-leptos Rust tool using Axum web server.

Prerequisites:

  1. Installation of Nix package manager.

  2. Clone the repo:

git clone https://github.com/rottegher/farmtasker-au
cd farmtasker-au

Activating dev environment:

  1. Using direnv:
direnv allow
  1. Using just Nix:
nix develop . --impure

Wait for a while for nix to download the rust toolchain and all dependencies to then automatically enable the dev enviroment.

Running the project:

  1. Export your test Stripe API key to the dev environment:
export STRIPE_KEY "pk_test_***************************************************************************************************"
  1. Run and watch the application in dev mode:
cargo leptos watch

Compiling for Release:

cargo leptos build --release

This will generate your server binary in target/release and your site package in target/site.

Executing a Server on a Remote Machine Without the Toolchain.

After running a cargo leptos build --release the minimum files needed are:

  1. The server binary located in target/server/release
  2. The site directory and all files within located in target/site
  3. Stripe api key.

Copy these files to your remote server. The directory structure should be:

farmtasker-au
site/

Set the following environment variables (updating for your project as needed):

LEPTOS_OUTPUT_NAME="farmtasker-au"
LEPTOS_SITE_ROOT="site"
LEPTOS_SITE_PKG_DIR="pkg"
LEPTOS_SITE_ADDR="127.0.0.1:3000"
LEPTOS_RELOAD_PORT="3001"
STRIPE_KEY="...your key here..."

Finally, run the server binary.

./farmtasker-au

Testing the project:

cargo leptos end-to-end
cargo leptos end-to-end --release

Cargo-leptos uses Playwright as the end-to-end test tool.
Tests are located in end2end/tests directory.

License:

                  GNU LESSER GENERAL PUBLIC LICENSE
                       Version 2.1, February 1999

fartmasker.au a marketplace website for local farmers in Tasmania.
Copyright (C) 2024 Dmytro Serdiukov & FARMTASKER PTY LTD

This software is a free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU Lesser General Public License for more details.

FARMTASKER PDY LTD, hereby disclaims all copyright interest in the
software `farmtasker.au' (a marketplace website for local farmers in Tasmania) written by Dmytro Serdiukov.

11 December 2024
Olesia Trukhanska, founder of FARMTASKER PTY LTD

You can contact us at [email protected]

See LICENSE file or GNU LGPL.