Skip to content

Commit

Permalink
Merge pull request #27 from loup-brun/feat-db-baserow
Browse files Browse the repository at this point in the history
Feat: file or baserow DB

cleanup code, better document variables

a few small bugfixes

refactor: simplify codebase and remove many internal routes

redo demo data

db.js => db.json
  • Loading branch information
loup-brun authored Jul 9, 2024
2 parents 46edd7e + 05e5756 commit 61227bf
Show file tree
Hide file tree
Showing 32 changed files with 2,221 additions and 1,536 deletions.
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Database storage type
# Available values are: file,baserow
DB_TYPE="file"

# Baserow instance URL, without the ending slash
# e.g. https://baserow.io
BASEROW_URL=""
BASEROW_DATABASE_ID=""
BASEROW_INSTANCE_ROW_ID=""
BASEROW_INSTANCE_TABLE_ID=""
BASEROW_MEETS_TABLE_ID=""
BASEROW_TOKEN=""
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ Quelques points clés :
- configurable (pour s’harmoniser avec le contexte de chaque événement, comme l’a fait [Benoit](https://github.com/vermetteb/) pour Sherbrooke);
- _progressive enhancement_ – augmenter l’expérience de base sans lui nuire.

## Installation

Requirements:

- [Node.js](https://nodejs.org/) (current LTS version, v18+ recommended) and its package manager (npm, [pnpm](https://pnpm.io/), [yarn](https://yarnpkg.com/), ...)
- Web hosting provider compatible with a [SvelteKit](https://kit.svelte.dev/) app, such as Cloudflare Pages, Vercel, Netlify, etc.

### Environment variables

All environment variables _must_ be set, even when empty.

- **DB_TYPE**: `file` | `baserow` (more to come in the future)
- `file`: file-based storage within the repository. The storage file is located at `src/lib/db.json` (path is not configurable at this time).
- `baserow`: a Baserow instance (cloud-hosted at baserow.io or self-hosted) is required. See the [template demo information](https://github.com/loup-brun/better-web-hytek/pull/27#issuecomment-2218038896).
- **BASEROW_URL**: Baserow instance URL, without the ending slash, e.g. `https://baserow.io`
- **BASEROW_DATABASE_ID**: number, e.g. 123
- **BASEROW_INSTANCE_ROW_ID**: number, e.g. 1
- **BASEROW_INSTANCE_TABLE_ID**: number, e.g. 1234
- **BASEROW_MEETS_TABLE_ID**: number, e.g. 5678
- **BASEROW_TOKEN**: string, e.g. A12bC3D4e5

## Ideas

- improve overall ergonomy and respond to device screen size
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
"preview": "vite preview"
},
"devDependencies": {
"@rgossiaux/svelte-headlessui": "^1.0.0",
"@sveltejs/adapter-vercel": "^2.0.2",
"@sveltejs/kit": "~1.5.2",
"@rgossiaux/svelte-headlessui": "^2.0.0",
"@sveltejs/adapter-vercel": "^4.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"autoprefixer": "^10.4.7",
"carbon-icons-svelte": "11",
"postcss": "^8.4.13",
"postcss-nesting": "^11.0.0",
"svelte": "^3.55.1",
"svelte": "^4.2.18",
"tailwindcss": "^3.2.4",
"vite": "^4.0.4"
"vite": "^5.0.0"
},
"type": "module"
}
}
Loading

0 comments on commit 61227bf

Please sign in to comment.