Skip to content

Commit

Permalink
Merge pull request #777 from unavi-xyz/dev
Browse files Browse the repository at this point in the history
THE BIG ONE
  • Loading branch information
kayhhh authored Jul 17, 2023
2 parents cfd3c9d + 442eafd commit 3f3500b
Show file tree
Hide file tree
Showing 553 changed files with 8,318 additions and 26,245 deletions.
6 changes: 6 additions & 0 deletions .changeset/empty-buses-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@unavi/react-client": major
"@unavi/client": major
---

New engine!
6 changes: 6 additions & 0 deletions .changeset/serious-donuts-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@unavi/protocol": minor
"@unavi/host": minor
---

update wired protocol
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ node_modules
# next.js
.next/
out/

# build
build
dist

# other
.turbo
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 7
version: 8
run_install: false

- name: Get pnpm store directory
Expand Down
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# dependencies
node_modules
.pnp
.pnp.js
node_modules

# build
build/
Expand All @@ -13,20 +13,22 @@ dist/

# misc
.DS_Store
*.pem
.npmrc
*.pem

# debug
.pnpm-debug.log*
npm-debug.log*
vite.config.*.timestamp*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
# local files
.env.development.local
.env.test.local
.env.local
.env.production.local
.env.test.local
*.local.*

# typescript
*.tsbuildinfo
Expand Down
23 changes: 10 additions & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# dependencies
node_modules
.pnp
.pnp.js
node_modules
pnpm-lock.yaml

# build
Expand All @@ -13,38 +13,35 @@ dist/
out/

# other
.turbo
.docusaurus
.turbo
.vscode

# misc
.DS_Store
*.pem

# local env files
.env.local
.env.development.local
.env.test.local
.env.local
.env.production.local
.env.test.local

# typescript
*.tsbuildinfo

# codegen
generated
apps/docs/docs/packages/*
!apps/docs/docs/packages/index.md
apps/docs/docs/packages/*
generated

# client
.vercel
apps/client/public/**/*.js
apps/light-client/public/**/*.js
apps/client/public/**/*.svg
.vercel

# docs
apps/docs/docs-api/engine
apps/docs/docs-api/gltf-extensions
apps/light-client/public/**/*.js
draco_encoder_wrapper.js
draco_wasm_wrapper_gltf.js

# engine
draco_decoder_gltf.js
font.json
4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["prettier-plugin-packagejson"]
}
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<img src="https://img.shields.io/badge/docs-read-informational" alt="Docs" />
</a>
<a href="https://unavi.xyz">
<img src="https://therealsujitk-vercel-badge.vercel.app/?app=client-wired" alt="Vercel" />
<img src="https://therealsujitk-vercel-badge.vercel.app/?app=client-unavi" alt="Vercel" />
</a>
<a href="https://github.com/unavi-xyz/unavi/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/unavi-xyz/unavi" alt="License" />
Expand All @@ -24,29 +24,20 @@
</a>
</div>

## 🔥 Features

- Built upon open standards, using the [Wired Protocol](https://github.com/wired-protocol/spec)
- Open backend, anyone can run their own servers
- Custom multi-threaded, [glTF](https://github.com/KhronosGroup/glTF)-based game engine
- [VRM](https://vrm.dev/) avatar support
- Visual editor for creating spaces

## 📦 What's inside?

This [turborepo](https://turborepo.org/) uses [pnpm](https://pnpm.io/) as a package manager. It includes the following apps / packages:

### Apps

- [client](apps/client): the main website used to access UNAVI
- [host](apps/host): dockerized server for hosting spaces
- [host](apps/host): dockerized server for hosting multiplayer worlds

### Packages

- [engine](packages/engine): a multi-threaded 3D game engine
- [eslint-config-custom](packages/eslint-config-custom): custom eslint config used throughout the repo
- [gltf-extensions](packages/gltf-extensions): glTF-Transform implementations of extensions used by the engine
- [react-client](packages/react-client): React components and hooks used by the client
- [gltf-extension](packages/gltf-extension): [glTF-Transform](https://github.com/donmccurdy/glTF-Transform) extensions used by the client
- [react-client](packages/react-client): React components and hooks used by the client engine
- [tsconfig](packages/tsconfig): tsconfigs used throughout the repo

### Utilities
Expand Down
8 changes: 6 additions & 2 deletions apps/client/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Database
MYSQL_ROOT_HOST= "%"
MYSQL_DATABASE="wired"
MYSQL_DATABASE="unavi"
MYSQL_USER="userdb"
MYSQL_PASSWORD="passworddb"
MYSQL_ROOT_PASSWORD="passworddb"
Expand All @@ -14,17 +14,21 @@ NEXT_PUBLIC_DEPLOYED_URL="http://localhost:3000"
NEXT_PUBLIC_HAS_DATABASE="true"
NEXT_PUBLIC_HAS_S3="true"

# Can get an id for free from https://cloud.walletconnect.com/sign-up
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID="cd68582175a9bbe3317e45f516bc29f7"

# Remove the "$2b$10$" from the start of you API key
NEXT_PUBLIC_CRYPTOAVATARS_API_KEY=""

PLANETSCALE="false"
DATABASE_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@localhost:${MYSQL_PORT}/${MYSQL_DATABASE}"
DISABLE_PWA="true"

# Replace with your own provider
ETH_PROVIDER="https://eth-sepolia.g.alchemy.com/v2/9x4LwZa7dvHtTt6EkgOAPOUngvfFIYJQ"

S3_ACCESS_KEY_ID="access_key"
S3_BUCKET="wired"
S3_BUCKET="unavi"
S3_REGION="us-east-1"
S3_SECRET="secret_key"
S3_PORT="9000"
Expand Down
4 changes: 2 additions & 2 deletions apps/client/.eslintrc → apps/client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"root": true,
"extends": ["custom"],
"root": true,
"rules": {
"@next/next/no-html-link-for-pages": "error"
"import/no-unresolved": "off"
},
"settings": {
"next": {
Expand Down
4 changes: 2 additions & 2 deletions apps/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN npm i -g npm@latest; \

# Prune files
COPY . .
RUN turbo prune --scope=client --docker
RUN turbo prune --scope=@unavi/client --docker

# Add lockfile and package.json's of isolated subworkspace
FROM node:18-alpine AS installer
Expand Down Expand Up @@ -41,7 +41,7 @@ COPY turbo.json turbo.json
# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN

RUN pnpm turbo run build --filter=client...
RUN pnpm turbo run build --filter=@unavi/client...

FROM node:18-alpine AS runner
WORKDIR /app
Expand Down
8 changes: 4 additions & 4 deletions apps/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ The UNAVI client, used to access The Wired.

## Tech Stack

- [Next.js](https://nextjs.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Prisma](https://www.prisma.io/)
- [Drizzle](https://orm.drizzle.team/)
- [Lucia](https://github.com/pilcrowOnPaper/lucia)
- [Next.js](https://nextjs.org/)
- [RainbowKit](https://www.rainbowkit.com/)
- [Tailwind](https://tailwindcss.com/)
- [Wagmi](https://wagmi.sh/)
- [Rainbow Kit](https://www.rainbowkit.com/)
8 changes: 7 additions & 1 deletion apps/client/app/(navbar)/AccountButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useAuth } from "@/src/client/AuthProvider";
import { useProfile } from "@/src/play/hooks/useProfile";
import { cdnURL, S3Path } from "@/src/utils/s3Paths";

import ProfileButton from "./ProfileButton";
import SignInButton from "./SignInButton";
Expand All @@ -12,8 +13,13 @@ export default function AccountButton() {

const loading = status === "loading" || transitionLoading || profileLoading;

const image =
user && profile?.image
? cdnURL(S3Path.profile(user.userId).image(profile.image))
: undefined;

return user ? (
<ProfileButton user={user} image={profile?.image} loading={loading} />
<ProfileButton username={user.username} image={image} loading={loading} />
) : (
<SignInButton loading={loading} />
);
Expand Down
53 changes: 53 additions & 0 deletions apps/client/app/(navbar)/CommunityCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { BsDiscord, BsGithub, BsTwitter } from "react-icons/bs";

const GITHUB_URL = "https://github.com/unavi-xyz/unavi";
const DISCORD_URL = "https://discord.gg/cazUfCCgHJ";
const TWITTER_URL = "https://twitter.com/unavi_xyz";

export default function CommunityCard() {
return (
<section className="relative w-full overflow-hidden rounded-3xl bg-gradient-to-tr from-indigo-300 to-sky-200 p-8">
<div className="absolute -bottom-2 -left-6 select-none text-8xl opacity-50 md:text-9xl">
🎉
</div>

<div className="flex h-full flex-col items-center justify-center space-y-2">
<h2 className="z-10 text-center text-3xl font-bold">
Join the community!
</h2>

<ul className="z-10 flex space-x-2">
<a
title="GitHub"
href={GITHUB_URL}
target="_blank"
rel="noopener noreferrer"
className="rounded-full p-2 text-3xl hover:opacity-80"
>
<BsGithub />
</a>

<a
title="Discord"
href={DISCORD_URL}
target="_blank"
rel="noopener noreferrer"
className="rounded-full p-2 text-3xl hover:opacity-80"
>
<BsDiscord />
</a>

<a
title="Twitter"
href={TWITTER_URL}
target="_blank"
rel="noopener noreferrer"
className="rounded-full p-2 text-3xl hover:opacity-80"
>
<BsTwitter />
</a>
</ul>
</div>
</section>
);
}
Loading

1 comment on commit 3f3500b

@vercel
Copy link

@vercel vercel bot commented on 3f3500b Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

client – ./

client-git-main-unavi.vercel.app
www.unavi.xyz
client-unavi.vercel.app
unavi.xyz

Please sign in to comment.