Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emarifer/supabase-api-auth-crud
Full Stack App covering Auth flow & CRUD with Nodejs and Supabase and Frontend Solidjs with TypeScript.
https://github.com/emarifer/supabase-api-auth-crud
axios bcryptjs express-server expressjs jsonwebtoken nodejs solid-form-handler solidjs supabase-cli supabase-client supabase-db supabase-js tailwindcss typescript zod
Last synced: 27 days ago
JSON representation
Full Stack App covering Auth flow & CRUD with Nodejs and Supabase and Frontend Solidjs with TypeScript.
- Host: GitHub
- URL: https://github.com/emarifer/supabase-api-auth-crud
- Owner: emarifer
- License: mit
- Created: 2023-07-01T22:58:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-02T11:19:47.000Z (over 1 year ago)
- Last Synced: 2024-04-15T04:58:54.008Z (10 months ago)
- Topics: axios, bcryptjs, express-server, expressjs, jsonwebtoken, nodejs, solid-form-handler, solidjs, supabase-cli, supabase-client, supabase-db, supabase-js, tailwindcss, typescript, zod
- Language: TypeScript
- Homepage: https://sp-auth-crud.onrender.com/
- Size: 230 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tasks Manager App
### Full Stack App covering Auth flow & CRUD with Nodejs and Supabase and Frontend Solidjs with TypeScript
To run the application, you must first install the dependencies and compile the code, both backend and frontend:
```bash
$ npm i && npm run build && cd client/ && npm i && npm run build && cd.. # or pnpm or yarn install (without «run»)
```Secondly, you must add to the .env file the project credentials that you have created in Supabase.:
```bash
SUPABASE_URL_PROJECT=xxxx
SUPABASE_ANON_KEY=xxxx
```Once the backend and frontend are created, you can start the server (production mode) which will start at http://localhost:4000 with the command:
```bash
$ npm run dev # or pnpm dev or yarn dev
```In development mode, you must start the backend and frontend separately:
```bash
$ npm run dev # or pnpm dev or yarn dev# (another terminal in root folder)
$ cd client/ && npm run dev
```Obviously, it is necessary to have created a project in Supabase, as we said before, to add these credentials to our application. We must also create 2 tables in our database. For this we can create them manually with the requirements of our application or execute the migration files found in the "migrations" folder. Alternatively we can copy the content of these 2 files in the SQL Editor of our project in Supabase and execute the corresponding SQL query:
```bash
create table
public.users (
id uuid not null default gen_random_uuid (),
created_at timestamp with time zone not null default now(),
username text not null,
email text not null,
password text not null,
constraint user_pkey primary key (id),
constraint user_email_key unique (email)
) tablespace pg_default;# (and then)
create table
public.tasks (
id uuid not null default gen_random_uuid (),
created_at timestamp with time zone not null default now(),
title text not null,
completed boolean null default false,
description text not null,
user_id uuid not null,
constraint task_pkey primary key (id),
constraint task_user_id_fkey foreign key (user_id) references "user" (id)
) tablespace pg_default;
```## Deployment
We can deploy our application to some service like [Render](https://render.com/), taking care to set the Supabase credentials as environment variables in Render. The command to build the application would be:
```bash
$ cd client/ && npm i && export VITE_API_URL=[THE_URL_YOU_HAVE_CHOSEN_IN_RENDER/api] && npm run build && cd .. && npm i && npm run build
```And to start the server:
```bash
$ npm start
```