Compare commits

..

No commits in common. "0269ea15de7e6affb100204a58fa3fd26cb61253" and "a0d3821eafee5c3b6521cdc3c38218339e830c22" have entirely different histories.

9 changed files with 564 additions and 643 deletions

View File

@ -1,15 +1,8 @@
# README # README
## Links ## About
- [gorm](https://gorm.io/docs/) This is the official Wails Svelte-TS template.
- [Flowbyte UI lib](https://flowbite-svelte.com/docs/pages/introduction)
- [Tailwind](https://tailwindcss.com/docs/flex-basis)
## Branches:
- main: in memory
- gorm-sqlite: gorm with SQLite and one to many association.
## Live Development ## Live Development
@ -21,4 +14,3 @@ to this in your browser, and you can call your Go code from devtools.
## Building ## Building
To build a redistributable, production mode package, use `wails build`. To build a redistributable, production mode package, use `wails build`.

View File

@ -10,19 +10,19 @@
"check": "svelte-check --tsconfig ./tsconfig.json" "check": "svelte-check --tsconfig ./tsconfig.json"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0", "@sveltejs/vite-plugin-svelte": "^1.0.1",
"@tsconfig/svelte": "^3.0.0", "@tsconfig/svelte": "^3.0.0",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"flowbite": "^3.1.1", "flowbite": "^3.1.1",
"flowbite-svelte": "^0.47.4", "flowbite-svelte": "^0.47.4",
"flowbite-svelte-icons": "^2.0.2", "flowbite-svelte-icons": "^2.0.2",
"svelte": "^3.49.0",
"svelte-check": "^2.8.0",
"svelte-preprocess": "^4.10.7",
"svelte-routing": "^2.13.0", "svelte-routing": "^2.13.0",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"svelte-preprocess": "^6.0.0",
"tailwindcss": "^3.4.9", "tailwindcss": "^3.4.9",
"tslib": "^2.4.0", "tslib": "^2.4.0",
"typescript": "^5.5.0", "typescript": "^4.6.4",
"vite": "^5.4.4" "vite": "^3.0.7"
} }
} }

View File

@ -1 +1 @@
ecca169d2f4300be13c05467ed335c56 a5a8c3695f34d6c9bafb2ee7f70bf99a

1146
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,22 @@
<script lang="ts"> <script lang="ts">
import "./app.css"; import "./app.css";
import { Router, Route, Link } from "svelte-routing"; import { Navbar, NavBrand, DarkMode } from "flowbite-svelte";
import { Router, Route } from "svelte-routing";
import Home from "./routes/Home.svelte"; import Home from "./routes/Home.svelte";
import "./app.css"; import "./app.css";
import { Navbar, NavBrand, DarkMode } from "flowbite-svelte"; export let url = "";
let url: string = $state();
</script> </script>
<main class="flex-col h-screen items-center bg-gray-50 dark:bg-gray-800"> <main class="flex-col h-screen items-center bg-gray-50 dark:bg-gray-800">
<Router bind:url> <Navbar>
<Navbar> <NavBrand>
<NavBrand> <span>Wails</span>
<Link to="/">HOME</Link> </NavBrand>
</NavBrand> <DarkMode />
<DarkMode /> </Navbar>
</Navbar> <Router {url}>
<Route path="/"><Home /></Route> <div>
<Route path="/"><Home /></Route>
</div>
</Router> </Router>
</main> </main>

View File

@ -1,8 +1,7 @@
import './style.css' import './style.css'
import App from './App.svelte' import App from './App.svelte'
import { mount } from "svelte";
const app = mount(App, { const app = new App({
target: document.getElementById('app') target: document.getElementById('app')
}) })

View File

@ -18,8 +18,8 @@
TableBodyCell, TableBodyCell,
} from "flowbite-svelte"; } from "flowbite-svelte";
let name: string = $state(); let name: string;
let thingsList: things.Thing[] = $state([]); let thingsList: things.Thing[] = [];
function update() { function update() {
GetThings().then((ts) => { GetThings().then((ts) => {
@ -40,7 +40,7 @@
onMount(update); onMount(update);
</script> </script>
<form class="max-w-96 m-5 grid-cols-1 gap-10" onsubmit={submit}> <form class="max-w-96 m-5 grid-cols-1 gap-10" on:submit={submit}>
<div class="m-5"> <div class="m-5">
<Label for="first_name" class="mb-2">First name</Label> <Label for="first_name" class="mb-2">First name</Label>
<Input type="text" placeholder="John" bind:value={name} required /> <Input type="text" placeholder="John" bind:value={name} required />

View File

@ -1,5 +1,7 @@
import sveltePreprocess from 'svelte-preprocess'
export default { export default {
// Consult https://github.com/sveltejs/svelte-preprocess // Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors // for more information about preprocessors
preprocess: sveltePreprocess()
} }

BIN
things.db

Binary file not shown.