Server
The server backend is built on top of Supabase, which provides infrastructure for database, file storage, user authentication, serverless functions and more.
Local development requires running a self-managed supabase instance using docker containers. Serverless functions are run using a Deno runtime environment
Prerequisites
Quickstart
Start Server
yarn start:server
This will start various backend services within docker containers
Feature | URI |
---|---|
Studio | http://localhost:54323 |
API | http://localhost:54321 |
DB | postgresql://postgres:postgres@localhost:54322/postgres |
GraphQL | http://localhost:54321/graphql/v1 |
Inbucket | http://localhost:54324 |
Frontend Config
In order for frontend apps to communicate with the server an anon key
created by the server must be populated to local configuration.
This key can be found in the console when the server starts, or by running the script
yarn nx run picsa-server:supabase status
This key should be populated to libs\environments\src\supabase\config.json
Create User
In order to allow communication from unauthenticated users to the database a custom anonymous user should be created from the studio dashboard with credentials:
http://localhost:54323/project/default/auth/users
email: anonymous_user@picsa.app
password: anonymous_user@picsa.app
Ensure Auto Confirm is checked
Stop Server
When no longer in use the server can be stopped by either stopping the container running in docker desktop, or by command
yarn nx run picsa-server:supabase stop