Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
botway(core): finish from implementing coder to botway
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed May 27, 2023
1 parent b50009c commit 2351178
Show file tree
Hide file tree
Showing 13 changed files with 794 additions and 183 deletions.
11 changes: 11 additions & 0 deletions coder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM botwayorg/coder:latest

USER coder

ARG PASSWORD GIT_REPO GITHUB_TOKEN

RUN gh repo clone $GIT_REPO main

EXPOSE 8080

ENTRYPOINT code-server --bind-addr 0.0.0.0:8080 main
45 changes: 45 additions & 0 deletions coder/Dockerfile.coder
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM codercom/code-server:latest

USER coder

ENV SHELL=/bin/bash
ENV PORT=8080

COPY settings.json .local/share/code-server/User/settings.json

RUN sudo chown -R coder:coder /home/coder/.local

### Required Packages ###
RUN sudo apt-get update -y && sudo apt-get upgrade -y \
&& sudo apt-get install -y sqlite3 git-core curl gnupg build-essential wget openssl ruby ruby-dev libopus-dev opus-tools binutils libssl-dev zlib1g-dev libboost-system-dev libcurl4-openssl-dev libffi-dev python-dev ffmpeg build-essential autoconf automake libtool m4 youtube-dl

### C ###
RUN curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy/ \
llvm-toolchain-jammy-15 main" | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null \
&& sudo apt-get update -y \
&& sudo apt-get install -y clang clangd clang-format clang-tidy gdb lld

### Nodejs ###
RUN curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - && \
sudo apt-get install -y nodejs

RUN sudo npm i -g npm@latest pnpm@latest yarn@latest @botway/strg@latest

### Homebrew ###
RUN mkdir ~/.cache && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin/:$PATH
ENV MANPATH="$MANPATH:/home/linuxbrew/.linuxbrew/share/man"
ENV INFOPATH="$INFOPATH:/home/linuxbrew/.linuxbrew/share/info"

RUN echo 'export PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin/:$PATH' >> ~/.profile

### CMake, GitHub CLI, Deno, Go, Botway CLI, Rust, .NET, MongoDB, MySQL, Redis and Railway CLI ###
RUN brew update && brew install cmake gh deno go abdfnx/tap/botway rust rustup-init dotnet mongodb/brew/mongodb-community mysql redis railwayapp/tap/rlwy

### PostgreSQL ###
RUN sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - \
&& sudo apt-get update -y \
&& sudo apt-get install -y postgresql
6 changes: 6 additions & 0 deletions coder/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"git.postCommitCommand": "sync",
"git.enableSmartCommit": true,
"git.confirmSync": false,
"git.autofetch": true
}
1 change: 1 addition & 0 deletions core/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import createClient from "@/supabase/server";
import { AuthProvider } from "@/supabase/auth/provider";
import "@/assets/main.scss";
import "react-cmdk/dist/cmdk.css";
import "reactflow/dist/style.css";

// do not cache this layout
export const revalidate = 0;
Expand Down
6 changes: 1 addition & 5 deletions core/app/project/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ const Project = ({ user, projectId }: any) => {
projectId={projectId}
projectName={project?.name}
projectRWID={project?.railway_project_id}
grid={true}
>
<div className="mx-6 my-16 flex items-center space-x-6">
<h1 className="text-3xl text-white">{project?.name}</h1>
</div>
<div className="mx-6"></div>
<div className="w-[80vw] h-screen pr-10"></div>
</ProjectLayout>
)}
</>
Expand Down
4 changes: 2 additions & 2 deletions core/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createMiddlewareSupabaseClient } from "@supabase/auth-helpers-nextjs";
import { createMiddlewareClient } from "@supabase/auth-helpers-nextjs";
import { NextResponse } from "next/server";

export async function middleware(req: any) {
const res = NextResponse.next();

const supabase = createMiddlewareSupabaseClient({ req, res });
const supabase = createMiddlewareClient({ req, res });

const {
data: { session },
Expand Down
21 changes: 11 additions & 10 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"@faker-js/faker": "^8.0.1",
"@headlessui/react": "^1.7.14",
"@primer/octicons-react": "^19.1.0",
"@supabase/auth-helpers-nextjs": "^0.6.1",
"@supabase/supabase-js": "^2.22.0",
"@supabase/auth-helpers-nextjs": "^0.7.0",
"@supabase/supabase-js": "^2.23.0",
"@tanstack/react-query": "^4.29.7",
"ajv": "^8.12.0",
"autoprefixer": "10.4.14",
Expand All @@ -23,33 +23,34 @@
"csstype": "^3.1.2",
"encoding": "^0.1.13",
"flowbite": "^1.6.5",
"flowbite-react": "^0.4.4",
"formik": "^2.2.9",
"flowbite-react": "^0.4.6",
"formik": "^2.3.2",
"graphql": "^16.6.0",
"jose": "^4.14.4",
"marked": "^5.0.2",
"marked": "^5.0.3",
"mini-svg-data-uri": "^1.4.4",
"next": "13.4.3",
"octokit": "^2.0.16",
"next": "13.4.4",
"octokit": "^2.0.19",
"postcss": "8.4.23",
"postcss-nested": "^6.0.1",
"react": "18.2.0",
"react-cmdk": "^1.3.9",
"react-dom": "18.2.0",
"react-hot-toast": "^2.4.1",
"reactflow": "^11.7.2",
"sass": "^1.62.1",
"slug": "^8.2.2",
"swr": "^2.1.5",
"tailwindcss": "3.3.2",
"uuid": "^9.0.0",
"yup": "^1.1.1"
"yup": "^1.2.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"@types/bcryptjs": "^2.4.2",
"@types/marked": "^5.0.0",
"@types/node": "^20.2.3",
"@types/react": "18.2.6",
"@types/node": "^20.2.5",
"@types/react": "18.2.7",
"@types/react-dom": "18.2.4",
"@types/slug": "^5.0.3",
"tailwindcss-animate": "^1.0.5",
Expand Down
4 changes: 2 additions & 2 deletions core/supabase/browser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createBrowserSupabaseClient } from "@supabase/auth-helpers-nextjs";
import { createPagesBrowserClient } from "@supabase/auth-helpers-nextjs";

const supabase = createBrowserSupabaseClient();
const supabase = createPagesBrowserClient();

export default supabase;
4 changes: 2 additions & 2 deletions core/supabase/server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createServerComponentSupabaseClient } from "@supabase/auth-helpers-nextjs";
import { createServerComponentClient } from "@supabase/auth-helpers-nextjs";
import { cookies, headers } from "next/headers";

export default () =>
createServerComponentSupabaseClient({
createServerComponentClient({
headers,
cookies,
});
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/botwayorg/templates v0.0.7
github.com/briandowns/spinner v1.23.0
github.com/charmbracelet/bubbles v0.15.0
github.com/charmbracelet/bubbletea v0.24.0
github.com/charmbracelet/bubbletea v0.24.1
github.com/charmbracelet/lipgloss v0.7.1
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/mattn/go-colorable v0.1.13
Expand Down Expand Up @@ -74,11 +74,11 @@ require (
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/tview v0.0.0-20230511053024-822bd067b165 // indirect
github.com/rivo/tview v0.0.0-20230525073430-4a1f85bb2219 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/sahilm/fuzzy v0.1.0 // indirect
github.com/scmn-dev/browser v0.1.3 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ github.com/charmbracelet/bubbletea v0.23.2 h1:vuUJ9HJ7b/COy4I30e8xDVQ+VRDUEFykIj
github.com/charmbracelet/bubbletea v0.23.2/go.mod h1:FaP3WUivcTM0xOKNmhciz60M6I+weYLF76mr1JyI7sM=
github.com/charmbracelet/bubbletea v0.24.0 h1:l8PHrft/GIeikDPCUhQe53AJrDD8xGSn0Agirh8xbe8=
github.com/charmbracelet/bubbletea v0.24.0/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg=
github.com/charmbracelet/bubbletea v0.24.1 h1:LpdYfnu+Qc6XtvMz6d/6rRY71yttHTP5HtrjMgWvixc=
github.com/charmbracelet/bubbletea v0.24.1/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg=
github.com/charmbracelet/glamour v0.6.0 h1:wi8fse3Y7nfcabbbDuwolqTqMQPMnVPeZhDM273bISc=
github.com/charmbracelet/glamour v0.6.0/go.mod h1:taqWV4swIMMbWALc0m7AfE9JkPSU8om2538k9ITBxOc=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
Expand Down Expand Up @@ -305,6 +307,8 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us=
github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand All @@ -320,6 +324,8 @@ github.com/rivo/tview v0.0.0-20230504092913-51ba3688bcdd h1:Y79siDYMHXtNhvX1VJHW
github.com/rivo/tview v0.0.0-20230504092913-51ba3688bcdd/go.mod h1:nVwGv4MP47T0jvlk7KuTTjjuSmrGO4JF0iaiNt4bufE=
github.com/rivo/tview v0.0.0-20230511053024-822bd067b165 h1:YMycYmUdmLI7ZTn86HUEDM8E8fCMz7twtysBW3SlG0c=
github.com/rivo/tview v0.0.0-20230511053024-822bd067b165/go.mod h1:nVwGv4MP47T0jvlk7KuTTjjuSmrGO4JF0iaiNt4bufE=
github.com/rivo/tview v0.0.0-20230525073430-4a1f85bb2219 h1:Wt34AcMCfhtqhM8bCLKpZvIc7VNwU83B5ABooKNtFBc=
github.com/rivo/tview v0.0.0-20230525073430-4a1f85bb2219/go.mod h1:nVwGv4MP47T0jvlk7KuTTjjuSmrGO4JF0iaiNt4bufE=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"packageManager": "[email protected]",
"devDependencies": {
"prettier": "^2.8.8",
"turbo": "^1.9.8"
"turbo": "^1.9.9"
}
}
Loading

0 comments on commit 2351178

Please sign in to comment.