Skip to content

Commit e92ceab

Browse files
committed
init sveltekit
1 parent 4c75b00 commit e92ceab

37 files changed

+14378
-34
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DATABASE_URL=file:local.db

.gitignore

+27-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1-
/.direnv
1+
node_modules
2+
.direnv
3+
4+
# Output
5+
.output
6+
.vercel
7+
.netlify
8+
.wrangler
9+
/.svelte-kit
10+
/build
11+
12+
# OS
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Env
17+
.env
18+
.env.*
19+
!.env.example
20+
!.env.test
21+
22+
# Vite
23+
vite.config.js.timestamp-*
24+
vite.config.ts.timestamp-*
25+
26+
# SQLite
27+
*.db

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

README.md

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
1-
# How Match
1+
# sv
22

3-
## 使う
3+
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
44

5-
(todo)
6-
access <https://todo.utcode.net>
5+
## Creating a project
76

8-
## 開発
7+
If you're seeing this, you've probably already done this step. Congrats!
98

10-
### 環境構築
9+
```bash
10+
# create a new project in the current directory
11+
npx sv create
1112

12-
1. Nix をインストールします
13-
2. Direnv と Nix-Direnv をインストールします (任意/推奨)
14-
3. `direnv allow` または `nix develop` を実行して開発用シェルに入ります
13+
# create a new project in my-app
14+
npx sv create my-app
15+
```
1516

16-
### デプロイ方法
17+
## Developing
1718

18-
(todo)
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
1920

20-
### 技術スタック
21+
```bash
22+
npm run dev
2123

22-
(todo)
23-
- フロンドエンド:
24-
- HTML (probably)
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
2527

26-
- バックエンド:
27-
- SQL (probably)
28+
## Building
2829

29-
- 開発:
30-
- Nix
31-
- Lefthook
30+
To create a production version of your app:
3231

33-
...
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

assets/favicon.png

1.53 KB
Loading

assets/robots.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

biome.jsonc

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",
6-
"useIgnoreFile": true,
6+
"useIgnoreFile": true
77
},
88
"files": {
99
"ignoreUnknown": false,
10-
"ignore": [],
10+
"ignore": []
1111
},
1212
"formatter": {
1313
"enabled": true,
1414
"indentStyle": "space",
15-
"indentWidth": 2,
15+
"indentWidth": 2
1616
},
1717
"organizeImports": {
18-
"enabled": true,
18+
"enabled": true
1919
},
2020
"linter": {
2121
"enabled": true,
2222
"rules": {
2323
"recommended": true,
2424
"correctness": {
2525
"noUnusedImports": "error",
26-
"noUnnecessaryContinue": "error",
26+
"noUnnecessaryContinue": "error"
2727
},
2828
"suspicious": {
29-
"noConstEnum": "error",
30-
},
31-
},
29+
"noConstEnum": "error"
30+
}
31+
}
3232
},
3333
"javascript": {
3434
"formatter": {
35-
"quoteStyle": "double",
36-
},
37-
},
38-
}
35+
"quoteStyle": "double"
36+
}
37+
}
38+
}

bun.lockb

141 KB
Binary file not shown.

drizzle.config.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from "drizzle-kit";
2+
if (!process.env.DATABASE_URL) throw new Error("DATABASE_URL is not set");
3+
4+
export default defineConfig({
5+
schema: "./src/lib/server/db/schema.ts",
6+
7+
dbCredentials: {
8+
url: process.env.DATABASE_URL,
9+
},
10+
11+
verbose: true,
12+
strict: true,
13+
dialect: "sqlite",
14+
});

package.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "how-match",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build",
9+
"preview": "vite preview",
10+
"prepare": "svelte-kit sync || echo ''",
11+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13+
"db:push": "drizzle-kit push",
14+
"db:migrate": "drizzle-kit migrate",
15+
"db:studio": "drizzle-kit studio"
16+
},
17+
"devDependencies": {
18+
"@fontsource/fira-mono": "^5.0.0",
19+
"@neoconfetti/svelte": "^2.0.0",
20+
"@sveltejs/adapter-cloudflare": "^5.0.1",
21+
"@sveltejs/kit": "^2.16.0",
22+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
23+
"@tailwindcss/container-queries": "^0.1.1",
24+
"@tailwindcss/forms": "^0.5.10",
25+
"@tailwindcss/typography": "^0.5.16",
26+
"autoprefixer": "^10.4.20",
27+
"drizzle-kit": "^0.30.2",
28+
"mdsvex": "^0.12.3",
29+
"svelte": "^5.0.0",
30+
"svelte-check": "^4.0.0",
31+
"tailwindcss": "^3.4.17",
32+
"typescript": "^5.0.0",
33+
"vite": "^6.0.0"
34+
},
35+
"dependencies": {
36+
"@libsql/client": "^0.14.0",
37+
"drizzle-orm": "^0.38.4"
38+
}
39+
}

postcss.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

src/app.css

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
@import 'tailwindcss/base';
2+
@import 'tailwindcss/components';
3+
@import 'tailwindcss/utilities';
4+
@import '@fontsource/fira-mono';
5+
6+
:root {
7+
--font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
8+
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
9+
--font-mono: 'Fira Mono', monospace;
10+
--color-bg-0: rgb(202, 216, 228);
11+
--color-bg-1: hsl(209, 36%, 86%);
12+
--color-bg-2: hsl(224, 44%, 95%);
13+
--color-theme-1: #ff3e00;
14+
--color-theme-2: #4075a6;
15+
--color-text: rgba(0, 0, 0, 0.7);
16+
--column-width: 42rem;
17+
--column-margin-top: 4rem;
18+
font-family: var(--font-body);
19+
color: var(--color-text);
20+
}
21+
22+
body {
23+
min-height: 100vh;
24+
margin: 0;
25+
background-attachment: fixed;
26+
background-color: var(--color-bg-1);
27+
background-size: 100vw 100vh;
28+
background-image: radial-gradient(
29+
50% 50% at 50% 50%,
30+
rgba(255, 255, 255, 0.75) 0%,
31+
rgba(255, 255, 255, 0) 100%
32+
),
33+
linear-gradient(180deg, var(--color-bg-0) 0%, var(--color-bg-1) 15%, var(--color-bg-2) 50%);
34+
}
35+
36+
h1,
37+
h2,
38+
p {
39+
font-weight: 400;
40+
}
41+
42+
p {
43+
line-height: 1.5;
44+
}
45+
46+
a {
47+
color: var(--color-theme-1);
48+
text-decoration: none;
49+
}
50+
51+
a:hover {
52+
text-decoration: underline;
53+
}
54+
55+
h1 {
56+
font-size: 2rem;
57+
text-align: center;
58+
}
59+
60+
h2 {
61+
font-size: 1rem;
62+
}
63+
64+
pre {
65+
font-size: 16px;
66+
font-family: var(--font-mono);
67+
background-color: rgba(255, 255, 255, 0.45);
68+
border-radius: 3px;
69+
box-shadow: 2px 2px 6px rgb(255 255 255 / 25%);
70+
padding: 0.5em;
71+
overflow-x: auto;
72+
color: var(--color-text);
73+
}
74+
75+
.text-column {
76+
display: flex;
77+
max-width: 48rem;
78+
flex: 0.6;
79+
flex-direction: column;
80+
justify-content: center;
81+
margin: 0 auto;
82+
}
83+
84+
input,
85+
button {
86+
font-size: inherit;
87+
font-family: inherit;
88+
}
89+
90+
button:focus:not(:focus-visible) {
91+
outline: none;
92+
}
93+
94+
@media (min-width: 720px) {
95+
h1 {
96+
font-size: 2.4rem;
97+
}
98+
}
99+
100+
.visually-hidden {
101+
border: 0;
102+
clip: rect(0 0 0 0);
103+
height: auto;
104+
margin: 0;
105+
overflow: hidden;
106+
padding: 0;
107+
position: absolute;
108+
width: 1px;
109+
white-space: nowrap;
110+
}

src/app.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// See https://svelte.dev/docs/kit/types#app.d.ts
2+
// for information about these interfaces
3+
declare global {
4+
namespace App {
5+
// interface Error {}
6+
// interface Locals {}
7+
// interface PageData {}
8+
// interface PageState {}
9+
// interface Platform {}
10+
}
11+
}
12+
13+
export {};

src/app.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover">
10+
<div style="display: contents">%sveltekit.body%</div>
11+
</body>
12+
</html>

src/lib/images/github.svg

+16
Loading

src/lib/images/svelte-logo.svg

+1
Loading

src/lib/images/svelte-welcome.png

352 KB
Loading

src/lib/images/svelte-welcome.webp

113 KB
Binary file not shown.

src/lib/server/db/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { drizzle } from "drizzle-orm/libsql";
2+
import { createClient } from "@libsql/client";
3+
import { env } from "$env/dynamic/private";
4+
if (!env.DATABASE_URL) throw new Error("DATABASE_URL is not set");
5+
const client = createClient({ url: env.DATABASE_URL });
6+
export const db = drizzle(client);

src/lib/server/db/schema.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { sqliteTable, integer } from "drizzle-orm/sqlite-core";
2+
3+
export const user = sqliteTable("user", {
4+
id: integer("id").primaryKey(),
5+
age: integer("age"),
6+
});

0 commit comments

Comments
 (0)