Remove hasura and hasura-auth (#134)
* Remove hasura and hasura-auth * Move all models to prisma * Start implementing graphql * chore: clean package json * chore: make the code build * chore: get initial graphql.tsx file * feature: use typegql as qgl server * refactor: small refactoring * refactor: clean tests * bugfix: make all filters not case sensitive * chore: remove unused imports --------- Co-authored-by: Sammy Teillet <sammy.teillet@gmail.com>
This commit is contained in:
@ -30,11 +30,3 @@ front-storybook: ##
|
||||
|
||||
front-graphql-generate: ##
|
||||
@docker-compose exec twenty-front sh -c "npm run graphql-generate"
|
||||
|
||||
## Hasura
|
||||
|
||||
hasura-logs: ##
|
||||
@docker-compose logs twenty-hasura -f
|
||||
|
||||
hasura-sh: ##
|
||||
@docker-compose exec twenty-hasura sh
|
||||
|
||||
@ -10,69 +10,11 @@ services:
|
||||
environment:
|
||||
REACT_APP_API_URL: ${FRONT_REACT_APP_API_URL}
|
||||
REACT_APP_AUTH_URL: ${FRONT_REACT_APP_AUTH_URL}
|
||||
HASURA_GRAPHQL_ENDPOINT: ${FRONT_HASURA_GRAPHQL_ENDPOINT}
|
||||
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
|
||||
volumes:
|
||||
- ../../front:/app/front
|
||||
- twenty_node_modules_front:/app/front/node_modules
|
||||
depends_on:
|
||||
- postgres
|
||||
twenty-hasura:
|
||||
build: ./hasura
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "9695:9695"
|
||||
- "9693:9693"
|
||||
volumes:
|
||||
- ../../hasura:/hasura
|
||||
- /hasura/entrypoints
|
||||
depends_on:
|
||||
- "postgres"
|
||||
restart: always
|
||||
environment:
|
||||
HASURA_GRAPHQL_METADATA_DATABASE_URL: ${HASURA_GRAPHQL_METADATA_DATABASE_URL}
|
||||
HASURA_GRAPHQL_PG_DATABASE_URL: ${HASURA_GRAPHQL_PG_DATABASE_URL}
|
||||
HASURA_GRAPHQL_ENABLE_CONSOLE: "false"
|
||||
HASURA_GRAPHQL_DEV_MODE: "true"
|
||||
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
|
||||
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
|
||||
HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET}
|
||||
HASURA_EVENT_HANDLER_URL: ${HASURA_EVENT_HANDLER_URL}
|
||||
hasura-auth:
|
||||
image: nhost/hasura-auth:0.19.1
|
||||
ports:
|
||||
- "4000:4000"
|
||||
environment:
|
||||
HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET}
|
||||
HASURA_GRAPHQL_DATABASE_URL: ${HASURA_GRAPHQL_PG_DATABASE_URL}
|
||||
HASURA_GRAPHQL_GRAPHQL_URL: ${HASURA_AUTH_GRAPHQL_URL}
|
||||
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
|
||||
AUTH_JWT_CUSTOM_CLAIMS: '{"workspace-id":"workspace_member.workspace_id"}'
|
||||
npm_package_version: '0'
|
||||
AUTH_SMTP_HOST: mailhog
|
||||
AUTH_SMTP_PORT: 1025
|
||||
AUTH_SERVER_URL: ${HASURA_AUTH_SERVER_URL}
|
||||
AUTH_CLIENT_URL: ${HASURA_AUTH_CLIENT_URL}
|
||||
AUTH_PROVIDER_GOOGLE_ENABLED: "true"
|
||||
AUTH_PROVIDER_GOOGLE_CLIENT_ID: ${HASURA_AUTH_PROVIDER_GOOGLE_CLIENT_ID}
|
||||
AUTH_PROVIDER_GOOGLE_CLIENT_SECRET: ${HASURA_AUTH_PROVIDER_GOOGLE_CLIENT_SECRET}
|
||||
AUTH_PROVIDER_GOOGLE_SCOPE: email,profile
|
||||
depends_on:
|
||||
- "twenty-hasura"
|
||||
- "postgres"
|
||||
- "mailhog"
|
||||
mailhog:
|
||||
image: jcalonso/mailhog
|
||||
environment:
|
||||
SMTP_HOST: mailhog
|
||||
SMTP_PORT: 1025
|
||||
SMTP_PASS: smtp-secret
|
||||
SMTP_USER: smtp-user
|
||||
SMTP_SECURE: "false"
|
||||
SMTP_SENDER: auth@localhost
|
||||
ports:
|
||||
- "1025:1025"
|
||||
- "8025:8025"
|
||||
twenty-server:
|
||||
build:
|
||||
context: ../..
|
||||
@ -83,7 +25,6 @@ services:
|
||||
- ../../server:/app/server
|
||||
- twenty_node_modules_server:/app/server/node_modules
|
||||
environment:
|
||||
HASURA_EVENT_HANDLER_SECRET_HEADER: ${SERVER_HASURA_EVENT_HANDLER_SECRET_HEADER}
|
||||
SERVER_DATABASE_URL: ${SERVER_DATABASE_URL}
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
FROM hasura/graphql-engine:latest as api
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y curl
|
||||
RUN apt-get install -y socat
|
||||
RUN apt-get install -y vim
|
||||
RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
|
||||
|
||||
WORKDIR /hasura
|
||||
|
||||
RUN mkdir entrypoints
|
||||
COPY ./entrypoint.sh ./entrypoints/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["entrypoints/entrypoint.sh"]
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
graphql-engine serve &
|
||||
echo "Waiting for Hasura to be ready..."
|
||||
|
||||
while ! curl -s http://localhost:8080/healthz > /dev/null ; do
|
||||
sleep 1
|
||||
echo "Waiting for Hasura to be ready..."
|
||||
done
|
||||
|
||||
sleep 1
|
||||
|
||||
hasura deploy
|
||||
|
||||
socat TCP-LISTEN:9695,fork,reuseaddr,bind=twenty-hasura TCP:127.0.0.1:9695 &
|
||||
socat TCP-LISTEN:9693,fork,reuseaddr,bind=twenty-hasura TCP:127.0.0.1:9693 &
|
||||
hasura console --log-level DEBUG --address "127.0.0.1" --no-browser &
|
||||
|
||||
wait
|
||||
@ -1,17 +1 @@
|
||||
CREATE DATABASE "default";
|
||||
CREATE DATABASE hasura;
|
||||
|
||||
-- From: https://raw.githubusercontent.com/nhost/hasura-auth/main/docker/initdb.d/0001-create-schema.sql
|
||||
\c default;
|
||||
-- auth schema
|
||||
CREATE SCHEMA IF NOT EXISTS auth;
|
||||
-- https://github.com/hasura/graphql-engine/issues/3657
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
|
||||
CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
|
||||
CREATE OR REPLACE FUNCTION public.set_current_timestamp_updated_at() RETURNS trigger LANGUAGE plpgsql AS $$
|
||||
declare _new record;
|
||||
begin _new := new;
|
||||
_new."updated_at" = now();
|
||||
return _new;
|
||||
end;
|
||||
$$;
|
||||
Reference in New Issue
Block a user