Skip to content

Commit

Permalink
added drizzle commands
Browse files Browse the repository at this point in the history
updated README with proper instructions
moved the drizzle schema file to `src/lib`
  • Loading branch information
d3rpp committed Aug 4, 2024
1 parent a6576a9 commit 9b1b321
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 23 deletions.
71 changes: 68 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,69 @@
# BSE 205 - Elective Project
<h1>BSE 205 - Elective Project</h1>

- [The Stack](#the-stack)
- [Building](#building)
- [Project Structure](#project-structure)

# The Stack

I was aiming for a "*soydev*" stack, I think I've got it.

- [SvelteKit](https://kit.svelte.dev)
- [DrizzleORM](https://orm.drizzle.team/)
- [Bun SQLite](https://bun.sh/docs/api/sqlite)
- [@shadcn/ui (svelte port)](https://www.shadcn-svelte.com/)

# Building

To build this project you will need to install the following dependency programs on your machine:

- [Bun](https://bun.sh) - https://bun.sh/

[Bun](https://bun.sh) is a Javascript runtime that is better suited to the task at hand than NodeJS seems to be, whilst remaining mostly compatible (or at least, compatible enough to run Vite).

Before running, building, or doing anything with this project, you will need to install it's dependencies, this can be done with:

```sh
bun install
```

You can start the application in development with Hot Module Reloading (HMR), and auto-restarting with:

```sh
bun run dev
```

If you'd like to create a production-ready build, run the following commands.

```sh
# Create static build, project is configured to build for bun
bun run build
# Run the build, should be done in a docker container
bun ./build/index.js
```

# Project Structure

```py
(project root)
├── src
│   ├── contrib
│   │   └── # code to establish a database
│   ├── lib
│   │   ├── components
│   │   │   └── # shadcn components
│   │   ├── crypto
│   │   │   └── # modules for handling cryptography
│   │   ├── drizzle.ts # database schemas
│   │   └── server
│   │      └── # server only modules
│   ├── routes
│   │   └── # application front-end structure
│   └── test
│   └── # automated tests for testing cryptography modules
├── drizzle
│   └── # database migration history
└── static
└── # static assets
```

> [!NOTE]
> Add build instructions
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"lint": "eslint .",
"fmt": "prettier --write .",
"fmt:check": "prettier --check .",
"generate": "drizzle-kit generate --dialect sqlite --schema ./src/contrib/schema.ts",
"migrate": "bun ./src/contrib/migrate.ts"
"drizzle:generate": "drizzle-kit generate --dialect sqlite --schema ./src/contrib/schema.ts",
"drizzle:migrate": "bun ./src/contrib/migrate.ts"
},
"devDependencies": {
"@sveltejs/kit": "^2.0.0",
Expand Down
17 changes: 0 additions & 17 deletions src/contrib/schema.ts

This file was deleted.

Empty file added src/lib/crypto/index.ts
Empty file.
18 changes: 17 additions & 1 deletion src/lib/drizzle.ts
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
export * from "../contrib/schema";
// import {
// type InferSelectModel,
// type InferInsertModel,
// sql
// } from "drizzle-orm";

// import {
// blob,
// sqliteTable,
// text,
// real,
// numeric,
// integer,
// foreignKey,
// } from "drizzle-orm/sqlite-core";

export {}

0 comments on commit 9b1b321

Please sign in to comment.