initial commit

This commit is contained in:
Rachel Lambda Samuelsson 2024-07-20 15:59:44 +02:00
commit e59748a285
25 changed files with 4802 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.direnv
result

1
back/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

1826
back/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

8
back/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "plantback"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = "0.7.5"
sqlx = { version = "0.7.4", features = ["runtime-tokio", "sqlite"] }

3
back/src/main.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

79
flake.lock Normal file
View File

@ -0,0 +1,79 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1719145550,
"narHash": "sha256-K0i/coxxTEl30tgt4oALaylQfxqbotTSNb1/+g+mKMQ=",
"path": "/nix/store/h5hhc58qp2rcv0f3d9di6569pxrpsi1j-source",
"rev": "e4509b3a560c87a8d4cb6f9992b8915abf9e36d8",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1721441897,
"narHash": "sha256-gYGX9/22tPNeF7dR6bWN5rsrpU4d06GnQNNgZ6ZiXz0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "b7996075da11a2d441cfbf4e77c2939ce51506fd",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

58
flake.nix Normal file
View File

@ -0,0 +1,58 @@
{
description = "A plantcare webapp";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (sys:
let pkgs = import nixpkgs {
system = sys;
overlays = [ (import rust-overlay) ];
};
rust = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analyzer" ];
};
platform = pkgs.makeRustPlatform {
rustc = rust;
cargo = rust;
};
node = pkgs.nodejs_20;
deps = [ rust node pkgs.prefetch-npm-deps ];
backend = platform.buildRustPackage {
name = "plantback";
src = ./back;
cargoLock = { lockFile = ./front/Cargo.lock; };
};
frontend = pkgs.buildNpmPackage {
name = "plantfront";
src = ./front;
nodejs = node;
npmBuildScript = "build-only";
npmDepsHash = "sha256-QYmO99RkdhAN+vNOkBqeXYlfyHGyHfRKVVMIWYfZO1A=";
installPhase = ''
mv ./dist $out
'';
};
in {
packages.backend = backend;
packages.frontend = frontend;
packages.default = pkgs.runCommand "plant" {} ''
mkdir $out
cp -r ${backend} $out/back
cp -r ${frontend} $out/front
'';
devShells.default = pkgs.mkShell {
shellHook = ''
PATH="${builtins.toString ./front/node_modules/.bin}:$PATH"
'';
packages = deps;
};
}
);
}

33
front/.gitignore vendored Normal file
View File

@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo
result
.direnv
.vite-ssg-temp/

2
front/env.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
/// <reference types="vite/client" />
/// <reference types="vite-plugin-pages/client" />

13
front/index.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>plant</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

2630
front/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

31
front/package.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "rachel-blog-vue",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "export NODE_ENV=production && vite build",
"type-check": "vue-tsc --build --force"
},
"dependencies": {
"vue": "^3.4.29"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.4",
"@types/node": "^20.14.5",
"@vitejs/plugin-vue": "^5.0.5",
"@vue/language-server": "^2.0.26",
"@vue/tsconfig": "^0.5.1",
"@vue/typescript-plugin": "^2.0.26",
"npm-run-all2": "^6.2.0",
"sass": "^1.77.8",
"typescript": "~5.4.0",
"typescript-language-server": "^4.3.3",
"vite": "^5.3.1",
"vite-plugin-pages": "^0.32.3",
"vue-tsc": "^2.0.21"
}
}

6
front/public/favicon.svg Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="2400" height="2400" viewBox="0 0 2400 2400">
<path fill-rule="evenodd" fill="rgb(100%, 100%, 100%)" fill-opacity="1" d="M 600 600 L 1800 600 L 1800 1800 L 600 1800 L 600 600 "/>
<rect x="-240" y="-240" width="2880" height="2880" fill="rgb(100%, 100%, 100%)" fill-opacity="1"/>
<path fill-rule="evenodd" fill="rgb(0%, 0%, 0%)" fill-opacity="1" d="M 2280 341.921875 C 2191.390625 626.808594 2108.378906 771.210938 2108.378906 771.210938 C 2130.378906 845.761719 2141.101562 1132.371094 2051.601562 1374.140625 C 1822.730469 1992.402344 1081.769531 2383.023438 120 1840.238281 C 395.21875 1782.148438 573.839844 1235.878906 824.414062 854.128906 C 924.964844 700.910156 1148.550781 432.238281 1509.320312 459.328125 C 1676.089844 468.769531 1838.890625 531.390625 1866.441406 599.421875 C 1853.949219 726.980469 1446.390625 1447.121094 939.414062 1638.539062 C 1762.179688 1377.660156 2085.019531 497.910156 2120.738281 301.96875 Z M 2280 341.921875 L 2280 341.921875 "/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
front/public/fonts/SAX2.ttf Normal file

Binary file not shown.

16
front/src/App.vue Normal file
View File

@ -0,0 +1,16 @@
<script setup lang="ts">
import TheHeader from './components/TheHeader.vue'
import TheFooter from './components/TheFooter.vue'
</script>
<template>
<header>
<TheHeader />
</header>
<main>
<RouterView />
</main>
<footer>
<TheFooter />
</footer>
</template>

View File

@ -0,0 +1,4 @@
<template>
<hr>
<a href="https://www.vecteezy.com/free-vector/leaf">Leaf Vectors by Vecteezy</a>
</template>

View File

@ -0,0 +1,3 @@
<template>
<span>header</span>
</template>

4
front/src/css/main.scss Normal file
View File

@ -0,0 +1,4 @@
@font-face {
font-family: "SAX2";
src: url(/fonts/SAX2.ttf);
}

13
front/src/main.ts Normal file
View File

@ -0,0 +1,13 @@
import './css/main.scss'
import { createApp } from 'vue'
import routes from '~pages'
import App from './App.vue'
const app = createApp(
App,
{ routes },
)
app.mount('#app')

View File

@ -0,0 +1,3 @@
<template>
<h1>hii world !! ^-^</h1>
</template>

15
front/tsconfig.app.json Normal file
View File

@ -0,0 +1,15 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"strict": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}

11
front/tsconfig.json Normal file
View File

@ -0,0 +1,11 @@
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
}

19
front/tsconfig.node.json Normal file
View File

@ -0,0 +1,19 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
],
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"]
}
}

21
front/vite.config.ts Normal file
View File

@ -0,0 +1,21 @@
import { fileURLToPath, URL } from 'node:url'
import Vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
export default {
plugins: [
Vue(),
Pages(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
esbuild: {
supported: {
'top-level-await': true
},
}
}