Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
massimobiagioli committed Apr 2, 2023
1 parent a936d57 commit 7b98c59
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
82 changes: 81 additions & 1 deletion README.md
@@ -1,10 +1,45 @@
# Svelte-Boilerplate

## Stack

- [SvelteKit](https://kit.svelte.dev/)
- [Supabase](https://supabase.com/)
- [Tailwind CSS](https://tailwindcss.com/)
- [daisyUI](https://daisyui.com/)

## Pre-requisites

- NodeJs
- A Supabase Account

## Environment variables

Duplicate the file `.env.example` and rename it to `.env`. Then, fill the variables with your own values.

This is the official link to the Supabase api keys documentation: [https://supabase.com/docs/guides/api/api-keys](https://supabase.com/docs/guides/api/api-keys)


## Prepare Supabase

### User

In order to use the authentication, you need to create a user with *email* provider.

### Table *'device'*

| column_name | data_type |
| ----------- | ------------------------ |
| id | bigint |
| name | character varying |
| address | character varying |
| description | text |
| created_at | timestamp with time zone |
| is_active | boolean |
| owner | uuid |

The file `supabase-dump/device.csv` contains some data to populate the table.
Replace the values of the column `owner` with your own values.

## Start local server

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
Expand All @@ -16,7 +51,52 @@ npm run dev
npm run dev -- --open
```

## Building
## Generate Supabase database types

```bash

# login to supabase
npm run supabase:login

# generate types
npm run supabase:generate:types
```

## Test

### Unit

```bash
npm run test:unit
```

### End-to-end

```bash
npm run test:e2e
```

## Code analysis, formatting and linting

### Format

```bash
npm run format
```

### Lint

```bash
npm run lint
```

### Check

```bash
npm run check
```

## Build for production

To create a production version of your app:

Expand Down
3 changes: 3 additions & 0 deletions supabase-dump/device.csv
@@ -0,0 +1,3 @@
"id","name","address","description","created_at","is_active","owner"
"2","First device","10.10.10.1","This is the first device","2023-03-18 20:19:18.307723+00","false","<user-uid>"
"3","Second device","10.10.10.2","This is the second device","2023-03-18 20:20:20.371118+00","false","<user-uid>"

1 comment on commit 7b98c59

@vercel
Copy link

@vercel vercel bot commented on 7b98c59 Apr 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.