Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ HOST_DATABASE_URL=file:./database.db
HOST_DATABASE_AUTH_TOKEN= # for Turso

# API Plugin Database (path relative to host/)
API_DATABASE_URL=file:../api/api.db
API_DATABASE_AUTH_TOKEN= # for Turso

# Host Database
HOST_DATABASE_URL=file:./database.db
HOST_DATABASE_AUTH_TOKEN= # for Turso

# API Plugin Database (path relative to host/)
API_DATABASE_URL=file:../api/api.db
API_DATABASE_URL=file:./api/api.db
API_DATABASE_AUTH_TOKEN= # for Turso

# NEAR AI Cloud
Expand Down
2 changes: 1 addition & 1 deletion api/drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig({
out: './src/db/migrations',
dialect: 'turso',
dbCredentials: {
url: process.env.API_DATABASE_URL || 'file:./database.db',
url: process.env.API_DATABASE_URL || 'file:./api.db',
authToken: process.env.API_DATABASE_AUTH_TOKEN,
},
verbose: true,
Expand Down
19 changes: 11 additions & 8 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@
"effect": "catalog:",
"nanoid": "^5.1.6",
"near-kit": "catalog:",
"openai": "^6.16.0"
"openai": "^6.16.0",
"@orpc/contract": "^1.13.4",
"@orpc/server": "^1.13.4"
},
"devDependencies": {
"@effect/language-service": "^0.72.0",
"@effect/language-service": "^0.41.1",
"@module-federation/node": "^2.7.25",
"@rspack/cli": "^1.7.3",
"@rspack/core": "^1.7.3",
"@rspack/cli": "^1.6.8",
"@rspack/core": "^1.6.8",
"@types/node": "catalog:",
"dotenv": "^17.2.3",
"every-plugin": "0.8.8",
"vite-tsconfig-paths": "^6.0.5",
"every-plugin": "catalog:",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "catalog:",
"zephyr-rspack-plugin": "^0.1.2"
},
Expand All @@ -42,6 +44,7 @@
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio"
"db:studio": "drizzle-kit studio",
"deploy": "DEPLOY=true rspack build"
}
}
}
12 changes: 6 additions & 6 deletions api/plugin.dev.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import "dotenv/config";
import type { PluginConfigInput } from "every-plugin";
import packageJson from "./package.json" with { type: "json" };
import type Plugin from "./src/index";

export default {
pluginId: "api",
pluginId: packageJson.name,
port: 3014,
config: {
variables: {
NEAR_AI_MODEL: process.env.NEAR_AI_MODEL || "deepseek-ai/DeepSeek-V3.1",
},
secrets: {
API_DATABASE_URL: process.env.API_DATABASE_URL || "file:./database.db",
API_DATABASE_AUTH_TOKEN: process.env.API_DATABASE_AUTH_TOKEN || "",
NEAR_AI_API_KEY: process.env.NEAR_AI_API_KEY || "",
NEAR_AI_BASE_URL: process.env.NEAR_AI_BASE_URL || "https://cloud-api.near.ai/v1",
API_DATABASE_AUTH_TOKEN: process.env.API_DATABASE_AUTH_TOKEN,
},
},
} satisfies PluginConfigInput<typeof Plugin>,
};
4 changes: 2 additions & 2 deletions api/rspack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { EveryPluginDevServer } = require("every-plugin/build/rspack");
const { withZephyr } = require("zephyr-rspack-plugin");
const pkg = require("./package.json");

const isProduction = process.env.NODE_ENV === 'production';
const shouldDeploy = process.env.DEPLOY === 'true';

function updateHostConfig(name, url) {
try {
Expand Down Expand Up @@ -35,7 +35,7 @@ const baseConfig = {
stats: 'errors-warnings',
};

module.exports = isProduction
module.exports = shouldDeploy
? withZephyr({
hooks: {
onDeployComplete: (info) => {
Expand Down
106 changes: 92 additions & 14 deletions bos.config.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,110 @@
{
"account": "example.near",
"create": {
"project": "nearbuilders/cyborg",
"ui": "nearbuilders/cyborg/ui",
"api": "nearbuilders/cyborg/api",
"host": "nearbuilders/cyborg/host"
"template": "near-everything/every-plugin/demo",
"shared": {
"ui": {
"react": {
"requiredVersion": "19.2.4",
"singleton": true,
"eager": true
},
"react-dom": {
"requiredVersion": "19.2.4",
"singleton": true,
"eager": true
},
"@tanstack/react-query": {
"requiredVersion": "5.90.20",
"singleton": true,
"eager": true
},
"@tanstack/react-router": {
"requiredVersion": "1.157.16",
"singleton": true,
"eager": true
},
"@hot-labs/near-connect": {
"requiredVersion": "0.8.2",
"singleton": true
},
"near-kit": {
"requiredVersion": "0.10.0",
"singleton": true
},
"better-auth": {
"requiredVersion": "1.4.17",
"singleton": true
},
"better-near-auth": {
"requiredVersion": "0.3.4",
"singleton": true
}
}
},
"gateway": {
"development": "http://localhost:8787",
"production": "https://everything.dev"
},
"app": {
"host": {
"title": "NEAR Agent",
"description": "Template for building NEAR AI applications",
"development": "http://localhost:3000",
"production": "https://elliot-braem-1818-host-every-plugin-near-everythi-fdf320911-ze.zephyrcloud.app",
"production": "https://elliot-braem-1910-host-every-plugin-near-everythi-9ac1c3d34-ze.zephyrcloud.app",
"secrets": [
"HOST_DATABASE_URL",
"HOST_DATABASE_AUTH_TOKEN",
"BETTER_AUTH_SECRET",
"BETTER_AUTH_URL"
]
],
"template": "near-everything/every-plugin/demo/host",
"files": [
"rsbuild.config.ts",
"tsconfig.json",
"vitest.config.ts",
"drizzle.config.ts"
],
"variables": {}
},
"ui": {
"name": "ui",
"development": "http://localhost:3002",
"production": "https://elliot-braem-1786-ui-cyborg-nearbuilders-46d98f16b-ze.zephyrcloud.app",
"production": "https://elliot-braem-1914-ui-cyborg-nearbuilders-ee224954c-ze.zephyrcloud.app",
"exposes": {
"App": "./App",
"components": "./components",
"providers": "./providers",
"types": "./types"
"./Router": "./src/router.tsx",
"./Hydrate": "./src/hydrate.tsx",
"./remote": "./src/remote/index.ts",
"./components": "./src/components/index.ts",
"./providers": "./src/providers/index.tsx",
"./hooks": "./src/hooks/index.ts",
"./types": "./src/types/index.ts"
},
"ssr": "https://elliot-braem-1899-ui-cyborg-nearbuilders-3c6c03f0e-ze.zephyrcloud.app"
"ssr": "https://elliot-braem-1915-ui-cyborg-nearbuilders-7859071fb-ze.zephyrcloud.app",
"template": "near-everything/every-plugin/demo/ui",
"files": [
"rsbuild.config.ts",
"tsconfig.json",
"postcss.config.mjs",
"components.json",
"src/router.tsx",
"src/router.server.tsx",
"src/hydrate.tsx",
"src/env.d.ts",
"src/remote",
"src/utils/orpc.ts",
"src/types/index.ts",
"src/routes/__root.tsx",
"src/lib/auth-client.ts",
"src/lib/auth-utils.ts"
],
"secrets": [],
"variables": {}
},
"api": {
"name": "api",
"development": "http://localhost:3014",
"production": "https://elliot-braem-1788-api-cyborg-nearbuilders-ac0e7b73a-ze.zephyrcloud.app",
"production": "https://elliot-braem-1916-api-cyborg-nearbuilders-a9be6ebfa-ze.zephyrcloud.app",
"proxy": "https://elliot-braem-1811-api-every-plugin-near-everythin-2defcb105-ze.zephyrcloud.app",
"variables": {
"NEAR_AI_MODEL": "deepseek-ai/DeepSeek-V3.1",
"NEAR_RPC_URL": "https://rpc.mainnet.near.org",
Expand All @@ -46,6 +116,14 @@
"API_DATABASE_AUTH_TOKEN",
"NEAR_AI_API_KEY",
"NEAR_AI_BASE_URL"
],
"template": "near-everything/every-plugin/demo/api",
"files": [
"rspack.config.cjs",
"tsconfig.json",
"vitest.config.ts",
"drizzle.config.ts",
"plugin.dev.ts"
]
}
}
Expand Down
Loading
Loading