Compare commits
2 Commits
650ddaa601
...
feat/blog
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d501b66c11 | ||
|
|
dc1b552ac1 |
@@ -1,4 +1,3 @@
|
||||
**/target/
|
||||
**/.git
|
||||
**/.env
|
||||
**/.idea
|
||||
**/.env
|
||||
@@ -1,2 +1,2 @@
|
||||
CLOUDFLARE_API_TOKEN=
|
||||
NEON_API_TOKEN=
|
||||
NEON_API_KEY=
|
||||
4
.github/CODEOWNERS
vendored
@@ -3,13 +3,13 @@
|
||||
/apps/ @victorpahuus @AquaWolf
|
||||
/packages/ui/ @wanjohiryan @victorpahuus @AquaWolf
|
||||
|
||||
/protobufs/ @AquaWolf @DatCaptainHorse
|
||||
/protobuf/ @AquaWolf
|
||||
|
||||
/infra/ @wanjohiryan
|
||||
/packages/core/ @wanjohiryan
|
||||
/packages/functions/ @wanjohiryan
|
||||
|
||||
/containerfiles/ @DatCaptainHorse
|
||||
/containers/ @DatCaptainHorse
|
||||
/packages/server/ @DatCaptainHorse
|
||||
/packages/relay/ @DatCaptainHorse
|
||||
/packages/scripts/ @DatCaptainHorse
|
||||
|
||||
48
.github/workflows/docker-bake.hcl
vendored
@@ -1,48 +0,0 @@
|
||||
variable "BASE_IMAGE" {
|
||||
default = "docker.io/cachyos/cachyos:latest"
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["runner"]
|
||||
}
|
||||
|
||||
target "runner-base" {
|
||||
dockerfile = "containerfiles/runner-base.Containerfile"
|
||||
context = "."
|
||||
args = {
|
||||
BASE_IMAGE = "${BASE_IMAGE}"
|
||||
}
|
||||
cache-from = ["type=gha,scope=runner-base-pr"]
|
||||
cache-to = ["type=gha,scope=runner-base-pr,mode=max"]
|
||||
tags = ["runner-base:latest"]
|
||||
}
|
||||
|
||||
target "runner-builder" {
|
||||
dockerfile = "containerfiles/runner-builder.Containerfile"
|
||||
context = "."
|
||||
args = {
|
||||
RUNNER_BASE_IMAGE = "runner-base:latest"
|
||||
}
|
||||
cache-from = ["type=gha,scope=runner-builder-pr"]
|
||||
cache-to = ["type=gha,scope=runner-builder-pr,mode=max"]
|
||||
tags = ["runner-builder:latest"]
|
||||
contexts = {
|
||||
runner-base = "target:runner-base"
|
||||
}
|
||||
}
|
||||
|
||||
target "runner" {
|
||||
dockerfile = "containerfiles/runner.Containerfile"
|
||||
context = "."
|
||||
args = {
|
||||
RUNNER_BASE_IMAGE = "runner-base:latest"
|
||||
RUNNER_BUILDER_IMAGE = "runner-builder:latest"
|
||||
}
|
||||
cache-from = ["type=gha,scope=runner-pr"]
|
||||
cache-to = ["type=gha,scope=runner-pr,mode=max"]
|
||||
tags = ["nestri-runner"]
|
||||
contexts = {
|
||||
runner-base = "target:runner-base"
|
||||
runner-builder = "target:runner-builder"
|
||||
}
|
||||
}
|
||||
40
.github/workflows/docs.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Build docs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "apps/docs/**"
|
||||
- ".github/workflows/docs.yml"
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "apps/docs/**"
|
||||
- ".github/workflows/docs.yml"
|
||||
|
||||
jobs:
|
||||
deploy-docs:
|
||||
name: Build and deploy docs
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: "apps/docs"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
- name: Build Project Artifacts
|
||||
run: bun run build
|
||||
- name: Deploy Project Artifacts to Cloudflare
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
packageManager: bun
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
wranglerVersion: "3.93.0"
|
||||
workingDirectory: "apps/docs"
|
||||
command: pages deploy ./dist --project-name=${{ vars.CF_DOCS_PAGES_PROJECT_NAME }} --commit-dirty=true
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
21
.github/workflows/relay.yml
vendored
@@ -4,13 +4,13 @@ name: Build nestri:relay
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "containerfiles/relay.Containerfile"
|
||||
- "containers/relay.Containerfile"
|
||||
- "packages/relay/**"
|
||||
- ".github/workflows/relay.yml"
|
||||
push:
|
||||
branches: [dev, production]
|
||||
branches: [main]
|
||||
paths:
|
||||
- "containerfiles/relay.Containerfile"
|
||||
- "containers/relay.Containerfile"
|
||||
- ".github/workflows/relay.yml"
|
||||
- "packages/relay/**"
|
||||
tags:
|
||||
@@ -39,15 +39,15 @@ jobs:
|
||||
name: Build Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
file: containerfiles/relay.Containerfile
|
||||
file: containers/relay.Containerfile
|
||||
context: ./
|
||||
push: false
|
||||
load: true
|
||||
tags: nestri:relay
|
||||
|
||||
build-and-push-docker:
|
||||
name: Build and push image
|
||||
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/production' }}
|
||||
build-docker-main:
|
||||
name: Build image on main
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -73,8 +73,7 @@ jobs:
|
||||
#tag on release, and a nightly build for 'dev'
|
||||
tags: |
|
||||
type=raw,value=nightly,enable={{is_default_branch}}
|
||||
type=raw,value={{branch}}
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'production') }}
|
||||
type=ref,event=tag
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
@@ -82,8 +81,8 @@ jobs:
|
||||
name: Build Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
file: containerfiles/relay.Containerfile
|
||||
file: containers/relay.Containerfile
|
||||
context: ./
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
106
.github/workflows/runner.yml
vendored
@@ -1,20 +1,20 @@
|
||||
#Tabs not spaces, you moron :)
|
||||
|
||||
name: Build nestri-runner
|
||||
name: Build nestri:runner
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "containerfiles/runner*.Containerfile"
|
||||
- "containers/runner.Containerfile"
|
||||
- "packages/scripts/**"
|
||||
- "packages/server/**"
|
||||
- ".github/workflows/runner.yml"
|
||||
schedule:
|
||||
- cron: 7 0 * * 1,3,6 # Regularly to keep that build cache warm
|
||||
push:
|
||||
branches: [dev, production]
|
||||
branches: [main]
|
||||
paths:
|
||||
- "containerfiles/runner*.Containerfile"
|
||||
- "containers/runner.Containerfile"
|
||||
- ".github/workflows/runner.yml"
|
||||
- "packages/scripts/**"
|
||||
- "packages/server/**"
|
||||
@@ -26,6 +26,7 @@ on:
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: nestrilabs/nestri
|
||||
BASE_TAG_PREFIX: runner
|
||||
BASE_IMAGE: docker.io/cachyos/cachyos:latest
|
||||
|
||||
# This makes our release ci quit prematurely
|
||||
@@ -35,46 +36,43 @@ env:
|
||||
|
||||
jobs:
|
||||
build-docker-pr:
|
||||
name: Build images on PR
|
||||
name: Build image on PR
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
-
|
||||
name: Set Swap Space
|
||||
uses: pierotofy/set-swap-space@master
|
||||
with:
|
||||
swap-size-gb: 20
|
||||
-
|
||||
name: Build images using bake
|
||||
uses: docker/bake-action@v6
|
||||
env:
|
||||
BASE_IMAGE: ${{ env.BASE_IMAGE }}
|
||||
-
|
||||
name: Build Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
files: |
|
||||
./.github/workflows/docker-bake.hcl
|
||||
targets: runner
|
||||
file: containers/runner.Containerfile
|
||||
context: ./
|
||||
push: false
|
||||
load: true
|
||||
tags: nestri:runner
|
||||
cache-from: type=gha,mode=max
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
build-and-push-docker:
|
||||
name: Build and push images
|
||||
if: ${{ github.ref == 'refs/heads/production' || github.ref == 'refs/heads/dev' }}
|
||||
build-docker-main:
|
||||
name: Build image on main
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
variant:
|
||||
- { suffix: "", base: "docker.io/cachyos/cachyos:latest" }
|
||||
- { suffix: "-v3", base: "docker.io/cachyos/cachyos-v3:latest" }
|
||||
#- { suffix: "-v4", base: "docker.io/cachyos/cachyos-v4:latest" } # Disabled until GHA has this
|
||||
steps:
|
||||
-
|
||||
name: Checkout repo
|
||||
@@ -87,19 +85,20 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
-
|
||||
name: Extract runner metadata
|
||||
id: meta-runner
|
||||
name: Extract Container metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.BASE_TAG_PREFIX }}
|
||||
#
|
||||
#tag on release, and a nightly build for 'dev'
|
||||
tags: |
|
||||
type=raw,value=nightly${{ matrix.variant.suffix }},enable={{is_default_branch}}
|
||||
type=raw,value={{branch}}${{ matrix.variant.suffix }}
|
||||
type=raw,value=latest${{ matrix.variant.suffix }},enable=${{ github.ref == format('refs/heads/{0}', 'production') }}
|
||||
type=semver,pattern={{version}}${{ matrix.variant.suffix }}
|
||||
type=semver,pattern={{major}}.{{minor}}${{ matrix.variant.suffix }}
|
||||
type=semver,pattern={{major}}${{ matrix.variant.suffix }}
|
||||
-
|
||||
type=raw,value=nightly,enable={{is_default_branch}}
|
||||
type=ref,event=tag
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
-
|
||||
name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
@@ -108,41 +107,14 @@ jobs:
|
||||
with:
|
||||
swap-size-gb: 20
|
||||
-
|
||||
name: Build and push runner-base image
|
||||
name: Build Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: containerfiles/runner-base.Containerfile
|
||||
file: containers/runner.Containerfile
|
||||
context: ./
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner-base:latest${{ matrix.variant.suffix }}
|
||||
build-args: |
|
||||
BASE_IMAGE=${{ matrix.variant.base }}
|
||||
cache-from: type=gha,scope=runner-base${{ matrix.variant.suffix }},mode=max
|
||||
cache-to: type=gha,scope=runner-base${{ matrix.variant.suffix }},mode=max
|
||||
pull: ${{ github.event_name == 'schedule' }}
|
||||
-
|
||||
name: Build and push runner-builder image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: containerfiles/runner-builder.Containerfile
|
||||
context: ./
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner-builder:latest${{ matrix.variant.suffix }}
|
||||
build-args: |
|
||||
RUNNER_BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner-base:latest${{ matrix.variant.suffix }}
|
||||
cache-from: type=gha,scope=runner-builder${{ matrix.variant.suffix }},mode=max
|
||||
cache-to: type=gha,scope=runner-builder${{ matrix.variant.suffix }},mode=max
|
||||
-
|
||||
name: Build and push runner image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: containerfiles/runner.Containerfile
|
||||
context: ./
|
||||
push: true
|
||||
tags: ${{ steps.meta-runner.outputs.tags }}
|
||||
labels: ${{ steps.meta-runner.outputs.labels }}
|
||||
build-args: |
|
||||
RUNNER_BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner-base:latest${{ matrix.variant.suffix }}
|
||||
RUNNER_BUILDER_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/runner-builder:latest${{ matrix.variant.suffix }}
|
||||
cache-from: type=gha,scope=runner${{ matrix.variant.suffix }},mode=max
|
||||
cache-to: type=gha,scope=runner${{ matrix.variant.suffix }},mode=max
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha,mode=max
|
||||
cache-to: type=gha,mode=max
|
||||
pull: ${{ github.event_name == 'schedule' }} # Pull base image for scheduled builds
|
||||
|
||||
40
.github/workflows/www.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Build www
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "apps/www/**"
|
||||
- ".github/workflows/www.yml"
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "apps/www/**"
|
||||
- ".github/workflows/www.yml"
|
||||
|
||||
jobs:
|
||||
deploy-www:
|
||||
name: Build and deploy www
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: "apps/www"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
- name: Build Project Artifacts
|
||||
run: bun run build
|
||||
- name: Deploy Project Artifacts to Cloudflare
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
packageManager: bun
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
wranglerVersion: "3.93.0"
|
||||
workingDirectory: "apps/www"
|
||||
command: pages deploy ./dist --project-name=${{ vars.CF_WWW_PAGES_PROJECT_NAME }} --commit-dirty=true
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
||||
12
LICENSE
@@ -1,13 +1,3 @@
|
||||
Copyright (c) 2023-present Nestri Labs, Inc.
|
||||
|
||||
Portions of this software are licensed as follows:
|
||||
|
||||
* All content that resides under https://github.com/nestrilabs/nestri/tree/dev/cloud and
|
||||
https://github.com/nestrilabs/nestri/tree/production/cloud directory of this repository (Commercial License) is licensed under the license defined in "cloud/LICENSE".
|
||||
* All third party components incorporated into the Nestri Software are licensed under the original license provided by the owner of the applicable component.
|
||||
* Content outside of the above mentioned directories or restrictions above is available under the "AGPLv3" license as defined below.
|
||||
|
||||
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
@@ -668,4 +658,4 @@ specific requirements.
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
<https://www.gnu.org/licenses/>.
|
||||
136
README.md
@@ -1,23 +1,115 @@
|
||||
<p align="center">
|
||||
<a href="https://nestri.io">
|
||||
<picture>
|
||||
<source srcset="packages/web/public/logo.white.svg" media="(prefers-color-scheme: dark)">
|
||||
<source srcset="packages/web/public/logo.black.svg" media="(prefers-color-scheme: light)">
|
||||
<img src="packages/web/public/logo.black.svg" alt="Nestri logo">
|
||||
</picture>
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">Deploy and stream games/apps in the cloud. Use our GPUs or bring your own.</p>
|
||||
<p align="center">
|
||||
<a href="https://discord.com/invite/Y6etn3qKZ3"><img alt="Discord" src="https://img.shields.io/discord/1080111004698021909?style=flat-square&label=discord" /></a>
|
||||
<a href="https://github.com/nestrilabs/nestri/blob/dev/LICENSE"><img alt="Nestri License" src="https://img.shields.io/github/license/nestriness/nestri?style=flat-square" /></a>
|
||||
<a href="https://github.com/nestrilabs/nestri/actions/workflows/runner.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/nestrilabs/nestri/runner.yml?style=flat-square&branch=dev" /></a>
|
||||
<!-- <a href="https://nestri.io" style="text-decoration: none;">
|
||||
<img src="https://img.shields.io/badge/Start%20Playing%20Now-For%20$1/hour-brightgreen?style=flat-square" alt="Umami Demo" />
|
||||
</a> -->
|
||||
</p>
|
||||
<div align="center">
|
||||
|
||||
<!-- TODO: Add a link to the demo app when it's ready -->
|
||||
<!-- TODO: Add a link to install for self-hosters -->
|
||||
<!-- TODO: Add a CTA for hosted option -->
|
||||
<!-- TODO: Add feature imagery like Lobechat -->
|
||||
<div align="center">
|
||||
<h1>
|
||||
|
||||
<a href="https://nestri.io" >
|
||||
<img src="/apps/www/public/seo/banner.png" alt="Nestri - What will you play next?">
|
||||
</a>
|
||||
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
Nestri is an open-source, self-hosted Geforce Now alternative with Stadia's social features. <strong>Built and shaped by our gaming community.</strong>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[![][github-release-shield]][github-release-link]
|
||||
[![][discord-shield]][discord-link]
|
||||
[![][github-license-shield]][github-license-link]
|
||||
[![][github-stars-shield]][github-stars-link]
|
||||
|
||||
**Share the Nestri Repository on Social Media**
|
||||
|
||||
[![][share-x-shield]][share-x-link]
|
||||
[![][share-reddit-shield]][share-reddit-link]
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
> **Note**
|
||||
> Nestri is more closer (in feature comparison) to Jellyfin/Plex than Moonlight. Our goal is to develop a comprehensive self-hosted cloud gaming solution for your home server.
|
||||
|
||||
## Features
|
||||
|
||||
- Save and share your game progress easily with friends
|
||||
- Simultaneously run multiple games on your GPU using Virtio-GPU Venus and/or Virgl
|
||||
- Play games using either your integrated GPU or dedicated GPU
|
||||
- Enjoy titles from your preferred Game Stores - Steam, Epic Games, Amazon Games, GOG.com
|
||||
- Experience Android gaming
|
||||
- Organize gaming sessions with friends and family through Nestri Parties
|
||||
- Stream directly to YouTube and Twitch straight from your setup
|
||||
- Family sharing capabilities
|
||||
- Support for Controller, Touchscreen, Keyboard, and Mouse devices
|
||||
|
||||
## Possible Use Cases
|
||||
|
||||
- Organize game nights or LAN parties with friends online or locally
|
||||
- For game developers, showcase your proof-of-concept multiplayer games for testing without installation
|
||||
- Create and manage your custom cloud-gaming platform using our robust API
|
||||
- Establish a game server for your family to enjoy gaming on the go
|
||||
|
||||
## Goals
|
||||
|
||||
- Provide a user-friendly setup - fire and forget
|
||||
- Deliver a simple and elegant interface for managing and playing your game library
|
||||
- Ensure a high-quality gaming experience out-of-the-box
|
||||
- Optimize for the best gaming performance right from the start
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Become a generic cloud-gaming service
|
||||
|
||||
## Built With
|
||||
|
||||
- Cloudflare Workers
|
||||
- Cloudflare Pages
|
||||
- Supabase
|
||||
- CrosVM (with Virtio-GPU Venus and Virgl support)
|
||||
- Docker
|
||||
- Qwik
|
||||
- Media-Over-Quic
|
||||
- AWS Route53
|
||||
|
||||
## Known Issues
|
||||
|
||||
- CrosVM is still under development and needs to be merged
|
||||
- Currently, the Intel dGPU, particularly the Arc A780, is the only tested and verified GPU
|
||||
|
||||
## Donation
|
||||
|
||||
If you appreciate our work and wish to support the development of Nestri, consider making a donation [here](https://polar.sh/nestri/donate). Your contributions will help us improve the platform and enhance your gaming experience. Thank you for your support!
|
||||
|
||||
## Demo
|
||||
|
||||
Nestri is still in development, but here is some footage from Behind-The-Scenes
|
||||
|
||||
<img src="/apps/www/public/seo/code.avif" alt="Nestri - What will you play next?">
|
||||
|
||||
|
||||
[github-release-link]: https://github.com/nestriness/nestri/releases
|
||||
[github-release-shield]: https://img.shields.io/github/v/release/nestriness/nestri?color=369eff&labelColor=black&logo=github&style=flat-square
|
||||
[discord-shield]: https://img.shields.io/discord/1080111004698021909?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square
|
||||
[discord-link]: https://discord.com/invite/Y6etn3qKZ3
|
||||
[github-license-shield]: https://img.shields.io/github/license/nestriness/nestri?color=white&labelColor=black&style=flat-square
|
||||
[github-license-link]: https://github.com/nestriness/nestri/blob/main/LICENSE
|
||||
[github-stars-shield]: https://img.shields.io/github/stars/nestriness/nestri?color=ffcb47&labelColor=black&style=flat-square
|
||||
[github-stars-link]: https://github.com/nestriness/nestri/network/stargazers
|
||||
[share-x-shield]: https://img.shields.io/badge/-share%20on%20x-black?labelColor=black&logo=x&logoColor=white&style=flat-square
|
||||
[share-x-link]: https://twitter.com/intent/tweet?text=Hey%2C%20check%20out%20this%20Github%20repository.%20It%20is%20an%20open-source%20self-hosted%20Geforce%20Now%20alternative.&url=https%3A%2F%2Fgithub.com%2Fnestriness%2Fnestri
|
||||
[share-reddit-shield]: https://img.shields.io/badge/-share%20on%20reddit-black?labelColor=black&logo=reddit&logoColor=white&style=flat-square
|
||||
[share-reddit-link]: https://www.reddit.com/submit?title=Hey%2C%20check%20out%20this%20Github%20repository.%20It%20is%20an%20open-source%20self-hosted%20Geforce%20Now%20alternative.&url=https%3A%2F%2Fgithub.com%2Fnestriness%2Fnestri
|
||||
[image-overview]: assets/banner.png
|
||||
[website-link]: https://nestri.io
|
||||
[neko-url]: https://github.com/m1k1o/neko
|
||||
[image-star]: assets/star-us.png
|
||||
[moq-github-url]: https://quic.video
|
||||
[vmaf-cuda-link]: https://developer.nvidia.com/blog/calculating-video-quality-using-nvidia-gpus-and-vmaf-cuda/
|
||||
@@ -20,6 +20,5 @@ pnpm-debug.log*
|
||||
# macOS-specific files
|
||||
.DS_Store
|
||||
|
||||
# setting folders
|
||||
# jetbrains setting folder
|
||||
.idea/
|
||||
.vscode/
|
||||
4
apps/blog/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
11
apps/blog/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "./node_modules/.bin/astro dev",
|
||||
"name": "Development server",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
68
apps/blog/README.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Astro Starter Kit: Blog
|
||||
|
||||
```sh
|
||||
bun create astro@latest -- --template blog
|
||||
```
|
||||
|
||||
[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog)
|
||||
[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/blog)
|
||||
[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/blog/devcontainer.json)
|
||||
|
||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
||||
|
||||

|
||||
|
||||
Features:
|
||||
|
||||
- ✅ Minimal styling (make it your own!)
|
||||
- ✅ 100/100 Lighthouse performance
|
||||
- ✅ SEO-friendly with canonical URLs and OpenGraph data
|
||||
- ✅ Sitemap support
|
||||
- ✅ RSS Feed support
|
||||
- ✅ Markdown & MDX support
|
||||
|
||||
## 🚀 Project Structure
|
||||
|
||||
Inside of your Astro project, you'll see the following folders and files:
|
||||
|
||||
```text
|
||||
├── public/
|
||||
├── src/
|
||||
│ ├── components/
|
||||
│ ├── content/
|
||||
│ ├── layouts/
|
||||
│ └── pages/
|
||||
├── astro.config.mjs
|
||||
├── README.md
|
||||
├── package.json
|
||||
└── tsconfig.json
|
||||
```
|
||||
|
||||
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
||||
|
||||
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
||||
|
||||
The `src/content/` directory contains "collections" of related Markdown and MDX documents. Use `getCollection()` to retrieve posts from `src/content/blog/`, and type-check your frontmatter using an optional schema. See [Astro's Content Collections docs](https://docs.astro.build/en/guides/content-collections/) to learn more.
|
||||
|
||||
Any static assets, like images, can be placed in the `public/` directory.
|
||||
|
||||
## 🧞 Commands
|
||||
|
||||
All commands are run from the root of the project, from a terminal:
|
||||
|
||||
| Command | Action |
|
||||
| :------------------------ | :----------------------------------------------- |
|
||||
| `bun install` | Installs dependencies |
|
||||
| `bun dev` | Starts local dev server at `localhost:4321` |
|
||||
| `bun build` | Build your production site to `./dist/` |
|
||||
| `bun preview` | Preview your build locally, before deploying |
|
||||
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
|
||||
| `bun astro -- --help` | Get help using the Astro CLI |
|
||||
|
||||
## 👀 Want to learn more?
|
||||
|
||||
Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
||||
|
||||
## Credit
|
||||
|
||||
This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).
|
||||
18
apps/blog/astro.config.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
// @ts-check
|
||||
import { defineConfig } from 'astro/config';
|
||||
import mdx from '@astrojs/mdx';
|
||||
import sitemap from '@astrojs/sitemap';
|
||||
|
||||
import solidJs from '@astrojs/solid-js';
|
||||
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
site: 'https://example.com',
|
||||
integrations: [mdx(), sitemap(), solidJs()],
|
||||
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
},
|
||||
});
|
||||
1022
apps/blog/bun.lock
Normal file
21
apps/blog/package.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^4.2.6",
|
||||
"@astrojs/rss": "^4.0.11",
|
||||
"@astrojs/sitemap": "^3.4.0",
|
||||
"@astrojs/solid-js": "^5.0.10",
|
||||
"@tailwindcss/vite": "^4.1.7",
|
||||
"astro": "^5.7.13",
|
||||
"solid-js": "^1.9.7",
|
||||
"tailwindcss": "^4.1.7"
|
||||
}
|
||||
}
|
||||
BIN
apps/blog/public/blog-placeholder-1.jpg
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
apps/blog/public/blog-placeholder-2.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
apps/blog/public/blog-placeholder-3.jpg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
apps/blog/public/blog-placeholder-4.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
apps/blog/public/blog-placeholder-5.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
apps/blog/public/blog-placeholder-about.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
9
apps/blog/public/favicon.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
|
||||
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
|
||||
<style>
|
||||
path { fill: #000; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
path { fill: #FFF; }
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 749 B |
BIN
apps/blog/public/fonts/atkinson-bold.woff
Normal file
BIN
apps/blog/public/fonts/atkinson-regular.woff
Normal file
BIN
apps/blog/public/nestri-footage-latency.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
apps/blog/public/pexels-brett-sayles-2881224.jpg
Normal file
|
After Width: | Height: | Size: 157 KiB |
55
apps/blog/src/components/BaseHead.astro
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
// Import the global.css file here so that it is included on
|
||||
// all pages through the use of the <BaseHead /> component.
|
||||
import '../styles/global.css';
|
||||
import { SITE_TITLE } from '../consts';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
description: string;
|
||||
image?: string;
|
||||
}
|
||||
|
||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||
|
||||
const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props;
|
||||
---
|
||||
|
||||
<!-- Global Metadata -->
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
<link
|
||||
rel="alternate"
|
||||
type="application/rss+xml"
|
||||
title={SITE_TITLE}
|
||||
href={new URL('rss.xml', Astro.site)}
|
||||
/>
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
|
||||
<!-- Font preloads -->
|
||||
<link rel="preload" href="/fonts/atkinson-regular.woff" as="font" type="font/woff" crossorigin />
|
||||
<link rel="preload" href="/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin />
|
||||
|
||||
<!-- Canonical URL -->
|
||||
<link rel="canonical" href={canonicalURL} />
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>{title}</title>
|
||||
<meta name="title" content={title} />
|
||||
<meta name="description" content={description} />
|
||||
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content={Astro.url} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:image" content={new URL(image, Astro.url)} />
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content={Astro.url} />
|
||||
<meta property="twitter:title" content={title} />
|
||||
<meta property="twitter:description" content={description} />
|
||||
<meta property="twitter:image" content={new URL(image, Astro.url)} />
|
||||
53
apps/blog/src/components/Footer.astro
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
import "../styles/global.css"
|
||||
const today = new Date();
|
||||
---
|
||||
|
||||
<footer>
|
||||
<div class="mt-6 flex w-full items-center justify-center gap-2 text-xs sm:text-sm font-medium text-neutral-600 dark:text-neutral-400">
|
||||
<span class="hover:text-primary-500 transition-colors duration-200">
|
||||
<a rel="noreferrer" href="https://nestri.io/terms" >Terms of Service</a></span>
|
||||
<span class="text-gray-400 dark:text-gray-600">•</span>
|
||||
<span class="hover:text-primary-500 transition-colors duration-200">
|
||||
<a href="https://nestri.io/privacy">Privacy Policy</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-6 w-full justify-center flex items-center space-x-4">
|
||||
<a href="https://discord.gg/6um5K6jrYj" target="_blank">
|
||||
<span class="sr-only">Join our Discord Server</span>
|
||||
<svg width="59" height="44" viewBox="0 0 59 44" aria-hidden="true" astro-icon="social/discord" style="height:28px">
|
||||
<path d="M37.1937 0C36.6265 1.0071 36.1172 2.04893 35.6541 3.11392C31.2553 2.45409 26.7754 2.45409 22.365 3.11392C21.9136 2.04893 21.3926 1.0071 20.8254 0C16.6928 0.70613 12.6644 1.94475 8.84436 3.69271C1.27372 14.9098 -0.775214 25.8374 0.243466 36.6146C4.67704 39.8906 9.6431 42.391 14.9333 43.9884C16.1256 42.391 17.179 40.6893 18.0819 38.9182C16.3687 38.2815 14.7133 37.4828 13.1274 36.5567C13.5442 36.2557 13.9493 35.9432 14.3429 35.6422C23.6384 40.0179 34.4039 40.0179 43.711 35.6422C44.1046 35.9663 44.5097 36.2789 44.9264 36.5567C43.3405 37.4943 41.6852 38.2815 39.9604 38.9298C40.8633 40.7009 41.9167 42.4025 43.109 44C48.3992 42.4025 53.3653 39.9137 57.7988 36.6377C59.0027 24.1358 55.7383 13.3007 49.1748 3.70429C45.3663 1.95633 41.3379 0.717706 37.2053 0.0231518L37.1937 0ZM19.3784 29.9816C16.5192 29.9816 14.1461 27.3886 14.1461 24.1821C14.1461 20.9755 16.4266 18.371 19.3669 18.371C22.3071 18.371 24.6455 20.9871 24.5992 24.1821C24.5529 27.377 22.2956 29.9816 19.3784 29.9816ZM38.6639 29.9816C35.7931 29.9816 33.4431 27.3886 33.4431 24.1821C33.4431 20.9755 35.7236 18.371 38.6639 18.371C41.6042 18.371 43.9309 20.9871 43.8846 24.1821C43.8383 27.377 41.581 29.9816 38.6639 29.9816Z" fill="white"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://github.com/nestrilabs/nestri/" target="_blank">
|
||||
<span class="sr-only">Go to Nestri's GitHub repo</span>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/github"
|
||||
><path
|
||||
fill="currentColor"
|
||||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</footer>
|
||||
<style>
|
||||
footer {
|
||||
padding: 2em 1em 6em 1em;
|
||||
background: linear-gradient(var(--gray-gradient)) no-repeat;
|
||||
color: rgb(var(--gray));
|
||||
text-align: center;
|
||||
}
|
||||
.social-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 1em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
.social-links a {
|
||||
text-decoration: none;
|
||||
color: rgb(var(--gray));
|
||||
}
|
||||
.social-links a:hover {
|
||||
color: rgb(var(--gray-dark));
|
||||
}
|
||||
</style>
|
||||
17
apps/blog/src/components/FormattedDate.astro
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
interface Props {
|
||||
date: Date;
|
||||
}
|
||||
|
||||
const { date } = Astro.props;
|
||||
---
|
||||
|
||||
<time datetime={date.toISOString()}>
|
||||
{
|
||||
date.toLocaleDateString('en-us', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
})
|
||||
}
|
||||
</time>
|
||||
57
apps/blog/src/components/Header.astro
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
import HeaderLink from './HeaderLink.astro';
|
||||
import { SITE_TITLE } from '../consts';
|
||||
import "../styles/global.css";
|
||||
---
|
||||
|
||||
<header>
|
||||
<nav>
|
||||
<h2><a href="/">{SITE_TITLE}</a></h2>
|
||||
<div class="internal-links">
|
||||
<HeaderLink href="https://nestri.io/">Nestri Home</HeaderLink>
|
||||
<HeaderLink href="/blog">Blog</HeaderLink>
|
||||
<HeaderLink href="https://nestri.io/about">About us</HeaderLink>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<style>
|
||||
header {
|
||||
margin: 0;
|
||||
padding: 0 1em;
|
||||
border-bottom: solid;
|
||||
box-: 0 2px 8px rgba(var(--black), 5%);
|
||||
}
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
h2 a,
|
||||
h2 a.active {
|
||||
text-decoration: none;
|
||||
}
|
||||
nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
nav a {
|
||||
padding: 1em 0.5em;
|
||||
color: var(--black);
|
||||
border-bottom: 4px solid transparent;
|
||||
text-decoration: none;
|
||||
}
|
||||
nav a.active {
|
||||
text-decoration: none;
|
||||
border-bottom-color: var(--accent);
|
||||
}
|
||||
.social-links,
|
||||
.social-links a {
|
||||
display: flex;
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
.social-links {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
24
apps/blog/src/components/HeaderLink.astro
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
import type { HTMLAttributes } from 'astro/types';
|
||||
|
||||
type Props = HTMLAttributes<'a'>;
|
||||
|
||||
const { href, class: className, ...props } = Astro.props;
|
||||
const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, '');
|
||||
const subpath = pathname.match(/[^\/]+/g);
|
||||
const isActive = href === pathname || href === '/' + (subpath?.[0] || '');
|
||||
---
|
||||
|
||||
<a href={href} class:list={[className, { active: isActive }]} {...props}>
|
||||
<slot />
|
||||
</a>
|
||||
<style>
|
||||
a {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.active {
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
5
apps/blog/src/consts.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
// Place any global data in this file.
|
||||
// You can import this data from anywhere in your site by using the `import` keyword.
|
||||
|
||||
export const SITE_TITLE = 'Nestri Blog';
|
||||
export const SITE_DESCRIPTION = 'Welcome to Nestri\'s Blog - This Blog is about the current status of and about intresting facts about Nestri';
|
||||
18
apps/blog/src/content.config.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { glob } from 'astro/loaders';
|
||||
import { defineCollection, z } from 'astro:content';
|
||||
|
||||
const blog = defineCollection({
|
||||
// Load Markdown and MDX files in the `src/content/blog/` directory.
|
||||
loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
|
||||
// Type-check frontmatter using a schema
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
// Transform string to Date object
|
||||
pubDate: z.coerce.date(),
|
||||
updatedDate: z.coerce.date().optional(),
|
||||
heroImage: z.string().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = { blog };
|
||||
16
apps/blog/src/content/blog/first-post.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: 'First post'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jul 08 2022'
|
||||
heroImage: '/blog-placeholder-3.jpg'
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
||||
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
|
||||
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
65
apps/blog/src/content/blog/latency-deep-dive.md
Normal file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
title: 'Technical Deep Dive into Latency'
|
||||
description: "Why It's High and How to Reduce It"
|
||||
pubDate: 'May 18 2025'
|
||||
heroImage: '/pexels-brett-sayles-2881224.jpg'
|
||||
---
|
||||
|
||||
### Why It's High and How to Reduce It
|
||||
|
||||
First, let's start with the basics of the Internet.
|
||||
|
||||
The Internet connects clients and servers. Webpages primarily use the Application Layer protocol HTTP(S) to communicate with servers. HTTP is widely adopted for various applications, including mobile apps and other services requiring server communication.
|
||||
|
||||
There are also other client protocols like WebRTC (Web Real-Time Communication), which mainly powers streaming services needing a back channel. Nestri utilizes WebRTC, and we'll delve deeper into that later.
|
||||
|
||||
Imagine using a client protocol like WebRTC to send messages. Common formats for these messages include XML, HTML, or JSON.
|
||||
|
||||
While HTML contains significant duplicate symbols (e.g., `<a href="example.com">Some Link</a> <a href="example.com/subpage">Some nested Link</a>`), the modern web employs techniques to reduce its size. For instance, using modern zipping algorithms like gzip, this data can be compressed, resulting in a smaller size for transmission over the HTTP protocol.
|
||||
|
||||
In computer science, the more dense the information in a message (achieved through compression, for example), the higher its message entropy. Therefore, sending messages with high entropy is beneficial as it allows for the transfer of more information in a smaller package. Pure HTTP has relatively low entropy, similar to XML. JSON offers higher entropy, which can be further increased by removing whitespace and shortening attribute names. However, in modern client-server applications, JSON is often compressed.
|
||||
|
||||
So, we compress JSON traffic for efficiency. Have you ever compressed a large file? Modern systems make this process incredibly fast! But this requires computing power on both the client and server sides, which directly influences latency.
|
||||
|
||||
"Well, if I have a fiber connection, I don't need to worry about that..."
|
||||
|
||||
While a fiber connection offers significant bandwidth, this statement is somewhat misleading.
|
||||
|
||||
Latency also depends on your local network. A modern and stable Wi-Fi connection might seem sufficient, but the physical layer of the internet also contributes to latency. Wireless protocols, in particular, operate on a shared medium – the air. This medium is utilized by various devices, commonly on frequencies around 2.4 or 5 GHz. This spectrum is divided among all these devices. Mechanisms like scheduling and signal modulation are used to manage this shared resource. In essence, to avoid a deeper dive into wireless communication, a wired connection is generally superior to a wireless connection due to the absence of a shared physical medium.
|
||||
|
||||
Okay, but what about Ethernet or fiber cables? Aren't we sharing those as well, with multiple applications or other internet users?
|
||||
|
||||
Yes, this also impacts latency. If many users in your local area are utilizing the same uplinks to a backbone (a high-speed part of the internet), you'll have to share that bandwidth. While fiber optic cables have substantial capacity due to advanced modulation techniques, consider the journey these data packets undertake across the internet.
|
||||
|
||||
Sometimes, if a data center is located nearby, your connection will involve fewer routers (fewer hops) between you and the server. Fewer hops generally translate to lower latency. Each router needs to queue your messages and determine the next destination. Modern routing protocols facilitate this process. However, even routers have to process messages in their queues. Thus, higher message entropy means fewer or smaller packets need to be sent.
|
||||
|
||||
What happens when your messages are too large for transmission? They are split into multiple parts and sent using protocols like TCP. TCP ensures reliable packet exchange by retransmitting any packets that are likely lost during internet transit. Packet loss can occur if a router's queue overflows, forcing it to drop packets, potentially prioritizing other traffic. This retransmission significantly increases latency as a packet might need to be sent multiple times.
|
||||
|
||||
UDP offers a different approach: it sends all packets without the overhead of retransmission. In this case, the application protocol is responsible for handling any lost packets. Fortunately, there's an application protocol that manages this quite effectively: WebRTC.
|
||||
|
||||
WebRTC is an open-source project providing APIs for real-time communication of audio, video, and generic data between peers via a browser. It leverages protocols like ICE, STUN, and TURN to handle NAT traversal and establish peer-to-peer connections, enabling low-latency media streaming and data exchange directly within web applications.
|
||||
|
||||
Sending raw video streams over WebRTC is inefficient; they require compression using modern codecs. A GPU is the optimal choice for this task because it has dedicated hardware (hardware encoder) to accelerate video encoding, significantly speeding up the process compared to software encoding on a CPU. Therefore, your GPU also plays a crucial role in reducing latency during video encoding and decoding.
|
||||
|
||||
So, why is all this relevant to Nestri?
|
||||
|
||||
We aim to deliver a cutting-edge, low-latency cloud gaming experience. Here's what we've implemented to combat bad latency:
|
||||
|
||||
**1. Reducing Mouse and Keyboard Latency**
|
||||
1. Reduce package size by using the Protobuf protocol instead of JSON.
|
||||
2. Avoid wasting compute power by not compressing these already optimized messages.
|
||||
3. Minimize message flooding by bundling multiple mouse events into fewer messages through aggregation.
|
||||
4. Implement all of this within WebRTC for a super lightweight communication over UDP.
|
||||
|
||||
**2. Reducing Video Latency**
|
||||
1. Utilize cutting-edge encoder-decoders on a GPU instead of a CPU.
|
||||
|
||||
**3. Reducing Network Latency in the Backbone**
|
||||
1. Bring servers closer to users to reduce the hop count.
|
||||
|
||||
Here's a glimpse of the results of these improvements, comparing the experience before and after implementation:
|
||||
|
||||
](https://fs.dathorse.com/w/ad2bee7e322b942491044fcffcccc899)
|
||||
**Latency Test and comparison to the old Nestri**
|
||||
|
||||
Did you enjoy this blog post? Join our Discord and share your thoughts!
|
||||
214
apps/blog/src/content/blog/markdown-style-guide.md
Normal file
@@ -0,0 +1,214 @@
|
||||
---
|
||||
title: 'Markdown Style Guide'
|
||||
description: 'Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.'
|
||||
pubDate: 'Jun 19 2024'
|
||||
heroImage: '/blog-placeholder-1.jpg'
|
||||
---
|
||||
|
||||
Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.
|
||||
|
||||
## Headings
|
||||
|
||||
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
|
||||
|
||||
# H1
|
||||
|
||||
## H2
|
||||
|
||||
### H3
|
||||
|
||||
#### H4
|
||||
|
||||
##### H5
|
||||
|
||||
###### H6
|
||||
|
||||
## Paragraph
|
||||
|
||||
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
|
||||
|
||||
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
|
||||
|
||||
## Images
|
||||
|
||||
### Syntax
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||

|
||||
|
||||
## Blockquotes
|
||||
|
||||
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
|
||||
|
||||
### Blockquote without attribution
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||
> **Note** that you can use _Markdown syntax_ within a blockquote.
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||
> **Note** that you can use _Markdown syntax_ within a blockquote.
|
||||
|
||||
### Blockquote with attribution
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
||||
|
||||
## Tables
|
||||
|
||||
### Syntax
|
||||
|
||||
```markdown
|
||||
| Italics | Bold | Code |
|
||||
| --------- | -------- | ------ |
|
||||
| _italics_ | **bold** | `code` |
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
| Italics | Bold | Code |
|
||||
| --------- | -------- | ------ |
|
||||
| _italics_ | **bold** | `code` |
|
||||
|
||||
## Code Blocks
|
||||
|
||||
### Syntax
|
||||
|
||||
we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntax, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash
|
||||
|
||||
````markdown
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
````
|
||||
|
||||
### Output
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## List Types
|
||||
|
||||
### Ordered List
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
|
||||
### Unordered List
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
- List item
|
||||
- Another item
|
||||
- And another item
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
- List item
|
||||
- Another item
|
||||
- And another item
|
||||
|
||||
### Nested list
|
||||
|
||||
#### Syntax
|
||||
|
||||
```markdown
|
||||
- Fruit
|
||||
- Apple
|
||||
- Orange
|
||||
- Banana
|
||||
- Dairy
|
||||
- Milk
|
||||
- Cheese
|
||||
```
|
||||
|
||||
#### Output
|
||||
|
||||
- Fruit
|
||||
- Apple
|
||||
- Orange
|
||||
- Banana
|
||||
- Dairy
|
||||
- Milk
|
||||
- Cheese
|
||||
|
||||
## Other Elements — abbr, sub, sup, kbd, mark
|
||||
|
||||
### Syntax
|
||||
|
||||
```markdown
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
|
||||
|
||||
H<sub>2</sub>O
|
||||
|
||||
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||
|
||||
Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
|
||||
|
||||
H<sub>2</sub>O
|
||||
|
||||
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||
|
||||
Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
|
||||
16
apps/blog/src/content/blog/second-post.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: 'Second post'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jul 15 2022'
|
||||
heroImage: '/blog-placeholder-4.jpg'
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
||||
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
|
||||
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
16
apps/blog/src/content/blog/third-post.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: 'Third post'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jul 22 2022'
|
||||
heroImage: '/blog-placeholder-2.jpg'
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
||||
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
|
||||
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
31
apps/blog/src/content/blog/using-mdx.mdx
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: 'Using MDX'
|
||||
description: 'Lorem ipsum dolor sit amet'
|
||||
pubDate: 'Jun 01 2024'
|
||||
heroImage: '/blog-placeholder-5.jpg'
|
||||
---
|
||||
|
||||
This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file.
|
||||
|
||||
## Why MDX?
|
||||
|
||||
MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
|
||||
|
||||
If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.
|
||||
|
||||
## Example
|
||||
|
||||
Here is how you import and use a UI component inside of MDX.
|
||||
When you open this page in the browser, you should see the clickable button below.
|
||||
|
||||
import HeaderLink from '../../components/HeaderLink.astro';
|
||||
|
||||
<HeaderLink href="#" onclick="alert('clicked!')">
|
||||
Embedded component in MDX
|
||||
</HeaderLink>
|
||||
|
||||
## More Links
|
||||
|
||||
- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx)
|
||||
- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages)
|
||||
- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.
|
||||
92
apps/blog/src/layouts/BlogPost.astro
Normal file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import BaseHead from '../components/BaseHead.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import FormattedDate from '../components/FormattedDate.astro';
|
||||
import "../styles/global.css"
|
||||
|
||||
type Props = CollectionEntry<'blog'>['data'];
|
||||
|
||||
const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title={title} description={description} />
|
||||
<style>
|
||||
main {
|
||||
width: calc(100% - 2em);
|
||||
max-width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.hero-image {
|
||||
width: 100%;
|
||||
}
|
||||
.hero-image img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.prose {
|
||||
width: 720px;
|
||||
max-width: calc(100% - 2em);
|
||||
margin: auto;
|
||||
padding: 1em;
|
||||
color: rgb(var(--gray-dark));
|
||||
}
|
||||
.title {
|
||||
margin-bottom: 1em;
|
||||
padding: 1em 0;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
.title h1 {
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
.date {
|
||||
margin-bottom: 0.5em;
|
||||
color: rgb(var(--gray));
|
||||
}
|
||||
.last-updated-on {
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<article>
|
||||
|
||||
<div class="grid gap-8 items-start justify-center">
|
||||
<div class="relative group">
|
||||
<div class="absolute -inset-0.5 bg-radial-gradient opacity-40 group-hover:opacity-80 transition duration-1000 group-hover:duration-200 animate-tilt" />
|
||||
<div class="relative bg-black rounded-lg leading-none flex items-center divide-x divide-gray-600">
|
||||
{heroImage && <img width={1020} height={510} src={heroImage} alt="" />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prose">
|
||||
<div class="title">
|
||||
<div class="date">
|
||||
<FormattedDate date={pubDate} />
|
||||
{
|
||||
updatedDate && (
|
||||
<div class="last-updated-on">
|
||||
Last updated on <FormattedDate date={updatedDate} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<h1>{title}</h1>
|
||||
<hr />
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
62
apps/blog/src/pages/about.astro
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
import Layout from '../layouts/BlogPost.astro';
|
||||
---
|
||||
|
||||
<Layout
|
||||
title="About Me"
|
||||
description="Lorem ipsum dolor sit amet"
|
||||
pubDate={new Date('August 08 2021')}
|
||||
heroImage="/blog-placeholder-about.jpg"
|
||||
>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
||||
labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo
|
||||
viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam
|
||||
adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus
|
||||
et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus
|
||||
vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque
|
||||
sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non
|
||||
tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non
|
||||
blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna
|
||||
porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis
|
||||
massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc.
|
||||
Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis
|
||||
bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra
|
||||
massa massa ultricies mi.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl
|
||||
suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet
|
||||
nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae
|
||||
turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem
|
||||
dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat
|
||||
semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus
|
||||
vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum
|
||||
facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam
|
||||
vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla
|
||||
urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper
|
||||
viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc
|
||||
scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur
|
||||
gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus
|
||||
pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim
|
||||
blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id
|
||||
cursus metus aliquam eleifend mi.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta
|
||||
nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam
|
||||
tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci
|
||||
ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar
|
||||
proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
|
||||
</p>
|
||||
</Layout>
|
||||
21
apps/blog/src/pages/blog/[...slug].astro
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
import { type CollectionEntry, getCollection } from 'astro:content';
|
||||
import BlogPost from '../../layouts/BlogPost.astro';
|
||||
import { render } from 'astro:content';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.id },
|
||||
props: post,
|
||||
}));
|
||||
}
|
||||
type Props = CollectionEntry<'blog'>;
|
||||
|
||||
const post = Astro.props;
|
||||
const { Content } = await render(post);
|
||||
---
|
||||
|
||||
<BlogPost {...post.data}>
|
||||
<Content />
|
||||
</BlogPost>
|
||||
120
apps/blog/src/pages/blog/index.astro
Normal file
@@ -0,0 +1,120 @@
|
||||
---
|
||||
import BaseHead from '../../components/BaseHead.astro';
|
||||
import Header from '../../components/Header.astro';
|
||||
import Footer from '../../components/Footer.astro';
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts';
|
||||
import { getCollection } from 'astro:content';
|
||||
import FormattedDate from '../../components/FormattedDate.astro';
|
||||
import "../../styles/global.css"
|
||||
|
||||
const posts = (await getCollection('blog')).sort(
|
||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
|
||||
);
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
<style>
|
||||
main {
|
||||
width: 960px;
|
||||
}
|
||||
ul {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 2rem;
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
ul li {
|
||||
width: calc(50% - 1rem);
|
||||
}
|
||||
ul li * {
|
||||
text-decoration: none;
|
||||
transition: 0.2s ease;
|
||||
}
|
||||
ul li:first-child {
|
||||
width: 100%;
|
||||
margin-bottom: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
ul li:first-child img {
|
||||
width: 100%;
|
||||
}
|
||||
ul li:first-child .title {
|
||||
font-size: 2.369rem;
|
||||
}
|
||||
ul li img {
|
||||
|
||||
}
|
||||
ul li a {
|
||||
display: block;
|
||||
}
|
||||
.title {
|
||||
margin: 0;
|
||||
color: #d9d9d9;
|
||||
line-height: 1;
|
||||
}
|
||||
.date {
|
||||
margin: 0;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
ul li a:hover h4,
|
||||
ul li a:hover .date {
|
||||
color: #f2f2f2;
|
||||
}
|
||||
ul a:hover img {
|
||||
box-shadow: var(--box-shadow);
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
ul {
|
||||
gap: 0.5em;
|
||||
}
|
||||
ul li {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
ul li:first-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
ul li:first-child .title {
|
||||
font-size: 1.563em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<section>
|
||||
<ul>
|
||||
{
|
||||
posts.map((post) => (
|
||||
<li>
|
||||
<a href={`/blog/${post.id}/`}>
|
||||
|
||||
<div class="grid gap-8 items-start justify-center">
|
||||
<div class="relative group">
|
||||
<div class="absolute -inset-0.5 bg-radial-gradient opacity-0 group-hover:opacity-80 transition duration-1000 group-hover:duration-200 animate-tilt" />
|
||||
<div class="relative bg-black rounded-lg leading-none flex items-center divide-x divide-gray-600">
|
||||
<img width={720} height={360} src={post.data.heroImage} alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="title py-4">{post.data.title}</h4>
|
||||
<p class="date">
|
||||
<FormattedDate date={post.data.pubDate} />
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
49
apps/blog/src/pages/index.astro
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
import BaseHead from '../components/BaseHead.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
</head>
|
||||
<body>
|
||||
<Header />
|
||||
<main>
|
||||
<h1>🧑🚀 Hello, Astronaut!</h1>
|
||||
<p>
|
||||
Welcome to the official <a href="https://astro.build/">Astro</a> blog starter template. This
|
||||
template serves as a lightweight, minimally-styled starting point for anyone looking to build
|
||||
a personal website, blog, or portfolio with Astro.
|
||||
</p>
|
||||
<p>
|
||||
This template comes with a few integrations already configured in your
|
||||
<code>astro.config.mjs</code> file. You can customize your setup with
|
||||
<a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
|
||||
React, or Vue to your project.
|
||||
</p>
|
||||
<p>Here are a few ideas on how to get started with the template:</p>
|
||||
<ul>
|
||||
<li>Edit this page in <code>src/pages/index.astro</code></li>
|
||||
<li>Edit the site header items in <code>src/components/Header.astro</code></li>
|
||||
<li>Add your name to the footer in <code>src/components/Footer.astro</code></li>
|
||||
<li>Check out the included blog posts in <code>src/content/blog/</code></li>
|
||||
<li>Customize the blog post page layout in <code>src/layouts/BlogPost.astro</code></li>
|
||||
</ul>
|
||||
<p>
|
||||
Have fun! If you get stuck, remember to
|
||||
<a href="https://docs.astro.build/">read the docs</a>
|
||||
or <a href="https://astro.build/chat">join us on Discord</a> to ask questions.
|
||||
</p>
|
||||
<p>
|
||||
Looking for a blog template with a bit more personality? Check out
|
||||
<a href="https://github.com/Charca/astro-blog-template">astro-blog-template</a>
|
||||
by <a href="https://twitter.com/Charca">Maxi Ferreira</a>.
|
||||
</p>
|
||||
</main>
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
16
apps/blog/src/pages/rss.xml.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
||||
|
||||
export async function GET(context) {
|
||||
const posts = await getCollection('blog');
|
||||
return rss({
|
||||
title: SITE_TITLE,
|
||||
description: SITE_DESCRIPTION,
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
...post.data,
|
||||
link: `/blog/${post.id}/`,
|
||||
})),
|
||||
});
|
||||
}
|
||||
178
apps/blog/src/styles/global.css
Normal file
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
The CSS in this style tag is based off of Bear Blog's default CSS.
|
||||
https://github.com/HermanMartinus/bearblog/blob/297026a877bc2ab2b3bdfbd6b9f7961c350917dd/templates/styles/blog/default.css
|
||||
License MIT: https://github.com/HermanMartinus/bearblog/blob/master/LICENSE.md
|
||||
*/
|
||||
@import "tailwindcss";
|
||||
|
||||
|
||||
:root {
|
||||
/*--accent: rgb(255, 79, 1);*/
|
||||
/*--accent-dark: #fafafa;*/
|
||||
/*--black: 15, 18, 25;*/
|
||||
/*--gray: 96, 1, 159;*/
|
||||
/*--gray-light: 82, 82, 82;*/
|
||||
--gray-dark: 250, 250, 250;
|
||||
--gray-gradient: rgba(var(--gray-light), 50%), #fff;
|
||||
--box-shadow:
|
||||
0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%),
|
||||
0 16px 32px rgba(var(--gray), 33%);
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Atkinson';
|
||||
src: url('/fonts/atkinson-regular.woff') format('woff');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Atkinson';
|
||||
src: url('/fonts/atkinson-bold.woff') format('woff');
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Atkinson', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
background: linear-gradient(var(--gray-gradient)) no-repeat;
|
||||
background-color: #171717;
|
||||
background-size: 100% 600px;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
color: rgb(var(--gray-dark));
|
||||
font-size: 20px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
main {
|
||||
width: 720px;
|
||||
max-width: calc(100% - 2em);
|
||||
margin: auto;
|
||||
padding: 3em 1em;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
margin: 0 0 0.5rem 0;
|
||||
color: rgb(var(--black));
|
||||
line-height: 1.2;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3.052em;
|
||||
}
|
||||
h2 {
|
||||
font-size: 2.441em;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.953em;
|
||||
}
|
||||
h4 {
|
||||
font-size: 1.563em;
|
||||
}
|
||||
h5 {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
strong,
|
||||
b {
|
||||
font-weight: 700;
|
||||
}
|
||||
a {
|
||||
color: var(--accent);
|
||||
}
|
||||
a:hover {
|
||||
color: var(--accent);
|
||||
}
|
||||
p {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.prose p {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
}
|
||||
input {
|
||||
font-size: 16px;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
border-radius: 8px;
|
||||
}
|
||||
code {
|
||||
padding: 2px 5px;
|
||||
background-color: rgb(var(--gray-light));
|
||||
border-radius: 2px;
|
||||
}
|
||||
pre {
|
||||
padding: 1.5em;
|
||||
border-radius: 8px;
|
||||
}
|
||||
pre > code {
|
||||
all: unset;
|
||||
}
|
||||
blockquote {
|
||||
border-left: 4px solid var(--accent);
|
||||
padding: 0 0 0 20px;
|
||||
margin: 0px;
|
||||
font-size: 1.333em;
|
||||
}
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1px solid rgb(var(--gray-light));
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
body {
|
||||
font-size: 18px;
|
||||
}
|
||||
main {
|
||||
padding: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: absolute !important;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
/* IE6, IE7 - a 0 height clip, off to the bottom right of the visible 1px box */
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
/* maybe deprecated but we need to support legacy browsers */
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
/* modern browsers, clip-path works inwards from each corner */
|
||||
clip-path: inset(50%);
|
||||
/* added line to stop words getting smushed together (as they go onto separate lines and some screen readers do not understand line feeds as a space */
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bg-radial-gradient {
|
||||
filter: blur(32px);
|
||||
background-image: linear-gradient(
|
||||
90deg,
|
||||
rgb(239, 118, 70),
|
||||
rgb(251, 91, 88),
|
||||
rgb(255, 61, 116),
|
||||
rgb(249, 33, 149),
|
||||
rgb(227, 34, 188),
|
||||
rgb(181, 94, 230),
|
||||
rgb(118, 128, 252),
|
||||
rgb(0, 150, 255),
|
||||
rgb(0, 183, 255),
|
||||
rgb(0, 208, 242),
|
||||
rgb(0, 227, 184),
|
||||
rgb(70, 239, 111)
|
||||
);
|
||||
}
|
||||
15
apps/blog/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"include": [
|
||||
".astro/types.d.ts",
|
||||
"**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"dist"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true,
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "solid-js"
|
||||
}
|
||||
}
|
||||
14
apps/docs/.eslintrc.cjs
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['@nuxt/eslint-config'],
|
||||
ignorePatterns: [
|
||||
'dist',
|
||||
'node_modules',
|
||||
'.output',
|
||||
'.nuxt'
|
||||
],
|
||||
rules: {
|
||||
'vue/max-attributes-per-line': 'off',
|
||||
'vue/multi-word-component-names': 'off'
|
||||
}
|
||||
}
|
||||
12
apps/docs/.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
node_modules
|
||||
*.iml
|
||||
.idea
|
||||
*.log*
|
||||
.nuxt
|
||||
.vscode
|
||||
.DS_Store
|
||||
coverage
|
||||
dist
|
||||
sw.*
|
||||
.env
|
||||
.output
|
||||
2
apps/docs/.npmrc
Normal file
@@ -0,0 +1,2 @@
|
||||
shamefully-hoist=true
|
||||
strict-peer-dependencies=false
|
||||
87
apps/docs/RELAY.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# How to Deploy Your Own MoQ Relay on a Server
|
||||
|
||||
This guide will walk you through the steps to deploy your own MoQ relay on a server.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. **Server Requirements:**
|
||||
- Ensure port 443 is open for both TCP and UDP (`:443/udp & :443/tcp`).
|
||||
- The server should have a minimum of **4GB RAM** and **2 vCPUs**.
|
||||
- Supports ARM or AMD64 architecture.
|
||||
|
||||
2. **Software Requirements:**
|
||||
- Docker and `docker-compose` must be installed on the server. You can use [this installation script](https://github.com/docker/docker-install) for Docker.
|
||||
- Git must be installed to clone the necessary repository.
|
||||
|
||||
3. **Certificates:**
|
||||
- You will need private and public certificates. It is recommended to use certificates from a trusted CA rather than self-signed certificates.
|
||||
|
||||
## Installation Steps
|
||||
|
||||
### Step 1: Clone the Repository
|
||||
|
||||
Clone the `kixelated/moq-rs` repository to your local machine:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/kixelated/moq-rs moq
|
||||
```
|
||||
|
||||
### Step 2: Verify Port Availability
|
||||
|
||||
Check if port 443 is already in use on your server:
|
||||
|
||||
```bash
|
||||
sudo netstat -tulpn | grep ':443' | grep LISTEN
|
||||
```
|
||||
or
|
||||
```bash
|
||||
sudo lsof -i -P -n | grep LISTEN | grep 443
|
||||
```
|
||||
|
||||
If you find any processes using port 443, consider terminating them.
|
||||
|
||||
### Step 3: Configure Ports
|
||||
|
||||
Navigate to the cloned directory and edit the Docker compose file to use port 443:
|
||||
|
||||
```bash
|
||||
cd moq
|
||||
vim docker-compose.yml
|
||||
```
|
||||
|
||||
Change the ports section from lines 34 to 35 to:
|
||||
|
||||
```yaml
|
||||
ports:
|
||||
- "443:443"
|
||||
- "443:443/udp"
|
||||
```
|
||||
|
||||
### Step 4: Prepare Certificates
|
||||
|
||||
Copy your generated certificates into the `moq/dev` directory and rename them:
|
||||
|
||||
```bash
|
||||
cp cert.pem moq/dev/localhost.crt
|
||||
cp key.pem moq/dev/localhost.key
|
||||
```
|
||||
|
||||
### Step 5: Start Docker Instances
|
||||
|
||||
Ensure you are in the root directory of the `moq` project, then start the Docker containers:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Step 6: Link Domain to Server IP
|
||||
|
||||
Configure your DNS settings to connect your server's IP address to your domain:
|
||||
|
||||
```
|
||||
Record Type: A
|
||||
Subdomain: relay.fst.so
|
||||
IP Address: xx.xxx.xx.xxx
|
||||
```
|
||||
|
||||
Congratulations, your MoQ server is now set up! You can verify its functionality by using the [MoQ Checker](https://nestri.pages.dev/moq/checker).
|
||||
44
apps/docs/app.config.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
// https://github.com/nuxt-themes/docus/blob/main/nuxt.schema.ts
|
||||
export default defineAppConfig({
|
||||
docus: {
|
||||
title: 'Nestri',
|
||||
description: 'An open-source, self-hosted Geforce Now alternative',
|
||||
image: 'https://feat-relay-hetzner.nestri.pages.dev/logo.webp',
|
||||
socials: {
|
||||
twitter: 'nestriness',
|
||||
github: 'nestriness/nestri',
|
||||
reddit: '/r/nestri',
|
||||
website: {
|
||||
label: 'Website',
|
||||
icon: 'lucide:house',
|
||||
href: 'https://nestri.io'
|
||||
}
|
||||
},
|
||||
github: {
|
||||
dir: 'apps/docs/content',
|
||||
branch: 'main',
|
||||
repo: 'nestri',
|
||||
owner: 'nestriness',
|
||||
edit: true
|
||||
},
|
||||
aside: {
|
||||
level: 0,
|
||||
collapsed: false,
|
||||
exclude: []
|
||||
},
|
||||
main: {
|
||||
padded: true,
|
||||
fluid: true
|
||||
},
|
||||
logo: "/nestri-logo.svg",
|
||||
header: {
|
||||
logo: true,
|
||||
showLinkIcon: true,
|
||||
exclude: [],
|
||||
fluid: true
|
||||
},
|
||||
footer: {
|
||||
credits: false,
|
||||
}
|
||||
}
|
||||
})
|
||||
62
apps/docs/components/AppSocialIcons.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<script setup lang="ts">
|
||||
const socials = ['twitter', 'facebook', 'instagram', 'tiktok', 'youtube', 'github', 'medium', 'reddit', 'discord']
|
||||
|
||||
const { config } = useDocus()
|
||||
|
||||
const icons = computed<any>(() => {
|
||||
return Object.entries(config.value.socials || {})
|
||||
.map(([key, value]) => {
|
||||
if (typeof value === 'object') {
|
||||
return value
|
||||
} else if (typeof value === 'string' && value && socials.includes(key)) {
|
||||
return {
|
||||
href: /^https?:\/\//.test(value) ? value : `https://${key}.com/${value}`,
|
||||
icon: `fa-brands:${key}`,
|
||||
label: value,
|
||||
rel: 'noopener noreferrer'
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
})
|
||||
.filter(Boolean)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NuxtLink
|
||||
v-for="icon in icons"
|
||||
:key="icon.label"
|
||||
:rel="icon.rel"
|
||||
:title="icon.label"
|
||||
:aria-label="icon.label"
|
||||
:href="icon.href"
|
||||
target="_blank"
|
||||
>
|
||||
<Icon
|
||||
v-if="icon.icon"
|
||||
:name="icon.icon"
|
||||
/>
|
||||
</NuxtLink>
|
||||
</template>
|
||||
|
||||
<style lang="ts" scoped>
|
||||
css({
|
||||
a: {
|
||||
display: 'flex',
|
||||
color: '{color.gray.500}',
|
||||
padding: '{space.4}',
|
||||
|
||||
'@dark': {
|
||||
color: '{color.gray.400}'
|
||||
},
|
||||
|
||||
'&:hover': {
|
||||
color: '{color.gray.700}',
|
||||
'@dark': {
|
||||
color: '{color.gray.200}',
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
</style>
|
||||
3
apps/docs/components/Logo.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<img width="120" src="/img/nestri-logo-sm.svg"/>
|
||||
</template>
|
||||
70
apps/docs/components/content/Contributors.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
|
||||
|
||||
|
||||
<div class="py-8">
|
||||
<h2 class="text-3xl lg:text-4xl font-bold mb-12 text-gray-900">
|
||||
Contributors made <span class="text-orange-500">Nestri</span>
|
||||
</h2>
|
||||
<div class="grid grid-cols-4 sm:grid-cols-5 md:grid-cols-8 gap-4 sm:gap-5 lg:gap-6">
|
||||
<div
|
||||
v-for="(contributor, index) in contributors"
|
||||
:key="index"
|
||||
class="pt-[100%] relative"
|
||||
>
|
||||
<NuxtLink
|
||||
v-if="contributor.login"
|
||||
:key="contributor.login"
|
||||
:to="`https://github.com/${contributor.login}`"
|
||||
class="absolute inset-0 flex transition-all"
|
||||
:style="{
|
||||
'transition-delay': `${(index % 8 + Math.floor(index / 8)) * 20}ms`
|
||||
}"
|
||||
>
|
||||
<UTooltip class="w-full text-orange-500" :text="contributor.login">
|
||||
<NuxtImg
|
||||
:src="contributor.avatar_url"
|
||||
provider="ipx"
|
||||
densities="x1 x2"
|
||||
height="80px"
|
||||
width="80px"
|
||||
:alt="contributor.login"
|
||||
loading="lazy"
|
||||
class="rounded-xl w-full h-full transition lg:hover:scale-110"
|
||||
/>
|
||||
</UTooltip>
|
||||
<span class="inline-block rounded-t px-1 bg-gray-950 text-white absolute -bottom-2 right-0 font-medium text-sm">
|
||||
<span class="font-light text-xs text-gray-400">#</span>{{ index + 1 }}
|
||||
</span>
|
||||
|
||||
</NuxtLink>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
const contributors = ref([])
|
||||
|
||||
// Fetch contributors data from GitHub without authentication
|
||||
const fetchContributors = async () => {
|
||||
try {
|
||||
const response = await fetch('https://api.github.com/repos/nestriness/nestri/contributors')
|
||||
if (!response.ok) throw new Error('Failed to fetch contributors')
|
||||
contributors.value = await response.json()
|
||||
} catch (error) {
|
||||
console.error('Error fetching contributors:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch contributors when component is mounted
|
||||
onMounted(fetchContributors)
|
||||
</script>
|
||||
<style>
|
||||
:hover.
|
||||
</style>
|
||||
55
apps/docs/content/0.index.md
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
title: Home
|
||||
navigation: false
|
||||
layout: page
|
||||
main:
|
||||
fluid: false
|
||||
---
|
||||
|
||||
:ellipsis{right=0px width=75% blur=150px}
|
||||
|
||||
::block-hero
|
||||
---
|
||||
cta:
|
||||
- Get started
|
||||
- /introduction/what-is-nestri
|
||||
|
||||
secondary:
|
||||
- Open on GitHub →
|
||||
- https://github.com/nestriness/nestri
|
||||
---
|
||||
|
||||
#title
|
||||
An open-source, self-hosted Geforce Now alternative.
|
||||
|
||||
#description
|
||||
Play your favorite games on the go or with your friends on your own game cloud.
|
||||
|
||||
#extra
|
||||
::list
|
||||
- **Selfhosted** cloud gaming
|
||||
- **Open Source** and **Free**
|
||||
- 1.5k ⭐️ on GitHub
|
||||
|
||||
|
||||
::
|
||||
|
||||
<!--#support
|
||||
::terminal
|
||||
---
|
||||
content:
|
||||
- npx nuxi@latest init -t themes/docus
|
||||
- cd docs
|
||||
- npm install
|
||||
- npm run dev
|
||||
---
|
||||
::-->
|
||||
::
|
||||
|
||||
|
||||
|
||||
::contributors
|
||||
|
||||
|
||||
|
||||
::
|
||||
21
apps/docs/content/1.introduction/1.what-is-nestri.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# What is Nestri?
|
||||
|
||||
Nestri is a self-hosted cloud gaming platform that enables you to spin up dedicated gaming sessions remotely and play your own games from any device with a browser. Unlike remote desktop solutions like Parsec, which focus on streaming a desktop environment, Nestri is designed specifically for cloud gaming. It works similarly to services like NVIDIA GeForce Now, allowing you to enjoy high-performance gaming without needing to be physically near your gaming PC.
|
||||
|
||||
The key difference with Nestri is that it’s entirely self-hosted, so you have full control over the server, the games you install, and the entire setup. Nestri is ideal for gamers who prioritize privacy, flexibility, and control, offering a way to manage your own gaming infrastructure rather than relying on third-party services. As long as you have a stable internet connection and access to a web browser, you can game from virtually anywhere.
|
||||
|
||||
|
||||
## Nestri Modules
|
||||
|
||||
To provide a smooth and efficient gaming experience, Nestri is composed of the following key components:
|
||||
|
||||
### Nestri Node
|
||||
The Nestri Node is the core of your Nestri setup. It acts as the game server where you install and run your games. The Nestri Node streams gameplay from the machine it’s installed on, allowing you to access your games remotely. It runs on most Linux-based systems and requires an NVIDIA graphics card to ensure a high-quality gaming experience.
|
||||
|
||||
Since Nestri Node cannot run alongside Xorg (the graphical interface), it’s recommended to install it on a dedicated machine. This way, your server can focus solely on streaming your games while avoiding conflicts with your local display setup.
|
||||
|
||||
### Nestri Relay
|
||||
The Nestri Relay is responsible for transporting the video stream from your Nestri Node to the device you're gaming on. By default, Nestri connects to the Nestri-hosted Relay, which requires no configuration and is available for all users. This simplifies the setup process, ensuring a smooth streaming experience without the need for advanced networking or SSL certificate management.
|
||||
|
||||
For advanced users, it's possible to self-host the relay, but this requires the setup of secure SSL certificates. This option is typically more complex and is recommended only for developers or those familiar with network configuration.
|
||||
|
||||
19
apps/docs/content/1.introduction/2.faq.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# FAQ
|
||||
|
||||
|
||||
## Is Nestri free?
|
||||
Yes! Nestri offers two options: a free, self-hosted version and a paid, hosted version.
|
||||
- Self-Hosted Version (Free): If you have your own server, you can install and run Nestri for free. Since Nestri is open-source, you have full access to the codebase, allowing for transparency and flexibility in your setup.
|
||||
- Hosted Version (Paid): The hosted version of Nestri operates similarly to services like NVIDIA GeForce Now. With a subscription, you can play your games on Nestri’s infrastructure without needing any technical knowledge—just sign up, log in, and start gaming!
|
||||
|
||||
## Does Nestri require a high-speed internet connection?
|
||||
Yes, a stable and fast internet connection is essential for a smooth gaming experience. While you don’t need extremely high speeds (like 1 Gbps fiber), low latency is critical. Since cloud gaming is sensitive to delay, your device needs to connect to one of our relays with minimal lag. Ensuring a strong, stable network connection close to a relay server is important to avoid delays in gameplay, especially during fast-paced action sequences.
|
||||
|
||||
## Where are Nestri’s relays located?
|
||||
Currently, we have one relay deployed in Helsinki, Finland. As we grow, we plan to add more relays to reduce latency and improve connection quality for users in different regions. Our next planned relay is in Copenhagen, Denmark. Since we’re a startup with a limited budget, we’ll continue to roll out more relays as demand grows and more users join the platform.
|
||||
|
||||
## Is Nestri like Parsec?
|
||||
No, Nestri is not like Parsec, which is used to access and game on an existing desktop remotely. Nestri is a server application designed specifically for cloud gaming. Rather than connecting to a physical Windows desktop, Nestri runs your games within a Docker or Podman container, allowing you to play remotely without needing to access a traditional desktop environment.
|
||||
|
||||
## Do I need a high-end server with a 4090 GPU and a 64-core CPU?
|
||||
Not necessarily! Nestri doesn’t have strict hardware requirements in terms of having the latest or most powerful CPU or GPU. Just as with traditional gaming, better hardware will enhance your experience with improved graphics and higher FPS. The exact specs you need will depend on the games you want to play and the performance you’re aiming for. Keep in mind that, because Nestri runs games on Linux using Proton and the Gstreamer encoding, there will be a bit of additional processing required, so some extra power will be helpful.
|
||||
2
apps/docs/content/1.introduction/_dir.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
icon: ph:star-duotone
|
||||
navigation.redirect: /introduction/what-is-nestri
|
||||
9
apps/docs/content/2.nestri-node/1.what-is-nestri-node.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# What is Nestri Node?
|
||||
|
||||
Nestri Node is the core component of Nestri's self-hosted cloud-gaming solution, designed for users who want the freedom and flexibility of running their own game-streaming server. Similar to services like NVIDIA GeForce Now, Nestri allows you to play your games remotely via your browser. However, unlike other cloud-gaming platforms, Nestri is fully self-hosted, giving you complete control over your server and gaming experience.
|
||||
|
||||
The Nestri Node is the actual server where you install your games. Once set up, you can stream and play your games remotely from any compatible device. It runs on machines with Linux and requires an NVIDIA, AMD or an Intel graphics card .
|
||||
## ⚠️ Important Note
|
||||
|
||||
We recommend not installing Nestri Node on your primary PC if you only intend to use it over a weekend. This is because Nestri Node cannot run simultaneously with Xorg, the display server responsible for managing the graphical user interface (GUI). This means that while Nestri Node is running, you will not be able to use an attached screen. For this reason, Nestri Node is best set up on a dedicated machine that won’t be used for other tasks.
|
||||
|
||||
53
apps/docs/content/2.nestri-node/2.prerequisite.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Prerequisite
|
||||
|
||||
To run Nestri on your own server, there are several essential preparations required before installing nestri-node. This page outlines the key requirements to get Nestri up and running smoothly.
|
||||
|
||||
Nestri-node supports AMD, NVIDIA, and Intel graphics cards. For optimal performance, however, we recommend using Intel or NVIDIA GPUs. Our testing has shown that these GPUs provide the best results, while AMD graphics cards may encounter limitations due to partial support for Arch Linux in AMD's AMF drivers. As a workaround, we utilize the VA-API plugin for GStreamer with AMD cards to ensure functionality.
|
||||
|
||||
While it might be tempting to skip this setup, we advise against it. Taking the time to prepare now will help you avoid potential issues and wasted hours later.
|
||||
|
||||
## Recommended host configuration
|
||||
|
||||
::list{type="primary"}
|
||||
- **NVIDIA or Intel GPU** (AMD is supported, but not reccomended, due to lack of natively supported API-drivers in CachyOS)
|
||||
- **AVX supported CPU** (If your CPU doesent support AVX, you can use our `noavx` image)
|
||||
- **Fedora or Arch** based distributions ( [Debian and Ubuntu is **not** supported](/nestri-node/node-faq#can-i-run-nestri-node-on-debianubuntu) )
|
||||
::
|
||||
|
||||
## Software Requirements
|
||||
|
||||
::list{type="primary"}
|
||||
- **Nvidia Drivers**
|
||||
- **[NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-apt)**
|
||||
- **[Docker](https://linuxiac.com/how-to-install-docker-on-ubuntu-24-04-lts/)**
|
||||
|
||||
::
|
||||
|
||||
## Disconnect monitor
|
||||
Since Nestri requires access to your GPU, then you need to unplug you screen from it.
|
||||
If you want to see the Desktop and have a integrated graphicscard in your CPU, then you can connect your monitor to the motherboard.
|
||||
### Change the Default Boot Target to Multi-User (Non-GUI Mode)
|
||||
Ubuntu typically starts in graphical mode (using the graphical.target systemd target). You should change to the non-graphical multi-user.target, which will prevent Xorg from starting.
|
||||
|
||||
1. Open a terminal or access your system via SSH.
|
||||
2. To check your current default target (which should be graphical.target)
|
||||
|
||||
```bash
|
||||
systemctl get-default
|
||||
|
||||
```
|
||||
|
||||
3. Change the default target to multi-user.target (which corresponds to text mode, without Xorg):
|
||||
```bash
|
||||
sudo systemctl set-default multi-user.target
|
||||
|
||||
|
||||
```
|
||||
|
||||
4. Reboot the system
|
||||
|
||||
5. Verify that Xorg is not running
|
||||
```bash
|
||||
nvidia-smi
|
||||
```
|
||||
|
||||
101
apps/docs/content/2.nestri-node/3.getting-started.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# Getting Started
|
||||
|
||||
::alert{type="danger"}
|
||||
Nestri is in a **very early-beta phase**, so errors and bugs may occur.
|
||||
::
|
||||
|
||||
### Step 0: Construct Your Docker Image
|
||||
Checkout your branch with the latest version of nestri and build the image `<your-nestri-image>` within git root folder:
|
||||
```bash
|
||||
docker buildx build -t <your-nestri-image>:latest -f Containerfile.runner .
|
||||
```
|
||||
|
||||
::alert{type="info"}
|
||||
You can right now also pull the docker image from DatHorse GitHub Containter Registry with:
|
||||
```bash
|
||||
docker pull ghcr.io/datcaptainhorse/nestri-cachyos:latest
|
||||
```
|
||||
::
|
||||
|
||||
### Step 1: Navigate to Your Game Directory
|
||||
First, change your directory to the location of your `.exe` file. For Steam games, this typically means:
|
||||
```bash
|
||||
cd $HOME/.steam/steam/steamapps
|
||||
ls -la .
|
||||
```
|
||||
### Step 2: Generate a Session ID
|
||||
Create a unique session ID using the following command:
|
||||
```bash
|
||||
echo "$(head /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 16)"
|
||||
```
|
||||
This command generates a random 16-character string. Be sure to note this string carefully, as you'll need it for the next step.
|
||||
### Step 3: Launch the Nestri Server
|
||||
With your SESSION_ID ready, insert it into the command below, replacing `<your_session_id>` with your actual session ID, also replace `<relay_url>` with your relay URL and `<your-nestri-image>` with your build nestri image or nestri remote image. Then run the command to start the Nestri server:
|
||||
|
||||
```bash
|
||||
docker run --rm -it --shm-size=1g --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all --runtime=nvidia -e RELAY_URL='<relay_url>' -e NESTRI_ROOM=<your_session_id> -e RESOLUTION=1920x1080 -e FRAMERATE=60 -e NESTRI_PARAMS='--verbose=true --video-codec=h264 --video-bitrate=4000 --video-bitrate-max=6000'--name nestri -d -v "$(pwd)":/mnt/game/ <your-nestri-image>:latest
|
||||
```
|
||||
|
||||
### Step 4: Get Into your container
|
||||
Get into your container to start your game:
|
||||
```bash
|
||||
sudo docker exec -it nestri bash
|
||||
```
|
||||
### Step 5: Installing a Launcher
|
||||
For most games that are not DRM free you need a launcher. In this case use the umu launcher and optional mangohud:
|
||||
```bash
|
||||
pacman -S --overwrite="*" umu-launcher mangohud
|
||||
```
|
||||
|
||||
### Step 5: Running Your Game
|
||||
You have to execute your game now with nestri user. If you have a linux game just execute it with the nestri user
|
||||
```bash
|
||||
su nestri
|
||||
source /etc/nestri/envs.sh
|
||||
GAMEID=0 PROTONPATH=GE-Proton mangohud umu-run /mnt/game/<your-game.exe>
|
||||
```
|
||||
|
||||
### Step 6: Begin Playing
|
||||
Finally, construct the play URL with your session ID:
|
||||
`https://nestri.io/play/<your_session_id>`
|
||||
|
||||
Navigate to this URL in your browser, click on the page to capture your mouse pointer, and start playing!
|
||||
|
||||
::alert{type="info"}
|
||||
You can also use other relays/frontends depending on your choosen `<relay_url>`
|
||||
For testing you can use DatHorse Relay and Frontend:
|
||||
|
||||
| **Placeholder** | **URL** |
|
||||
| ---------------------------- | ---------- |
|
||||
| `<relay_url>` | `https://relay.dathorse.com/` |
|
||||
| `<frontend_url>` | `https://nestritest.dathorse.com/play/<your_session_id>` |
|
||||
::
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Nestri Node is easy to install using the provided installation script. Follow the steps below to get started.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Download the installation script using `wget`:
|
||||
|
||||
```bash
|
||||
wget https://github.com/nestriness/nestri/nestri-node-install.sh
|
||||
|
||||
```
|
||||
|
||||
2. Make the script executable:
|
||||
```bash
|
||||
chmod +x nestri-node-install.sh
|
||||
|
||||
|
||||
```
|
||||
3. Run the script to start the installation process:
|
||||
```bash
|
||||
./nestri-node-install.sh
|
||||
```
|
||||
::-->
|
||||
|
||||
|
||||
2
apps/docs/content/2.nestri-node/4.troubleshooting.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# Troubleshooting
|
||||
|
||||
22
apps/docs/content/2.nestri-node/5.container-cli.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Container CLI
|
||||
The Container CLI for Nestri provides parameters to configure and manage your container environment. Use these options to set values like `relay-url`, `video resolution`, and `frame rate`. Additionally, activate `verbose` mode and logging to assist in debugging and error tracking. This documentation details each parameter to help you optimize your container setup effectively
|
||||
|
||||
|
||||
| **Parameter** | **Type** | **Default** | **Description** |
|
||||
| ---------------------------- | ---------- | --------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `-v, --verbose` | `string` | false | Shows more logs, for issues we recommend turning it on before running nestri-server and sending the logs for debugging (i.e. `nestri-server --verbose=true > logs.txt`) |
|
||||
| `-d, --debug-feed` | `string` | false | Adds a timer overlay at bottom-right in the video stream, along with spawning an X11 window on host for doing comparisons against |
|
||||
| `-u, --relay-url` | `string` | https://relay.fst.so | [MoQ relay](/nestri-relay/what-is-nestri-node) endpoint URL (must begin with `https://` as MoQ __can't work with unsafe connections__) |
|
||||
| `-p, --relay-path` | `string` | default generated on start if not set | namespace/path for the stream, identifies the stream (basically stream name), must be unique |
|
||||
| **Video** | | | |
|
||||
| `-r, --resolution ` | `string` | 1280x720 | Sets nestri virtual display + stream resolution using `WIDTHxHEIGHT` format |
|
||||
| `-f, --framerate` | `integer` | 60 | Framerate for nestri virtual display + stream |
|
||||
| `-g, --gpu-vendor` | `string` | | allows selecting specific GPU by vendor name (`nvidia`, `amd` or `intel`) |
|
||||
| `-i, --gpu-index` | `string` | | allows selecting a GPU by it's general name, doesn't have to be full name as it's matched partially (i.e. `3060` would get you `RTX 3060` GPU, but it would also let `RTX 3060 Ti` pass) |
|
||||
| `-a, --gpu-card-path` | `string` | | allows specifying GPU by `/dev/dri/cardX` or `/dev/dri/renderX` path, this won't work with the other 3 gpu parameters as it's explicitly setting the GPU |
|
||||
| **Encoder** | | | |
|
||||
| `-c, --encoder-vcodec` | `string` | h264 | Sets the stream video codec (`h264` or `av1`) |
|
||||
| `-t, --encoder-type` | `string` | hardware | Sets whether to use GPU encoder (`hardware`), or CPU encoder (`software`, only should be used with debugging or if GPU has no encoding capabilities) |
|
||||
| `-e, --encoder-name` | `string` | | forces a specific encoder by GStreamer element name (i.e. `vah264enc`) |
|
||||
| `-q, --encoder-cqp` | `string` | 25 | sets the stream quality level, lower means higher quality and much more bitrate used |
|
||||
|
||||
12
apps/docs/content/2.nestri-node/6.node-faq.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Node FAQ
|
||||
|
||||
This FAQ is made to address common questions about Nestri Node, the container which runs your games. Whether you're curious about compatibility, setup, or performance, you'll find answers to help you get started..
|
||||
|
||||
## Can I run Nestri Node on Debian/Ubuntu? :icon{name="logos:ubuntu" style="opacity:100"} :icon{name="logos:debian" style="opacity:100"}
|
||||
Unfortunately, it is not possible to run Nestri Node on Debian-based distributions like Ubuntu at this time. After extensive debugging efforts, we have decided to focus on platforms that currently work well, such as Fedora and Arch-based distributions. We may revisit the possibility of supporting Debian in the future, but for now, it is not supported.
|
||||
|
||||
## Can I run Nestri Node in a virtualized environment like Proxmox?
|
||||
Yes, you can run Nestri Node in a virtualized environment, provided you passthrough your GPU to the virtual machine. However, we do not recommend this setup as virtualization may introduce additional overhead and latency. For the best performance, we recommend running Nestri Node on bare-metal hardware.
|
||||
|
||||
## Can I run Nestri Node on Windows-based systems?
|
||||
No, the Nestri Node service does not support Windows-based systems. It can only be deployed on Linux servers.
|
||||
2
apps/docs/content/2.nestri-node/_dir.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
title: 'Nestri Node'
|
||||
icon: heroicons-outline:bookmark-alt
|
||||
@@ -0,0 +1,9 @@
|
||||
# What is Nestri Relay?
|
||||
|
||||
Nestri Relay is an essential component in the Nestri cloud-gaming ecosystem, responsible for transporting the video gameplay stream from your Nestri Node to the device you’re playing on. It is built on the moq-rs protocol, designed for efficient and smooth video transmission, ensuring a low-latency gaming experience.
|
||||
|
||||
By default, your Nestri Node will connect to the Nestri-hosted Relay, which we manage and is available for all users. This is the simplest and most straightforward option, requiring no additional configuration on your end.
|
||||
## ⚠️ Important Note
|
||||
|
||||
We recommend not installing Nestri Node on your primary PC if you only intend to use it over a weekend. This is because Nestri Node cannot run simultaneously with Xorg, the display server responsible for managing the graphical user interface (GUI). This means that while Nestri Node is running, you will not be able to use an attached screen. For this reason, Nestri Node is best set up on a dedicated machine that won’t be used for other tasks.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
## Self-hosted Nestri Relay
|
||||
|
||||
For those who prefer full control over their infrastructure, it is possible to self-host the Nestri Relay. However, setting this up can be a bit complex, as it requires generating SSL certificates for secure communication between your Nestri Node and your gaming devices. There are three main options:
|
||||
|
||||
- **Let's Encrypt Certificate**: This is the **recommended option** for self-hosting and requires a domain name. You can generate a certificate using tools like **certbot** or **acme.sh**. Let's Encrypt provides free SSL certificates that are trusted by most browsers and are relatively straightforward to set up.
|
||||
|
||||
- **Purchased SSL Certificate**: The **easiest option** for most users is to buy an SSL certificate from a trusted Certificate Authority (CA). This option eliminates much of the hassle involved with certificate generation, as these certificates are already trusted by browsers and don’t require as much manual setup.
|
||||
|
||||
While self-hosting offers more flexibility, most users will find the **Nestri-hosted Relay** to be the easiest and most reliable option for getting started with cloud gaming on Nestri. This hosted relay is available to everyone and requires no configuration.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. **Server Requirements:**
|
||||
- Ensure **port 443** is open for both **TCP and UDP** (`:443/udp & :443/tcp`).
|
||||
- The server should have at least **4GB RAM** and **2 vCPUs**.
|
||||
- Supports both ARM or AMD64 architecture.
|
||||
|
||||
2. **Software Requirements:**
|
||||
- Docker and `docker-compose` must be installed on the server. You can use [this installation script](https://github.com/docker/docker-install) to set up Docker.
|
||||
- Git must be installed to clone the necessary repository.
|
||||
|
||||
3. **Certificates:**
|
||||
- You will need both private and public SSL certificates. It is recommended to use certificates from a **trusted Certificate Authority** (CA), either by using **Let's Encrypt** or purchasing a commercial SSL certificate, for secure communication. Avoid using self-signed certificates, as they can lead to compatibility issues and security warnings in browsers.
|
||||
69
apps/docs/content/3.nestri-relay/3.deploy-moq.md
Normal file
@@ -0,0 +1,69 @@
|
||||
## Installation Steps
|
||||
|
||||
### Step 1: Clone the Repository
|
||||
|
||||
Clone the `kixelated/moq-rs` repository to your local machine:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/kixelated/moq-rs moq
|
||||
```
|
||||
|
||||
### Step 2: Verify Port Availability
|
||||
|
||||
Check if port 443 is already in use on your server:
|
||||
|
||||
```bash
|
||||
sudo netstat -tulpn | grep ':443' | grep LISTEN
|
||||
```
|
||||
or
|
||||
```bash
|
||||
sudo lsof -i -P -n | grep LISTEN | grep 443
|
||||
```
|
||||
|
||||
If you find any processes using port 443, consider terminating them.
|
||||
|
||||
### Step 3: Configure Ports
|
||||
|
||||
Navigate to the cloned directory and edit the Docker compose file to use port 443:
|
||||
|
||||
```bash
|
||||
cd moq
|
||||
vim docker-compose.yml
|
||||
```
|
||||
|
||||
Change the ports section from lines 34 to 35 to:
|
||||
|
||||
```yaml
|
||||
ports:
|
||||
- "443:443"
|
||||
- "443:443/udp"
|
||||
```
|
||||
|
||||
### Step 4: Prepare Certificates
|
||||
|
||||
Copy your generated certificates into the `moq/dev` directory and rename them:
|
||||
|
||||
```bash
|
||||
cp cert.pem moq/dev/localhost.crt
|
||||
cp key.pem moq/dev/localhost.key
|
||||
```
|
||||
|
||||
### Step 5: Start Docker Instances
|
||||
|
||||
Ensure you are in the root directory of the `moq` project, then start the Docker containers:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Step 6: Link Domain to Server IP
|
||||
|
||||
Configure your DNS settings to connect your server's IP address to your domain:
|
||||
|
||||
```
|
||||
Record Type: A
|
||||
Subdomain: relay.fst.so
|
||||
IP Address: xx.xxx.xx.xxx
|
||||
```
|
||||
|
||||
Congratulations, your MoQ server is now set up! You can verify its functionality by using the [MoQ Checker](https://nestri.pages.dev/moq/checker).
|
||||
42
apps/docs/content/3.nestri-relay/4.advanced-users.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# ⚠️ Advanced users
|
||||
|
||||
## Generating an SSL Certificate for Nestri Relay
|
||||
|
||||
This guide is for developers and advanced users who wish to self-host Nestri Relay. We strongly discourage this setup for general users due to its complexity, particularly when it comes to configuring SSL certificates correctly. Using a self-signed certificate or manually generating certificates can lead to issues with browser compatibility and security warnings, making it difficult to ensure a smooth experience.
|
||||
|
||||
For most users, we highly recommend using the **Nestri-hosted Relay**, which requires no manual setup and is ready to use out of the box.
|
||||
|
||||
---
|
||||
|
||||
## Generating an SSL Certificate Using Terraform
|
||||
|
||||
If you still wish to proceed with self-hosting, we recommend using Terraform to generate a valid SSL certificate. This method provides a secure, automated way to obtain the necessary certificates for Nestri Relay.
|
||||
|
||||
### Usage
|
||||
|
||||
1. **Update the `terraform.tfvars`** file with your domain and email.
|
||||
2. Run the following command to initialize the Terraform working directory:
|
||||
|
||||
```bash
|
||||
terraform init
|
||||
```
|
||||
```bash
|
||||
terraform plan
|
||||
```
|
||||
```bash
|
||||
terraform apply
|
||||
```
|
||||
The configuration provides two sensitive outputs:
|
||||
```bash
|
||||
certificate_pem: The full certificate chain
|
||||
private_key_pem: The private key for the certificate
|
||||
```
|
||||
|
||||
These can be then be used in your `moq-relay` as it requires SSL/TLS certificates.
|
||||
|
||||
## Note
|
||||
The generated certificate and key files are saved locally and ignored by git:
|
||||
```git
|
||||
.terraform
|
||||
relay_*
|
||||
```
|
||||
4
apps/docs/content/3.nestri-relay/5.moq-tester.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## MOQ Tester
|
||||
Test your Nestri Relay, with our MOQ tester tool.
|
||||
|
||||
:button-link[Try MOQ Test Tool]{size="small" icon="IconStackBlitz" href="https://nestri.pages.dev/moq/checker" blank}
|
||||
2
apps/docs/content/3.nestri-relay/_dir.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
title: 'Nestri Relay'
|
||||
icon: heroicons-outline:bookmark-alt
|
||||
3
apps/docs/content/4.nestri-internal/1.what-is-this.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# What is this?
|
||||
|
||||
This is the part of the docs dedicated for the team working on Nestri
|
||||
27
apps/docs/content/4.nestri-internal/2.setup.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Setup
|
||||
|
||||
- Install bun [https://bun.sh/](https://bun.sh/)
|
||||
- Generate your Cloudflare token from [here](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22dns%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22memberships%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22user_details%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_kv_storage%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_r2%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_routes%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_scripts%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_tail%22%2C%22type%22%3A%22read%22%7D%5D&name=sst&accountId=*&zoneId=all)
|
||||
- save it to a `.env` file like this
|
||||
```
|
||||
CLOUDFLARE_API_TOKEN=xxx
|
||||
```
|
||||
- Copy this to your `~/.aws/config` file
|
||||
```
|
||||
[sso-session nestri]
|
||||
sso_start_url = https://nestri.awsapps.com/start
|
||||
sso_region = us-east-1
|
||||
|
||||
[profile nestri-dev]
|
||||
sso_session = nestri
|
||||
sso_account_id = 535002871375
|
||||
sso_role_name = AdministratorAccess
|
||||
region = us-east-1
|
||||
|
||||
[profile nestri-production]
|
||||
sso_session = nestri
|
||||
sso_account_id = 209479283398
|
||||
sso_role_name = AdministratorAccess
|
||||
region = us-east-1
|
||||
```
|
||||
- You need to login once a day with `bun sso` in root
|
||||
2
apps/docs/content/4.nestri-internal/_dir.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
title: 'Nestri Internals'
|
||||
icon: heroicons-outline:bookmark-alt
|
||||
14
apps/docs/nuxt.config.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export default defineNuxtConfig({
|
||||
// https://github.com/nuxt-themes/docus
|
||||
extends: ['@nuxt-themes/docus'],
|
||||
components: true,
|
||||
|
||||
|
||||
devtools: { enabled: true },
|
||||
|
||||
modules: [// Remove it if you don't use Plausible analytics
|
||||
// https://github.com/nuxt-modules/plausible
|
||||
'@nuxtjs/plausible', '@nuxt/ui'],
|
||||
|
||||
compatibilityDate: '2024-09-29'
|
||||
})
|
||||
20844
apps/docs/package-lock.json
generated
Normal file
22
apps/docs/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "docus-starter",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"nestri.dev": "nuxi dev",
|
||||
"build": "nuxi build --preset=cloudflare_pages",
|
||||
"generate": "nuxi generate",
|
||||
"preview": "nuxi preview",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxt-themes/docus": "latest",
|
||||
"@nuxt/devtools": "^2.3.2",
|
||||
"@nuxt/eslint-config": "^0.5.6",
|
||||
"@nuxt/ui": "^2.19.2",
|
||||
"@nuxtjs/plausible": "^1.0.2",
|
||||
"@types/node": "^20.16.5",
|
||||
"eslint": "^9.10.0",
|
||||
"nuxt": "^3.16.1"
|
||||
}
|
||||
}
|
||||
BIN
apps/docs/public/cover.png
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
apps/docs/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
1
apps/docs/public/img/nestri-logo-sm.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 167 44" width="167" height="44"><defs><image width="47" height="36" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAkCAMAAAAuPpNdAAAAAXNSR0IB2cksfwAAAEJQTFRF/1gO/1MG/1MG/1UJ/08B/08B/14X/1oQ/1oQAAAA/18Z/1oR/1oR/1kP/1MH/1MH/2ck/2Me/2Me/24v/2sq/2sqUcSXkwAAABZ0Uk5T//+f//+fp6hpACsrG3BwRmdoQUpKLmJsmB4AAAA6SURBVHicY2RgZCABMDIyj6ofUPVsJKrnJEU5UAOp6rkGWfiMqqeuet5Blt4EBln4jKqnrnph0tQDAHjbARfH6mW/AAAAAElFTkSuQmCC"/></defs><style>.a{fill:#0a0a0a}</style><use href="#img1" x="6" y="4"/><path class="a" d="m69.2 34h-5.8v-24h7.9l8.5 16.3h0.1v-16.3h5.8v24h-7.4l-9-16.8h-0.1zm28.4 0.5q-2.8 0-4.6-0.7-1.8-0.8-3-2.2-1.1-1.3-1.6-3.1-0.5-1.7-0.5-3.6 0-2.1 0.5-4 0.6-1.9 1.7-3.3 1.1-1.5 2.8-2.4 1.8-0.8 4.3-0.8 2.5 0 4.2 0.8 1.8 0.9 2.8 2.4 1.1 1.5 1.4 3.5 0.3 2-0.1 4.3l-13.9 0.2v-3.1l9.4-0.2-0.8 1.8q0.3-1.6 0-2.8-0.3-1.1-1-1.7-0.7-0.6-2-0.6-1.4 0-2.1 0.7-0.8 0.7-1.2 1.9-0.3 1.3-0.3 3 0 2.9 1 4.2 1 1.4 3 1.4 0.9 0 1.4-0.2 0.6-0.2 1-0.6 0.3-0.5 0.5-1.1 0.1-0.6 0.1-1.3l5.4 0.2q0.1 1.2-0.3 2.5-0.3 1.3-1.3 2.4-0.9 1.1-2.6 1.8-1.7 0.6-4.2 0.6zm18.7 0q-1.9 0-3.6-0.3-1.6-0.4-2.8-1.3-1.2-0.8-1.9-2.2-0.6-1.4-0.5-3.4l5.1-0.4q0.1 1.2 0.6 2 0.4 0.7 1.3 1.1 0.8 0.4 2 0.4 1.1 0 1.9-0.4 0.9-0.4 0.9-1.3 0-0.5-0.3-0.8-0.3-0.3-1.1-0.5-0.8-0.3-2.3-0.7-1.8-0.5-3.3-0.9-1.5-0.5-2.6-1.2-1-0.6-1.5-1.6-0.6-0.9-0.6-2.4 0-2 1.1-3.3 1-1.4 2.9-2.2 1.9-0.7 4.4-0.7 2.2 0 4.1 0.7 2 0.6 3 2.2 1.2 1.6 0.9 4.1l-5 0.5q0.1-1-0.3-1.8-0.4-0.7-1.2-1.1-0.7-0.4-1.8-0.4-1.3 0-2 0.5-0.6 0.4-0.6 1.1 0 0.5 0.4 0.9 0.4 0.4 1.3 0.7 0.9 0.3 2.3 0.6 1.3 0.2 2.6 0.6 1.3 0.4 2.5 1.1 1.2 0.7 1.9 1.8 0.7 1.1 0.7 2.7 0 1.8-1 3.1-0.9 1.4-2.8 2.1-1.9 0.7-4.7 0.7zm18.1 0q-3.4 0-5.1-1.7-1.6-1.8-1.6-5.4v-8h-2.1v-3.7h0.1q2.2-0.2 3.2-1.4 0.9-1.3 1.1-3.7v-0.1h3.5v4.4h4.4v4.7h-4.4v7.2q0 1.4 0.6 2 0.7 0.6 1.7 0.6 0.5 0 1.1-0.2 0.5-0.1 1-0.4v5.2q-1.1 0.3-2 0.4-0.9 0.1-1.5 0.1zm11.5-0.5h-5.8v-10.4-8.7h5v7.6h0.3q0.2-3.1 0.9-4.8 0.6-1.8 1.6-2.5 0.9-0.8 2.1-0.8 0.7 0 1.4 0.2 0.7 0.2 1.4 0.6l-0.3 6.5q-0.8-0.4-1.6-0.7-0.7-0.2-1.4-0.2-1.2 0-2 0.6-0.8 0.7-1.2 2-0.4 1.2-0.4 3zm14.5 0h-5.8v-19.1h5.8zm-2.9-20.6q-1.7 0-2.6-0.6-0.9-0.8-0.9-2.1 0-1.4 0.9-2.1 0.9-0.7 2.6-0.7 1.7 0 2.6 0.7 0.9 0.7 0.9 2.1 0 1.3-0.9 2-0.9 0.7-2.6 0.7z"/></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
BIN
apps/docs/public/img/nestri-logo.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
1
apps/docs/public/img/nestri-logo.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1080 1080" width="1080" height="1080"><defs><image width="308" height="234" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATQAAADqCAMAAAAbHElGAAAAAXNSR0IB2cksfwAAADNQTFRF/5Bf/2wr/3tB/08B/4VQ/2Uh/9K//9K/AAAA/5xw/3tA/5Fg/2wr/5Zo/4NN/9K//9K/u/+9NwAAABF0Uk5T/f////H/HCsAVVWAgLjVOVVGDSqkAAACDElEQVR4nO3cQQrCAAxFwUaKKCK9/217hryNCDMnCG/7IXPMwdI8RFsTLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLZhTtLV5irY2r19f8IdEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAvmbSNYM+EFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBfMRbc2nvkC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0QLRAtEC0YL6GlTUTXiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaIFogWiBaMKdoa3OJtnYDtq8EmnzQ7p8AAAAASUVORK5CYII="/></defs><style>.a{fill:#0a0a0a}</style><use href="#img1" x="8" y="423"/><path class="a" d="m426 624h-38.4v-158.4h52.1l56.4 107.3h0.5v-107.3h38.4v158.4h-49l-59.5-110.9h-0.5zm187.4 3.4q-18 0-30.2-5.1-12-5.2-19.4-14.1-7.5-9.1-10.8-20.7-3.2-11.5-3.2-24.2 0-13.7 3.4-26.2 3.6-12.4 10.8-22 7.4-9.9 19-15.4 11.7-5.8 28-5.8 16.4 0 27.9 5.8 11.7 5.5 18.7 15.6 7 10.1 8.9 23.3 2.1 13.2-0.5 28.5l-91.9 1.5v-21.1l62.1-1.2-5 12.2q1.4-11-0.5-18.5-1.7-7.7-6.5-11.5-4.8-4.1-13.2-4.1-8.8 0-14.1 4.6-5.3 4.5-7.5 12.9-2.1 8.2-2.1 19.5 0 19.4 6.5 28.3 6.4 8.9 19.9 8.9 5.7 0 9.6-1.5 3.8-1.4 6.2-4 2.4-2.9 3.4-6.8 0.9-4 0.7-9.1l35.5 1.9q0.7 8-1.7 16.4-2.1 8.4-8.4 15.6-6.2 7.2-17.5 11.7-11 4.6-28.1 4.6zm124.1 0q-12.7 0-23.7-2.4-10.8-2.7-19-8.2-7.9-5.5-12.2-14.6-4.1-9.4-3.4-22.6l33.8-2.9q0.5 8 3.6 13.2 3.2 5.1 8.7 7.5 5.5 2.4 13.4 2.4 7.5 0 12.7-2.4 5.6-2.7 5.6-8.7 0-3.1-2-5-1.9-2.2-7.2-3.8-5-2-14.8-4.4-12.3-3.1-22.1-6.2-9.9-3.1-16.8-7.4-7-4.4-10.6-10.6-3.6-6.5-3.6-15.8 0-13.2 7-22.4 7.2-9.3 19.7-14.1 12.4-5.1 28.8-5.1 14.6 0 27.3 4.6 12.7 4.6 19.9 14.9 7.5 10.3 5.6 27.3l-33.2 3.2q0.8-7-1.9-11.8-2.6-5-7.7-7.4-5-2.7-12.2-2.7-8.2 0-12.7 3.1-4.3 2.9-4.3 7.5 0 3.6 2.6 6.2 2.9 2.4 8.6 4.3 6 1.7 15.4 3.9 8.2 1.7 17 4.3 8.9 2.6 16.6 7.2 7.7 4.3 12.5 11.5 4.8 7.2 4.8 18.3 0 11.7-6.5 20.6-6.5 8.9-19 13.7-12.4 4.8-30.7 4.8zm119.3-0.5q-22.3 0-33.4-11.3-10.8-11.5-10.8-35.5v-52.6h-13.9v-24.4h0.7q14.9-2 21.2-9.9 6.2-8.1 7.6-24.5v-0.4h22.8v29h29.1v31.2h-29.1v48q0 9.1 4.4 13 4.5 3.8 11 3.8 3.4 0 7-1 3.6-0.9 6.7-2.6v33.8q-7.5 2.2-13.2 2.9-5.8 0.5-10.1 0.5zm76.3-2.9h-38.6v-68.9-57.8h33.6v50.4h1.9q1.4-20.2 5.5-31.7 4.3-11.7 10.6-16.5 6.5-5.1 14.4-5.1 4.3 0 8.9 1.2 4.8 1.2 9.3 3.9l-1.9 43.2q-5.3-3.2-10.3-4.6-5.1-1.7-9.6-1.7-7.7 0-13 4.3-5.3 4.4-8.1 12.8-2.7 8.4-2.7 20.4zm96.3 0h-38.9v-126.8h38.9zm-19.7-135.8q-11.1 0-17.1-4.6-5.7-4.8-5.7-13.6 0-9.2 5.7-13.7 6-4.8 17.1-4.8 11.3 0 17 4.8 6 4.8 6 13.7 0 8.6-6 13.4-5.7 4.8-17 4.8z"/></svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
6
apps/docs/renovate.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": ["github>nuxt/renovate-config-nuxt"],
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
218
apps/docs/tokens.config.ts
Normal file
@@ -0,0 +1,218 @@
|
||||
import { defineTheme } from 'pinceau'
|
||||
|
||||
export default defineTheme({
|
||||
color: {
|
||||
black: '#0B0A0A',
|
||||
// Primary is modified lightblue
|
||||
primary: {
|
||||
50: '#fff6ec',
|
||||
100: '#ffebd3',
|
||||
200: '#ffd4a5',
|
||||
300: '#ffb56d',
|
||||
400: '#ff8a32',
|
||||
500: '#ff680a',
|
||||
600: '#ff4f01',
|
||||
700: '#cc3602',
|
||||
800: '#a12b0b',
|
||||
900: '#82260c'
|
||||
},
|
||||
gray: {
|
||||
50: '#FBFBFB',
|
||||
100: '#F6F5F4',
|
||||
200: '#ECEBE8',
|
||||
300: '#DBD9D3',
|
||||
400: '#ADA9A4',
|
||||
500: '#97948F',
|
||||
600: '#67635D',
|
||||
700: '#36332E',
|
||||
800: '#201E1B',
|
||||
900: '#121110'
|
||||
},
|
||||
red: {
|
||||
50: '#FFF9F8',
|
||||
100: '#FFF3F0',
|
||||
200: '#FFDED7',
|
||||
300: '#FFA692',
|
||||
400: '#FF7353',
|
||||
500: '#FF3B10',
|
||||
600: '#BB2402',
|
||||
700: '#701704',
|
||||
800: '#340A01',
|
||||
900: '#1C0301'
|
||||
},
|
||||
blue: {
|
||||
50: '#F2FAFF',
|
||||
100: '#DFF3FF',
|
||||
200: '#C6EAFF',
|
||||
300: '#A1DDFF',
|
||||
400: '#64C7FF',
|
||||
500: '#1AADFF',
|
||||
600: '#0069A6',
|
||||
700: '#014267',
|
||||
800: '#002235',
|
||||
900: '#00131D'
|
||||
},
|
||||
green: {
|
||||
50: '#ECFFF7',
|
||||
100: '#DEFFF1',
|
||||
200: '#C3FFE6',
|
||||
300: '#86FBCB',
|
||||
400: '#3CEEA5',
|
||||
500: '#0DD885',
|
||||
600: '#00B467',
|
||||
700: '#006037',
|
||||
800: '#002817',
|
||||
900: '#00190F'
|
||||
},
|
||||
yellow: {
|
||||
50: '#FFFCEE',
|
||||
100: '#FFF6D3',
|
||||
200: '#FFF0B1',
|
||||
300: '#FFE372',
|
||||
400: '#FFDC4E',
|
||||
500: '#FBCA05',
|
||||
600: '#CBA408',
|
||||
700: '#614E02',
|
||||
800: '#292100',
|
||||
900: '#1B1500'
|
||||
},
|
||||
shadow: {
|
||||
initial: '{color.gray.400}',
|
||||
dark: '{color.gray.800}'
|
||||
}
|
||||
},
|
||||
shadow: {
|
||||
xs: '0px 1px 2px 0px {color.shadow}',
|
||||
sm: '0px 1px 3px 0px {color.shadow}, 0px 1px 2px -1px {color.shadow}',
|
||||
md: '0px 4px 6px -1px {color.shadow}, 0px 2px 4px -2px {color.shadow}',
|
||||
lg: '0px 10px 15px -3px {color.shadow}, 0px 4px 6px -4px {color.shadow}',
|
||||
xl: '0px 20px 25px -5px {color.shadow}, 0px 8px 10px -6px {color.shadow}',
|
||||
'2xl': '0px 25px 50px -12px {color.shadow}',
|
||||
none: '0px 0px 0px 0px transparent'
|
||||
},
|
||||
docus: {
|
||||
$schema: {
|
||||
title: 'All the configurable tokens from Docus.',
|
||||
tags: [
|
||||
'@studioIcon material-symbols:docs'
|
||||
]
|
||||
},
|
||||
body: {
|
||||
backgroundColor: {
|
||||
initial: '{color.white}',
|
||||
dark: '{color.black}'
|
||||
},
|
||||
color: {
|
||||
initial: '{color.gray.800}',
|
||||
dark: '{color.gray.200}'
|
||||
},
|
||||
fontFamily: '{font.sans}'
|
||||
},
|
||||
header: {
|
||||
height: '64px',
|
||||
logo: {
|
||||
height: {
|
||||
initial: '{space.6}',
|
||||
sm: '{space.7}'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
fontSize: '{fontSize.2xl}',
|
||||
fontWeight: '{fontWeight.bold}',
|
||||
color: {
|
||||
static: {
|
||||
initial: '{color.gray.900}',
|
||||
dark: '{color.gray.100}',
|
||||
},
|
||||
hover: '{color.primary.500}',
|
||||
}
|
||||
}
|
||||
},
|
||||
footer: { height: { initial: '145px', sm: '100px' }, padding: '{space.4} 0' },
|
||||
readableLine: '78ch',
|
||||
loadingBar: {
|
||||
height: '3px',
|
||||
gradientColorStop1: '#00dc82',
|
||||
gradientColorStop2: '#34cdfe',
|
||||
gradientColorStop3: '#0047e1'
|
||||
},
|
||||
search: {
|
||||
backdropFilter: 'blur(24px)',
|
||||
input: {
|
||||
borderRadius: '{radii.2xs}',
|
||||
borderWidth: '1px',
|
||||
borderStyle: 'solid',
|
||||
borderColor: {
|
||||
initial: '{color.gray.200}',
|
||||
dark: 'transparent'
|
||||
},
|
||||
fontSize: '{fontSize.sm}',
|
||||
gap: '{space.2}',
|
||||
padding: '{space.2} {space.4}',
|
||||
backgroundColor: {
|
||||
initial: '{color.gray.200}',
|
||||
dark: '{color.gray.800}'
|
||||
},
|
||||
},
|
||||
results: {
|
||||
window: {
|
||||
marginX: {
|
||||
initial: '0',
|
||||
sm: '{space.4}'
|
||||
},
|
||||
borderRadius: {
|
||||
initial: 'none',
|
||||
sm: '{radii.xs}'
|
||||
},
|
||||
marginTop: {
|
||||
initial: '0',
|
||||
sm: '20vh'
|
||||
},
|
||||
maxWidth: '640px',
|
||||
maxHeight: {
|
||||
initial: '100%',
|
||||
sm: '320px'
|
||||
},
|
||||
},
|
||||
selected: {
|
||||
backgroundColor: {
|
||||
initial: '{color.gray.300}',
|
||||
dark: '{color.gray.700}'
|
||||
},
|
||||
},
|
||||
highlight: {
|
||||
color: 'white',
|
||||
backgroundColor: '{color.primary.500}'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
typography: {
|
||||
color: {
|
||||
primary: {
|
||||
50: '{color.primary.50}',
|
||||
100: '{color.primary.100}',
|
||||
200: '{color.primary.200}',
|
||||
300: '{color.primary.300}',
|
||||
400: '{color.primary.400}',
|
||||
500: '{color.primary.500}',
|
||||
600: '{color.primary.600}',
|
||||
700: '{color.primary.700}',
|
||||
800: '{color.primary.800}',
|
||||
900: '{color.primary.900}'
|
||||
},
|
||||
secondary: {
|
||||
50: '{color.gray.50}',
|
||||
100: '{color.gray.100}',
|
||||
200: '{color.gray.200}',
|
||||
300: '{color.gray.300}',
|
||||
400: '{color.gray.400}',
|
||||
500: '{color.gray.500}',
|
||||
600: '{color.gray.600}',
|
||||
700: '{color.gray.700}',
|
||||
800: '{color.gray.800}',
|
||||
900: '{color.gray.900}'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
4
apps/docs/tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
// "extends": "./.nuxt/tsconfig.json",
|
||||
"ignoreConfigErrors": true
|
||||
}
|
||||
38
apps/www/.eslintignore
Normal file
@@ -0,0 +1,38 @@
|
||||
**/*.log
|
||||
**/.DS_Store
|
||||
*.
|
||||
.vscode/settings.json
|
||||
.history
|
||||
.yarn
|
||||
bazel-*
|
||||
bazel-bin
|
||||
bazel-out
|
||||
bazel-qwik
|
||||
bazel-testlogs
|
||||
dist
|
||||
dist-dev
|
||||
lib
|
||||
lib-types
|
||||
etc
|
||||
external
|
||||
node_modules
|
||||
temp
|
||||
tsc-out
|
||||
tsdoc-metadata.json
|
||||
target
|
||||
output
|
||||
rollup.config.js
|
||||
build
|
||||
.cache
|
||||
.vscode
|
||||
.rollup.cache
|
||||
dist
|
||||
tsconfig.tsbuildinfo
|
||||
vite.config.ts
|
||||
*.spec.tsx
|
||||
*.spec.ts
|
||||
.netlify
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
server
|
||||
42
apps/www/.eslintrc.cjs
Normal file
@@ -0,0 +1,42 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:qwik/recommended",
|
||||
],
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ["./tsconfig.json"],
|
||||
ecmaVersion: 2021,
|
||||
sourceType: "module",
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
plugins: ["@typescript-eslint"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-empty-interface": "off",
|
||||
"@typescript-eslint/no-namespace": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-this-alias": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"prefer-spread": "off",
|
||||
"no-case-declarations": "off",
|
||||
"no-console": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error"],
|
||||
"@typescript-eslint/consistent-type-imports": "warn",
|
||||
"@typescript-eslint/no-unnecessary-condition": "warn",
|
||||
},
|
||||
};
|
||||
48
apps/www/.gitignore
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
# Build
|
||||
/dist
|
||||
/lib
|
||||
/lib-types
|
||||
/server
|
||||
|
||||
# Development
|
||||
node_modules
|
||||
*.local
|
||||
|
||||
# Cache
|
||||
.cache
|
||||
.mf
|
||||
.rollup.cache
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Editor
|
||||
.vscode/*
|
||||
!.vscode/launch.json
|
||||
!.vscode/*.code-snippets
|
||||
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# Yarn
|
||||
.yarn/*
|
||||
!.yarn/releases
|
||||
|
||||
# Cloudflare
|
||||
functions/**/*.js
|
||||
|
||||
#Typescript
|
||||
*.tsbuildinfo
|
||||
tmp
|
||||
37
apps/www/.prettierignore
Normal file
@@ -0,0 +1,37 @@
|
||||
**/*.log
|
||||
**/.DS_Store
|
||||
*.
|
||||
.vscode/settings.json
|
||||
.history
|
||||
.yarn
|
||||
bazel-*
|
||||
bazel-bin
|
||||
bazel-out
|
||||
bazel-qwik
|
||||
bazel-testlogs
|
||||
dist
|
||||
dist-dev
|
||||
lib
|
||||
lib-types
|
||||
etc
|
||||
external
|
||||
node_modules
|
||||
temp
|
||||
tsc-out
|
||||
tsdoc-metadata.json
|
||||
target
|
||||
output
|
||||
rollup.config.js
|
||||
build
|
||||
.cache
|
||||
.vscode
|
||||
.rollup.cache
|
||||
tsconfig.tsbuildinfo
|
||||
vite.config.ts
|
||||
*.spec.tsx
|
||||
*.spec.ts
|
||||
.netlify
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
server
|
||||
112
apps/www/README.md
Normal file
@@ -0,0 +1,112 @@
|
||||
# Qwik City App ⚡️
|
||||
|
||||
- [Qwik Docs](https://qwik.dev/)
|
||||
- [Discord](https://qwik.dev/chat)
|
||||
- [Qwik GitHub](https://github.com/QwikDev/qwik)
|
||||
- [@QwikDev](https://twitter.com/QwikDev)
|
||||
- [Vite](https://vitejs.dev/)
|
||||
|
||||
---
|
||||
|
||||
## Project Structure
|
||||
|
||||
This project is using Qwik with [QwikCity](https://qwik.dev/qwikcity/overview/). QwikCity is just an extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more.
|
||||
|
||||
Inside your project, you'll see the following directory structure:
|
||||
|
||||
```
|
||||
├── public/
|
||||
│ └── ...
|
||||
└── src/
|
||||
├── components/
|
||||
│ └── ...
|
||||
└── routes/
|
||||
└── ...
|
||||
```
|
||||
|
||||
- `src/routes`: Provides the directory-based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.dev/qwikcity/routing/overview/) for more info.
|
||||
|
||||
- `src/components`: Recommended directory for components.
|
||||
|
||||
- `public`: Any static assets, like images, can be placed in the public directory. Please see the [Vite public directory](https://vitejs.dev/guide/assets.html#the-public-directory) for more info.
|
||||
|
||||
## Add Integrations and deployment
|
||||
|
||||
Use the `bun qwik add` command to add additional integrations. Some examples of integrations includes: Cloudflare, Netlify or Express Server, and the [Static Site Generator (SSG)](https://qwik.dev/qwikcity/guides/static-site-generation/).
|
||||
|
||||
```shell
|
||||
bun qwik add # or `bun qwik add`
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Development mode uses [Vite's development server](https://vitejs.dev/). The `dev` command will server-side render (SSR) the output during development.
|
||||
|
||||
```shell
|
||||
npm start # or `bun start`
|
||||
```
|
||||
|
||||
> Note: during dev mode, Vite may request a significant number of `.js` files. This does not represent a Qwik production build.
|
||||
|
||||
## Preview
|
||||
|
||||
The preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to preview a production build locally and should not be used as a production server.
|
||||
|
||||
```shell
|
||||
bun preview # or `bun preview`
|
||||
```
|
||||
|
||||
## Production
|
||||
|
||||
The production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.
|
||||
|
||||
```shell
|
||||
bun build # or `bun build`
|
||||
```
|
||||
|
||||
## Cloudflare Pages
|
||||
|
||||
Cloudflare's [wrangler](https://github.com/cloudflare/wrangler) CLI can be used to preview a production build locally. To start a local server, run:
|
||||
|
||||
```
|
||||
bun serve
|
||||
```
|
||||
|
||||
Then visit [http://localhost:8787/](http://localhost:8787/)
|
||||
|
||||
### Deployments
|
||||
|
||||
[Cloudflare Pages](https://pages.cloudflare.com/) are deployable through their [Git provider integrations](https://developers.cloudflare.com/pages/platform/git-integration/).
|
||||
|
||||
If you don't already have an account, then [create a Cloudflare account here](https://dash.cloudflare.com/sign-up/pages). Next go to your dashboard and follow the [Cloudflare Pages deployment guide](https://developers.cloudflare.com/pages/framework-guides/deploy-anything/).
|
||||
|
||||
Within the projects "Settings" for "Build and deployments", the "Build command" should be `bun build`, and the "Build output directory" should be set to `dist`.
|
||||
|
||||
### Function Invocation Routes
|
||||
|
||||
Cloudflare Page's [function-invocation-routes config](https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes) can be used to include, or exclude, certain paths to be used by the worker functions. Having a `_routes.json` file gives developers more granular control over when your Function is invoked.
|
||||
This is useful to determine if a page response should be Server-Side Rendered (SSR) or if the response should use a static-site generated (SSG) `index.html` file.
|
||||
|
||||
By default, the Cloudflare pages adaptor _does not_ include a `public/_routes.json` config, but rather it is auto-generated from the build by the Cloudflare adaptor. An example of an auto-generate `dist/_routes.json` would be:
|
||||
|
||||
```
|
||||
{
|
||||
"include": [
|
||||
"/*"
|
||||
],
|
||||
"exclude": [
|
||||
"/_headers",
|
||||
"/_redirects",
|
||||
"/build/*",
|
||||
"/favicon.ico",
|
||||
"/manifest.json",
|
||||
"/service-worker.js",
|
||||
"/about"
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
```
|
||||
|
||||
In the above example, it's saying _all_ pages should be SSR'd. However, the root static files such as `/favicon.ico` and any static assets in `/build/*` should be excluded from the Functions, and instead treated as a static file.
|
||||
|
||||
In most cases the generated `dist/_routes.json` file is ideal. However, if you need more granular control over each path, you can instead provide you're own `public/_routes.json` file. When the project provides its own `public/_routes.json` file, then the Cloudflare adaptor will not auto-generate the routes config and instead use the committed one within the `public` directory.
|
||||
15
apps/www/adapters/cloudflare-pages/vite.config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { cloudflarePagesAdapter } from "@builder.io/qwik-city/adapters/cloudflare-pages/vite";
|
||||
import { extendConfig } from "@builder.io/qwik-city/vite";
|
||||
import baseConfig from "../../vite.config";
|
||||
|
||||
export default extendConfig(baseConfig, () => {
|
||||
return {
|
||||
build: {
|
||||
ssr: true,
|
||||
rollupOptions: {
|
||||
input: ["src/entry.cloudflare-pages.tsx", "@qwik-city-plan"],
|
||||
},
|
||||
},
|
||||
plugins: [cloudflarePagesAdapter()],
|
||||
};
|
||||
});
|
||||
23
apps/www/adapters/deno/vite.config.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { denoServerAdapter } from "@builder.io/qwik-city/adapters/deno-server/vite";
|
||||
import { extendConfig } from "@builder.io/qwik-city/vite";
|
||||
import baseConfig from "../../vite.config";
|
||||
|
||||
export default extendConfig(baseConfig, () => {
|
||||
return {
|
||||
build: {
|
||||
ssr: true,
|
||||
rollupOptions: {
|
||||
input: ["src/entry.deno.ts", "@qwik-city-plan"],
|
||||
},
|
||||
minify: false,
|
||||
},
|
||||
plugins: [
|
||||
denoServerAdapter({
|
||||
ssg: {
|
||||
include: ["/*"],
|
||||
origin: "https://yoursite.dev",
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
||||
});
|
||||
78
apps/www/package.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "@nestri/web",
|
||||
"description": "Your games. Your rules.",
|
||||
"engines": {
|
||||
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
||||
},
|
||||
"engines-annotation": "Mostly required by sharp which needs a Node-API v9 compatible runtime",
|
||||
"private": true,
|
||||
"trustedDependencies": [
|
||||
"sharp"
|
||||
],
|
||||
"trustedDependencies-annotation": "Needed for bun to allow running install scripts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "qwik build",
|
||||
"build.client": "vite build",
|
||||
"build.preview": "vite build --ssr src/entry.preview.tsx",
|
||||
"build.server": "vite build -c adapters/cloudflare-pages/vite.config.ts",
|
||||
"deno:build.server": "vite build -c adapters/deno/vite.config.ts",
|
||||
"build.types": "tsc --incremental --noEmit",
|
||||
"deploy": "wrangler pages deploy ./dist",
|
||||
"dev": "vite --mode ssr",
|
||||
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
|
||||
"fmt": "prettier --write .",
|
||||
"fmt.check": "prettier --check .",
|
||||
"lint": "eslint \"src/**/*.ts*\"",
|
||||
"preview": "qwik build preview && vite preview --open",
|
||||
"serve": "wrangler pages dev ./dist --compatibility-flags=nodejs_als",
|
||||
"deno:serve": "deno run --allow-net --allow-read --allow-env server/entry.deno.js",
|
||||
"start": "vite --open --mode ssr",
|
||||
"qwik": "qwik"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@builder.io/partytown": "^0.8.1",
|
||||
"@builder.io/qwik": "^1.8.0",
|
||||
"@builder.io/qwik-city": "^1.8.0",
|
||||
"@builder.io/qwik-react": "0.5.0",
|
||||
"@fontsource-variable/bricolage-grotesque": "^5.0.1",
|
||||
"@fontsource/geist-mono": "^5.1.0",
|
||||
"@fontsource/geist-sans": "^5.1.0",
|
||||
"@fontsource-variable/mona-sans": "^5.0.1",
|
||||
"@modular-forms/qwik": "^0.29.0",
|
||||
"@nestri/input": "*",
|
||||
"@nestri/libmoq": "*",
|
||||
"@nestri/sdk": "0.1.0-alpha.14",
|
||||
"@nestri/ui": "*",
|
||||
"@openauthjs/openauth": "*",
|
||||
"@polar-sh/checkout": "^0.1.8",
|
||||
"@polar-sh/sdk": "^0.21.1",
|
||||
"@qwik-ui/headless": "^0.6.4",
|
||||
"@types/eslint": "8.56.10",
|
||||
"@types/howler": "^2.2.12",
|
||||
"@types/node": "^22.5.1",
|
||||
"@types/react": "^18.2.28",
|
||||
"@types/react-dom": "^18.2.13",
|
||||
"@typescript-eslint/eslint-plugin": "7.16.1",
|
||||
"@typescript-eslint/parser": "7.16.1",
|
||||
"ajv": "^8.17.1",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-plugin-qwik": "^1.8.0",
|
||||
"howler": "^2.2.4",
|
||||
"posthog-js": "^1.207.0",
|
||||
"prettier": "3.3.3",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"semver": "^7.7.1",
|
||||
"typescript": "5.4.5",
|
||||
"undici": "*",
|
||||
"valibot": "^0.42.1",
|
||||
"vite": "6.0.15",
|
||||
"vite-tsconfig-paths": "^4.2.1",
|
||||
"wrangler": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/pako": "^2.0.3",
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
}
|
||||
6
apps/www/postcss.config.cjs
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
9
apps/www/public/_headers
Normal file
@@ -0,0 +1,9 @@
|
||||
# https://developers.cloudflare.com/pages/platform/headers/
|
||||
|
||||
/*service-worker.js
|
||||
Cache-Control: no-store
|
||||
Content-Type: application/javascript
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
/build/*
|
||||
Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable
|
||||