Skip to content

Commit

Permalink
fix: add tailcall
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Dec 28, 2023
1 parent 69d45a7 commit 1d3a5e8
Show file tree
Hide file tree
Showing 19 changed files with 498 additions and 38 deletions.
18 changes: 9 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
2 changes: 2 additions & 0 deletions apps/console/.graphqlrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ projects:
schema:
- ./schema.graphql
- ./$houdini/graphql/schema.graphql
# - ../../nhost/tailcall/jsonplaceholder.graphql
# - ../../nhost/tailcall/.tailcallrc.graphql
documents:
- '**/*.gql'
- '**/*.svelte'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/* custom theme font */
@import '@fontsource-variable/inter';
/* @import '@fontsource-variable/inter' layer(base) */

@tailwind base;
@tailwind components;
Expand Down
2 changes: 1 addition & 1 deletion apps/console2/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import '../app.postcss';
import '../app.pcss';
import { AppShell, AppBar, storePopup } from '@skeletonlabs/skeleton';
// Floating UI for Popups
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/Stats.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import pieImage from '@assets/pie.svg';
Nobis minus voluptatibus pariatur dignissimos libero quaerat iure expedita at?
Asperiores nemo possimus nesciunt dicta veniam aspernatur quam mollitia. <br />
<br /> Vitae error, quaerat officia delectus voluptatibus explicabo quo pariatur
impedit, at reprehenderit aliquam a ipsum quas voluptatem. Quo pariatur
asperiores eum amet.
impedit, at reprehenderit aliquam a ipsum quas voluptatem. Quo pariatur asperiores
eum amet.
</p>
<div class="space-y-4 divide-y divide-gray-100 dark:divide-gray-800">
<div class="mt-8 flex gap-4 md:items-center">
Expand Down
4 changes: 2 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ services:
environment:
NODE_ENV: production
ORIGIN: http://localhost:3000
# NEXTAUTH_URL: http://localhost:3000
# AUTH_TRUST_HOST: true
# NEXTAUTH_URL: http://localhost:3000
# AUTH_TRUST_HOST: true
PUBLIC_GRAPHQL_ENDPOINT: http://0.0.0.0:8080/v1/graphql
ports:
- 3000:3000
Expand Down
17 changes: 9 additions & 8 deletions docs/astro.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Astro

**Astro** is an *all-in-one web framework* for building *fast, content-focused* websites.
**Astro** is an _all-in-one web framework_ for building _fast, content-focused_ websites.

## Setup

### Prerequisites
### Prerequisites

- **Node.js** - v20.6.0 or higher.
- **pnpm**
- Astro VSCode Extention - [astro-build.astro-vscode](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)
- **pnpm**
- Astro VSCode Extention - [astro-build.astro-vscode](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)

### Create Project

```shell
# create a new project with pnpm
pnpm create astro@latest

#
#
pnpm astro add svelte tailwind partytown
pnpm astro add starlight
```

#### Add optional integrations

See optional addable [integrations](https://docs.astro.build/en/guides/integrations-guide/svelte/)
See optional addable [integrations](https://docs.astro.build/en/guides/integrations-guide/svelte/)

```shell
pnpm astro add svelte tailwind partytown
pnpm astro add starlight
Expand All @@ -40,6 +40,7 @@ prettier --write . --plugin=prettier-plugin-astro
```

Add [eslint-plugin-astro](https://ota-meshi.github.io/eslint-plugin-astro/user-guide/)

```shell
pnpm add -D eslint-plugin-astro --filter "eslint-config-custom"
```
Expand All @@ -50,7 +51,7 @@ pnpm add -D eslint-plugin-astro --filter "eslint-config-custom"
pnpm run dev
```


## Referencwe

- [Astro Launchpad](https://github.com/kyr0/astro-launchpad/tree/main) - Astro monorepo with vercel, turbo
- [Turbo Hybrid Astro on Vercel](https://github.com/kyr0/turbo-hybrid-astro-on-vercel/tree/main)
2 changes: 1 addition & 1 deletion docs/awesome-sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Awesome **SvelteKit** Links
- [Svelte 3.5 + Storybook 7 + TailwindCSS 3](https://github.com/jerriclynsjohn/svelte-storybook-tailwind)
- [Svelte offline SQLite ](https://github.com/phartenfeller/sveltekit-1.0-sqlite-demo-app)
- [Svelte runes + Liveblocks demo](https://github.com/CTNicholas/svelte-runes-realtime-drawing)
- [shadcn-svelte, Superforms sample project](https://github.com/delay/sveltekit-auth)
- [shadcn-svelte, Superforms sample project](https://github.com/delay/sveltekit-auth)

## Deployment

Expand Down
1 change: 1 addition & 0 deletions docs/datamodeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This document provide guidelines when creating tables in **PostgreSQL** database
## Style guide

### Best Practices

- Use lower-case names for tables. E.g. `customers` instead of `Customers`.
- Use plural names for tables. E.g. `customers` instead of `customer`.
- use underscore (`_`) instead of camelCase for table names. E.g. `customer_invoices` instead of `customerInvoices`.
Expand Down
17 changes: 10 additions & 7 deletions docs/micro-frontends.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Micro-Frontends
# Micro-Frontends

> You (probably) don't need Micro-Frontends
This is the "Distributed and Decoupled Spectrum"
This is the "Distributed and Decoupled Spectrum"

Make sure that you explore all the other options before trying to implement a fully distributed system

![The Evolution of Micro Frontends](./images/micro-frontends-evolution.jpeg 'Title')

## The Evolution of Micro Frontends
## The Evolution of Micro Frontends

### Monolith Micro-Frontends

Let's start with the Monolith.

Either a backend and frontend together or a frontend monolith connecting to APIs.

Great for solo devs and small teams.
Great for solo devs and small teams.

Monoliths can definitely scale to millions of users

Expand All @@ -26,7 +28,7 @@ However, the application still has to be deployed as a single unit.

### Integrated Applications

They could be developed and deployed independently but often there is an integration step at build time where all the pieces come together and get deployed as a single unit.
They could be developed and deployed independently but often there is an integration step at build time where all the pieces come together and get deployed as a single unit.

Monorepos are a great tool for integrated applications.

Expand All @@ -44,5 +46,6 @@ This type allows you to compose vertically and horizontally. The app works and f

There is no full page refresh, the perfect balance of UX and DX.

## Reference
- [The Evolution of Micro Frontends ](https://twitter.com/Infoxicador/status/1606382229764116483) by Ruben Casas, [Video](https://www.youtube.com/watch?v=MGpTUx8MKMY)
## Reference

- [The Evolution of Micro Frontends ](https://twitter.com/Infoxicador/status/1606382229764116483) by Ruben Casas, [Video](https://www.youtube.com/watch?v=MGpTUx8MKMY)
3 changes: 2 additions & 1 deletion docs/playbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In this Playbook, we will be using [svelte-add](https://github.com/svelte-add/sv

### Workspace

[dotenv-run](https://github.com/chihab/dotenv-run) helps loading *nested* `.env` files in monorepo.
[dotenv-run](https://github.com/chihab/dotenv-run) helps loading _nested_ `.env` files in monorepo.

```shell
# pnpm add -D dotenv-cli -w
Expand Down Expand Up @@ -238,6 +238,7 @@ And follow **skeleton** specific sveltekit [changes](https://www.skeleton.dev/gu
pnpm add -D tailwind-variants clsx tailwind-merge --filter "./apps/console3"
pnpm add -D mode-watcher --filter "./apps/web"
```

### UI Blocks

- [Kometa UI Kit](https://kitwind.io/products/kometa) (Free) [Blocks](https://kitwind.io/products/kometa/components)
Expand Down
10 changes: 6 additions & 4 deletions docs/starlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

## Setup

### Prerequisites
### Prerequisites

- **Node.js** - v20.6.0 or higher.
- **pnpm**
- Astro VSCode Extention - [astro-build.astro-vscode](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)
- **pnpm**
- Astro VSCode Extention - [astro-build.astro-vscode](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)

### Create Project

Expand All @@ -20,19 +20,21 @@ pnpm astro add starlight
# create a new project with an official example
pnpm create astro@latest --template starlight/tailwind




pnpm astro add svelte tailwind partytown
https://docs.astro.build/en/guides/integrations-guide/svelte/
```

Add other tools `Prettier` `ESLint `

```shell
pnpm add -D prettier prettier-plugin-astro -w
# use
prettier --write . --plugin=prettier-plugin-astro
```

## Start

```shell
Expand Down
58 changes: 58 additions & 0 deletions docs/tailcall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# tailcall

[tailcall](https://tailcall.run/) is used as `API Gateway` to unify **REST**, **GraphQL** and **gRPC** backend APIs into single endpoint.

## Usage

### Check

```shell
tailcall check nhost/tailcall/jsonplaceholder.graphql
tailcall check nhost/tailcall/graphql-composition.graphql
```

### Start

```shell
tailcall start nhost/tailcall/jsonplaceholder.graphql
# (or)
TAILCALL_LOG_LEVEL=info tailcall start nhost/tailcall/jsonplaceholder.graphql
```

### Query

Open `http://127.0.0.1:8000/` and query

```gql
query {
users {
id
name
posts {
title
}
}
}
```

```gql
query {
user(id: 1) {
id
name
posts {
title
}
}
}
```

```gql
query {
posts {
id
title
body
}
}
```
2 changes: 1 addition & 1 deletion docs/turborepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ npx turbo link
### App Environment Variables

> Turbo is working on [first-class solution](https://turbo.build/repo/docs/handbook/dev#using-environment-variables) to load **dotEnv** files.
Meanwhile we recommend using a library called [dotenv-run](https://github.com/chihab/dotenv-run) to solve this problem.
> Meanwhile we recommend using a library called [dotenv-run](https://github.com/chihab/dotenv-run) to solve this problem.
~~turbo automatically include environment variables from `.env` , `.secrets` as we set them at `globalDotEnv` in `turbo.json`~~

Expand Down
2 changes: 1 addition & 1 deletion docs/vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ this guide will walk you through the steps to automate deployments via tags inst
[Can you deploy based on tags/releases on Vercel?](https://vercel.com/guides/can-you-deploy-based-on-tags-releases-on-vercel)

### Manual Deploy

```shell
vercel deploy --prod
```


## Environment Variables

Vercel provides a set of [System Environment Variables](https://vercel.com/docs/projects/environment-variables/system-environment-variables) that are automatically populated by the System, such as the URL of the Deployment or the name of the Git branch deployed. e.g.,:
Expand Down
Loading

0 comments on commit 1d3a5e8

Please sign in to comment.