Skip to content

Commit

Permalink
chore: ssr search
Browse files Browse the repository at this point in the history
  • Loading branch information
gaboesquivel committed Apr 11, 2024
1 parent 1abf5a4 commit 99b24d3
Show file tree
Hide file tree
Showing 143 changed files with 2,830 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/hasura/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# local env files
.env*.local
13 changes: 13 additions & 0 deletions apps/hasura/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# * Downgrade to hasura/graphql-engine:v2.17.0.cli-migrations-v3 if build versioning issues
FROM hasura/graphql-engine:latest.cli-migrations-v3

ENV HASURA_GRAPHQL_MIGRATIONS_DIR=/migrations
ENV HASURA_GRAPHQL_METADATA_DIR=/metadata
COPY ./metadata /metadata
COPY ./migrations /migrations

# ? Use enviroment variables to configure hasura server
# ? https://hasura.io/docs/latest/graphql/core/deployment/graphql-engine-flags/reference/



6 changes: 6 additions & 0 deletions apps/hasura/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 3
endpoint: http://localhost:8080
metadata_directory: metadata
actions:
kind: synchronous
handler_webhook_baseurl: http://localhost:3000
Empty file.
6 changes: 6 additions & 0 deletions apps/hasura/metadata/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
actions: []
custom_types:
enums: []
input_objects: []
objects: []
scalars: []
1 change: 1 addition & 0 deletions apps/hasura/metadata/allow_list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions apps/hasura/metadata/api_limits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions apps/hasura/metadata/backend_configs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions apps/hasura/metadata/cron_triggers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
9 changes: 9 additions & 0 deletions apps/hasura/metadata/databases/databases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: masterbots
kind: postgres
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
isolation_level: read-committed
use_prepared_statements: false
tables: "!include masterbots/tables/tables.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
table:
name: category
schema: public
array_relationships:
- name: chatbots
using:
foreign_key_constraint_on:
column: category_id
table:
name: chatbot_category
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- category_id
- name
filter: {}
comment: ""
- role: user
permission:
columns:
- category_id
- name
filter: {}
comment: ""
29 changes: 29 additions & 0 deletions apps/hasura/metadata/databases/masterbots/tables/public_chat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
table:
name: chat
schema: public
object_relationships:
- name: chatbot
using:
foreign_key_constraint_on: chatbot_id
- name: user
using:
foreign_key_constraint_on: added_by
select_permissions:
- role: anonymous
permission:
columns:
- chatbot_id
- chat_id
- conversation_link
- added_by
filter: {}
comment: ""
- role: user
permission:
columns:
- chatbot_id
- chat_id
- conversation_link
- added_by
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
table:
name: chatbot
schema: public
array_relationships:
- name: categories
using:
foreign_key_constraint_on:
column: chatbot_id
table:
name: chatbot_category
schema: public
- name: chats
using:
foreign_key_constraint_on:
column: chatbot_id
table:
name: chat
schema: public
- name: preferences
using:
foreign_key_constraint_on:
column: chatbot_id
table:
name: preference
schema: public
- name: prompts
using:
foreign_key_constraint_on:
column: chabot_id
table:
name: prompt_chatbot
schema: public
- name: threads
using:
foreign_key_constraint_on:
column: chatbot_id
table:
name: thread
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- chatbot_id
- avatar
- created_by
- default_complexity
- default_length
- default_tone
- default_type
- description
- name
filter: {}
comment: ""
- role: user
permission:
columns:
- chatbot_id
- avatar
- created_by
- default_complexity
- default_length
- default_tone
- default_type
- description
- name
filter: {}
allow_aggregations: true
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
table:
name: chatbot_category
schema: public
object_relationships:
- name: category
using:
foreign_key_constraint_on: category_id
- name: chatbot
using:
foreign_key_constraint_on: chatbot_id
select_permissions:
- role: anonymous
permission:
columns:
- category_id
- chatbot_id
filter: {}
comment: ""
- role: user
permission:
columns:
- category_id
- chatbot_id
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
table:
name: complexity_enum
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- value
filter: {}
comment: ""
- role: user
permission:
columns:
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table:
name: default_complexity_enum
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table:
name: default_length_enum
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table:
name: default_tone_enum
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
table:
name: default_type_enum
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
table:
name: gpt_chat
schema: public
object_relationships:
- name: chatbot
using:
foreign_key_constraint_on: chatbot_id
- name: user
using:
foreign_key_constraint_on: added_by
select_permissions:
- role: anonymous
permission:
columns:
- added_by
- chatbot_id
- chat_id
- conversation_link
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
table:
name: length_enum
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- value
filter: {}
comment: ""
- role: user
permission:
columns: []
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
table:
name: message
schema: public
object_relationships:
- name: thread
using:
foreign_key_constraint_on: thread_id
insert_permissions:
- role: user
permission:
check:
thread:
user_id:
_eq: X-Hasura-User-Id
columns:
- content
- role
- created_at
- message_id
- thread_id
comment: ""
select_permissions:
- role: anonymous
permission:
columns:
- content
- created_at
- message_id
- thread_id
- role
filter: {}
comment: ""
- role: user
permission:
columns:
- content
- role
- created_at
- message_id
- thread_id
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
table:
name: message_type_enum
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- value
filter: {}
comment: ""
- role: user
permission:
columns:
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
table:
name: preference
schema: public
object_relationships:
- name: chatbot
using:
foreign_key_constraint_on: chatbot_id
insert_permissions:
- role: user
permission:
check:
user_id:
_eq: X-Hasura-User-Id
columns:
- chatbot_id
- favorite
- preferred_complexity
- preferred_length
- preferred_tone
- preferred_type
- user_id
comment: ""
select_permissions:
- role: user
permission:
columns:
- favorite
- chatbot_id
- preference_id
- preferred_complexity
- preferred_length
- preferred_tone
- preferred_type
- user_id
filter:
user_id:
_eq: X-Hasura-User-Id
comment: ""
Loading

0 comments on commit 99b24d3

Please sign in to comment.