Skip to content

Commit

Permalink
boilerplate
Browse files Browse the repository at this point in the history
codekansas committed Dec 2, 2024
0 parents commit ced0a30
Showing 210 changed files with 38,072 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-private-property-in-object"
]
}
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# .dockerignore

# Only add the build directory to Docker.
*
!build/
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore codegen files
src/gen/
src/lib/klang/
src/lib/mujoco/
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frontend

This is the frontend of the project, which builds a static website using React.

## Setup

Install requirements:

```bash
cd frontend # This directory
nvm use v22.6.0
npm install
```

Start server:

```bash
npm run dev
```

Build static files:

```bash
npm run build
```

## Updating Backend API

After updating the backend API, you need to update the generated API client. To do this, from this `frontend` directory, run:

```bash
openapi-typescript http://localhost:8080/openapi.json --output src/gen/api.ts # While running the backend API locally
```
Binary file added assets/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions assets/gstwebrtc-api-2.0.0.min.js

Large diffs are not rendered by default.

Binary file added assets/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions assets/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "K-Scale",
"name": "K-Scale Store",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
20 changes: 20 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/App.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
36 changes: 36 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { fixupConfigRules } from "@eslint/compat";
import pluginJs from "@eslint/js";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import tseslint from "typescript-eslint";

const reactSettings = {
settings: {
react: {
version: "detect", // Automatically detect the React version
},
},
};

export default [
{
ignores: [
"node_modules/**/*",
"**/__tests__/**/*",
"*.config.ts",
"*.config.js",
"src/lib/mujoco/**/*",
"src/lib/klang/**/*",
],
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
reactSettings,
...fixupConfigRules({
...pluginReactConfig,
rules: {
...pluginReactConfig.rules,
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
},
}),
];
104 changes: 104 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />

<!-- SEO -->
<meta name="description" content="Buy, sell and build androids online" />
<meta name="keywords" content="K-Scale Labs, Robot, Robots, Humanoid Robots, Droids, Androids, " />

<!-- View options -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#000000" />

<!-- Third-party stylesheets -->
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" />
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&display=swap" rel="stylesheet">

<!-- Manifest -->
<link rel="icon" href="assets/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="assets/logo192.png" />
<link rel="manifest" href="assets/manifest.json" />

<!-- Add es-module-shims script -->
<script async src="https://ga.jspm.io/npm:es-module-shims@1.7.2/dist/es-module-shims.js"></script>

<!-- Add import map -->
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/gh/kscalelabs/store-deps@master/dist/three/build/three.module.js"
}
}
</script>

<!-- Tar Libraries -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako.min.js"></script>

<!-- Onnx Runtime -->
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@latest/dist/ort.min.js"></script>

<!-- WebRTC API -->
<script src="assets/gstwebrtc-api-2.0.0.min.js"></script>

<script>
const sprigConsent = localStorage.getItem('sprig-consent') === 'true';
const googleAnalyticsConsent = localStorage.getItem('google-analytics-consent') === 'true';
const pendoConsent = localStorage.getItem('pendo-consent') === 'true';

if (googleAnalyticsConsent) {
(function () {
var gtagScript = document.createElement('script');
gtagScript.async = true;
gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-QG3C4SS5YY';
document.head.appendChild(gtagScript);

gtagScript.onload = function () {
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-QG3C4SS5YY');
};
})();
}

if (sprigConsent) {
(function (l, e, a, p) {
if (window.Sprig) return;
window.Sprig = function () { S._queue.push(arguments) }
var S = window.Sprig; S.appId = 'bHT8PZvMNWLZ'; S._queue = [];
window.UserLeap = S;
a = l.createElement('script');
a.async = 1; a.src = e + '?id=' + S.appId;
p = l.getElementsByTagName('script')[0];
p.parentNode.insertBefore(a, p);
})(document, 'https://cdn.sprig.com/shim.js');
}

if (pendoConsent) {
(function (apiKey) {
(function (p, e, n, d, o) {
var v, w, x, y, z; o = p[d] = p[d] || {}; o._q = o._q || [];
v = ['initialize', 'identify', 'updateOptions', 'pageLoad', 'track']; for (w = 0, x = v.length; w < x; ++w)(function (m) {
o[m] = o[m] || function () { o._q[m === v[0] ? 'unshift' : 'push']([m].concat([].slice.call(arguments, 0))); };
})(v[w]);
y = e.createElement(n); y.async = !0; y.src = 'https://cdn.pendo.io/agent/static/' + apiKey + '/pendo.js';
z = e.getElementsByTagName(n)[0]; z.parentNode.insertBefore(y, z);
})(window, document, 'script', 'pendo');
})('7664f162-0994-4d9f-7c5c-fd6e279743b9');
}
</script>


<title>K-Scale</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="src/index.tsx"></script>
</body>

</html>
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "jsdom",
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
"^.+\\.(js|jsx)$": "babel-jest",
},
moduleNameMapper: {
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
},
globals: {
"ts-jest": {
tsconfig: "tsconfig.json",
},
},
};
5 changes: 5 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"watch": ["src"],
"ext": "js,jsx,ts,tsx,css,html",
"exec": "npm run build"
}
Loading

0 comments on commit ced0a30

Please sign in to comment.