-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
242 additions
and
29 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[workspace] | ||
resolver = "2" | ||
|
||
members = ["binaries/rave-app-backend", "crates/rave-api", "crates/rave-embedded-database", "crates/rave-entity"] | ||
members = ["binaries/rave-app-backend", "crates/rave-api", "crates/rave-api-service-database", "crates/rave-api-service-iam", "crates/rave-embedded-database", "crates/rave-entity", "crates/rave-api-graphql", "crates/rave-api-service-feed-provider"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Auth0 Setup Guide | ||
This guide walks you through setting up your Auth0 tenant to use with the template's authentication feature. | ||
|
||
## Prerequisites | ||
- An Auth0 account (you can sign up at [auth0.com](https://auth0.com)) | ||
- Access to your Auth0 dashboard | ||
|
||
## Setup Steps | ||
|
||
### 1. Create a New API | ||
1. In your Auth0 dashboard, go to `Applications > APIs` | ||
2. Click `+ Create API` | ||
3. Fill in the following: | ||
- Name: (your preferred name) | ||
- Identifier (Audience): keep the default value or use your own domain if you want | ||
4. Save the API Identifier (Audience) - you'll need this later (you can find it under the "settings" section of your application like in the picture below) | ||
|
||
![Auth0 API Identifier](./images/auth0-api-identifier.png) | ||
|
||
### 2. Create Application | ||
1. Go to `Applications > Applications` | ||
2. Click `+ Create Application` | ||
3. Select `Single Page Application` | ||
4. Name it `Rave Frontend` (or your preferred name) | ||
5. Go to the application settings | ||
|
||
### 3. Configure Application Settings | ||
1. Under `Application Properties`: | ||
- Note down the `Client ID` | ||
- Note down the `Client Secret` | ||
- Note down the `Domain` | ||
2. Under `Application URIs`: | ||
- Allowed Callback URLs: `http://localhost:3000/callback` | ||
- Allowed Logout URLs: `http://localhost:3000` | ||
- Allowed Web Origins: `http://localhost:3000` | ||
|
||
### 4. Configure Environment Variables | ||
Add the following environment variables to your backend: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Database Setup | ||
The application supports two database configurations: | ||
- Embedded PostgreSQL (for development) | ||
- External PostgreSQL (recommended for production) | ||
|
||
## Option 1: Embedded Database | ||
|
||
The embedded database is a PostgreSQL instance that runs within the application. While convenient for development and testing, it is **not recommended for production use**. | ||
|
||
### Quick Start | ||
```bash | ||
cargo run --features embedded-database -- --embedded_database=<database_name> | ||
``` | ||
|
||
> **Note:** When using the embedded database: | ||
> - The `DATABASE_URL` environment variable is ignored | ||
> - Data persists between restarts in the specified database file | ||
> - The migrations are embedded in the application binary and will be run at startup | ||
## Option 2: External Database | ||
|
||
For production deployments, using an external PostgreSQL database is recommended. | ||
|
||
### Prerequisites | ||
- PostgreSQL server (v16 or higher) | ||
- Rust toolchain with `sqlx` CLI | ||
- `.env` file in project root | ||
|
||
### Setup Steps | ||
1. Configure your database connection: | ||
```bash | ||
# In your .env file | ||
DATABASE_URL="postgresql://user:password@localhost:5432/dbname" | ||
``` | ||
|
||
2. Run database migrations: | ||
```bash | ||
sqlx migrate run | ||
``` | ||
> **Note:** It's possible to embed database migrations and run them with the application, but this is not recommended for production. | ||
3. Start the application: | ||
```bash | ||
cargo run | ||
``` |