Skip to content

Commit 3fb9b5d

Browse files
author
Luke Hinds
authored
Merge pull request #1 from stacklok/help-guides
Help guides
2 parents 0df1bc9 + 5357c6d commit 3fb9b5d

File tree

12 files changed

+748
-26
lines changed

12 files changed

+748
-26
lines changed

package-lock.json

Lines changed: 304 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,20 @@
1717
"@radix-ui/react-slot": "^1.1.0",
1818
"@radix-ui/react-switch": "^1.1.1",
1919
"@radix-ui/react-tooltip": "^1.1.4",
20+
"@types/prismjs": "^1.26.5",
21+
"@types/react-copy-to-clipboard": "^5.0.7",
22+
"@types/react-syntax-highlighter": "^15.5.13",
2023
"class-variance-authority": "^0.7.1",
2124
"clsx": "^2.1.1",
2225
"date-fns": "^4.1.0",
2326
"lucide-react": "^0.462.0",
27+
"prismjs": "^1.29.0",
2428
"react": "^18.3.1",
29+
"react-copy-to-clipboard": "^5.1.0",
2530
"react-dom": "^18.3.1",
2631
"react-markdown": "^9.0.1",
2732
"react-router-dom": "^7.0.2",
33+
"react-syntax-highlighter": "^15.6.1",
2834
"recharts": "^2.14.1",
2935
"remark-gfm": "^4.0.0",
3036
"tailwind-merge": "^2.5.5",

public/help/continue-setup.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Continue Setup Guide
2+
3+
First off all, you will need to install the Continue Extension.
4+
5+
You can do this by running the following command:
6+
7+
```bash
8+
code --install-extension continue.continue
9+
```
10+
11+
Alternatively, you can install the extension from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Continue.continue).
12+
13+
14+
Once you have installed the extension, you should be able to see the Continue icon in the Activity Bar.
15+
16+
![Continue Icon](./images/continue.png)
17+
18+
## Steps to Complete Setup
19+
20+
### 1. Configure Continue
21+
22+
Within VSCode open the command palette and run the `Continue: New Sesstion`
23+
24+
This will bring up the Continue chat window.
25+
26+
Select the cog icon in the top right corner to open the settings.
27+
28+
Configure your LLM provider as per normal with Continue, but change the `apiBase`
29+
value as follows:
30+
31+
```json
32+
{
33+
"apiBase": "http://localhost:8989/openai",
34+
}
35+
}
36+
```
37+
38+
For example, to configure the Anthropic provider, you would use the following configuration:
39+
40+
```json
41+
{
42+
"title": "anthropic claude-3-5-sonnet",
43+
"provider": "anthropic",
44+
"model": "claude-3-5-sonnet-20241022",
45+
"apiKey": "yourkey",
46+
"apiBase": "http://localhost:8989/anthropic"
47+
},
48+
```
49+
50+
The same follows for OpenAI, Ollama, vLLM and any other provider you wish to use.
51+
52+
```json
53+
"models": [
54+
{
55+
"title": "vllm-qwen2.5-coder-14b-instruct",
56+
"provider": "vllm",
57+
"model": "Qwen/Qwen2.5-Coder-14B-Instruct",
58+
"apiKey": "key",
59+
"apiBase": "http://localhost:8989/vllm"
60+
},
61+
{
62+
"title": "openai",
63+
"provider": "openrouter",
64+
"model": "gpt-4o-2024-11-20",
65+
"apiBase": "http://localhost:8989/openai",
66+
"apiKey": "key"
67+
},
68+
{
69+
"title": "anthropic claude-3-5-sonnet",
70+
"provider": "anthropic",
71+
"model": "claude-3-5-sonnet-20241022",
72+
"apiKey": "key",
73+
"apiBase": "http://localhost:8989/anthropic"
74+
},
75+
{
76+
"title": "ollama qwen2.5-coder-7b-instruct",
77+
"provider": "ollama",
78+
"model": "sammcj/qwen2.5-coder-7b-instruct:q8_0",
79+
"apiBase": "http://localhost:8989/ollama"
80+
}
81+
],
82+
```
83+
84+
For auto completion, you can add the following to your settings.json file:
85+
86+
```json
87+
"tabAutocompleteModel": {
88+
"title": "ollama",
89+
"provider": "ollama",
90+
"model": "codellama:7b-code",
91+
"apiBase": "http://127.0.0.1:8989/ollama"
92+
},
93+
```
94+
95+
You can now start using Continue as before, but with the added benefit
96+
extra privacy and control over your data.
97+
98+
![Continue Window](./images/continue-two.png)

public/help/copilot-setup.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# 🤖 CoPilot Setup Guide
2+
3+
Welcome to the setup guide for configuring CoPilot integration with **CodeGate**.
4+
5+
6+
---
7+
8+
## 📋 Prerequisites
9+
10+
Before you begin, make sure you have the following:
11+
- ✅ An active GitHub account
12+
- ✅ A GitHub CoPilot subscription
13+
- ✅ A CodeGate account
14+
15+
---
16+
17+
## 🛠️ Setup Instructions
18+
19+
### Install the CodeGate CA
20+
21+
To enable CodeGate, you’ll need to install its Certificate Authority (CA) into your operating system’s trust store.
22+
23+
> **Why is this needed?**
24+
> The CodeGate CA allows your machine to securely intercept and modify traffic between GitHub CoPilot and your IDE.
25+
> **Don’t worry!** The decrypted traffic stays on your local machine and never leaves.
26+
27+
28+
#### 🍎 **For MacOS Users**
29+
30+
Run the following command in your terminal to install the CA:
31+
32+
```bash
33+
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain codegate_volume/certs/ca.crt
34+
```
35+
36+
#### 🖥️ For Windows Users
37+
38+
Use this PowerShell command:
39+
40+
```Powershell
41+
Import-Certificate -FilePath "certs\\ca.crt" -CertStoreLocation Cert:\\LocalMachine\\Root
42+
```
43+
44+
#### 🐧 For Linux Users
45+
46+
Run these commands to install the CA:
47+
48+
```bash
49+
sudo cp certs/ca.crt /usr/local/share/ca-certificates/codegate.crt
50+
sudo update-ca-certificates
51+
```
52+
53+
Note: You might need to restart your IDE after adding the certicates
54+
55+
### Configure CoPilot Settings to Use CodeGate
56+
57+
Update your CoPilot configuration to use CodeGate as a proxy. Add the following to your project configuration:
58+
59+
```json
60+
{
61+
"http.proxy": "https://localhost:8990",
62+
"http.proxyStrictSSL": true,
63+
"http.proxySupport": "on",
64+
"github.copilot.advanced": {
65+
"debug.useNodeFetcher": true,
66+
"debug.useElectronFetcher": true,
67+
"debug.testOverrideProxyUrl": "https://localhost:8990",
68+
"debug.overrideProxyUrl": "https://localhost:8990
69+
}
70+
```
71+
72+
### Start Coding with the Privacy Protections and Security of CodeGate in place
73+
74+
That’s it—you’re all set!
75+
76+
Go forth and build something amazing! 🚀✨

public/help/images/continue-two.png

387 KB
Loading

public/help/images/continue.png

34.5 KB
Loading

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Chat } from "./components/Chat";
77
import { usePromptsStore } from "./hooks/usePromptsStore";
88
import { Sidebar } from "./components/Sidebar";
99
import { useSse } from "./hooks/useSse";
10+
import { Help } from "./components/Help";
1011

1112
function App() {
1213
const { prompts, loading, fetchPrompts } = usePromptsStore();
@@ -29,6 +30,7 @@ function App() {
2930
<Routes>
3031
<Route path="/" element={<Dashboard />} />
3132
<Route path="/prompt/:id" element={<Chat />} />
33+
<Route path="/help/:section" element={<Help />} />
3234
</Routes>
3335
</div>
3436
</div>

src/components/Header.tsx

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,40 @@ import { Separator } from "./ui/separator";
44

55
export function Header() {
66
return (
7-
<header className="flex-shrink-0 h-16 px-3 items-center flex w-full bg-teal-25 opacity-1 border-b-blue-200 border-b ">
8-
<SidebarTrigger />
9-
<Separator orientation="vertical" className="h-8 mx-3" />
10-
<nav className="mx-1 flex">
11-
<Link to="/">
12-
<h1 className="text-2xl w-max flex font-semibold">
13-
CodeGate Dashboard
14-
</h1>
15-
</Link>
16-
</nav>
7+
<header className="flex-shrink-0 h-16 px-3 items-center flex w-full bg-teal-25 opacity-1 border-b-blue-200 border-b">
8+
<div className="flex items-center flex-1">
9+
<SidebarTrigger />
10+
<Separator orientation="vertical" className="h-8 mx-3" />
11+
<nav className="mx-1 flex">
12+
<Link to="/">
13+
<h1 className="text-2xl w-max flex font-semibold">
14+
CodeGate Dashboard
15+
</h1>
16+
</Link>
17+
</nav>
18+
</div>
19+
<div className="flex items-center relative group mr-16">
20+
<div className="text-black hover:text-gray-800 font-semibold cursor-pointer text-base px-2 py-1 rounded-md hover:bg-gray-100 transition-colors">
21+
Help
22+
</div>
23+
{/* Dropdown menu */}
24+
<div className="absolute right-0 top-full mt-2 w-56 bg-white rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 border border-gray-100">
25+
<div className="py-1">
26+
<Link
27+
to="/help/continue-setup"
28+
className="block px-5 py-3 text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition-colors"
29+
>
30+
Continue Setup
31+
</Link>
32+
<Link
33+
to="/help/copilot-setup"
34+
className="block px-5 py-3 text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition-colors"
35+
>
36+
CoPilot Setup
37+
</Link>
38+
</div>
39+
</div>
40+
</div>
1741
</header>
1842
);
1943
}

src/components/Help.tsx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { useEffect, useState } from 'react';
2+
import { useParams } from 'react-router-dom';
3+
import { Markdown } from './Markdown';
4+
import Prism from 'prismjs';
5+
import 'prismjs/themes/prism-tomorrow.css';
6+
import 'prismjs/components/prism-bash';
7+
import 'prismjs/components/prism-javascript';
8+
import 'prismjs/components/prism-python';
9+
import 'prismjs/components/prism-json';
10+
import 'prismjs/components/prism-yaml';
11+
12+
export function Help() {
13+
const { section } = useParams();
14+
const [content, setContent] = useState<string>('');
15+
16+
useEffect(() => {
17+
const fetchContent = async () => {
18+
try {
19+
const response = await fetch(`/help/${section}.md`);
20+
if (!response.ok) {
21+
throw new Error('Failed to load content');
22+
}
23+
const text = await response.text();
24+
setContent(text);
25+
26+
// Allow content to render before highlighting
27+
setTimeout(() => {
28+
Prism.highlightAll();
29+
}, 0);
30+
} catch (error) {
31+
console.error('Error loading help content:', error);
32+
setContent('# Error\nFailed to load help content. Please try again later.');
33+
}
34+
};
35+
36+
fetchContent();
37+
}, [section]);
38+
39+
return (
40+
<div className="w-full px-4">
41+
<div
42+
className="
43+
bg-white rounded-lg shadow-sm p-6 mx-auto
44+
max-w-[1200px] min-w-[800px]
45+
max-h-[calc(100vh-8rem)] overflow-y-auto
46+
scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100
47+
hover:scrollbar-thumb-gray-400
48+
[&::-webkit-scrollbar]:w-2
49+
[&::-webkit-scrollbar-track]:bg-gray-100
50+
[&::-webkit-scrollbar-thumb]:bg-gray-300
51+
[&::-webkit-scrollbar-thumb]:rounded-full
52+
[&::-webkit-scrollbar-thumb:hover]:bg-gray-400
53+
"
54+
>
55+
<Markdown
56+
className="
57+
prose prose-lg max-w-none
58+
prose-headings:text-gray-900
59+
prose-h1:text-3xl prose-h1:font-bold prose-h1:mb-8
60+
prose-h2:text-2xl prose-h2:font-semibold prose-h2:mt-8 prose-h2:mb-4
61+
prose-h3:text-xl prose-h3:font-medium prose-h3:mt-6 prose-h3:mb-3
62+
prose-p:text-gray-600 prose-p:leading-relaxed
63+
prose-code:text-blue-600
64+
prose-pre:bg-gray-900 prose-pre:rounded-lg prose-pre:p-4
65+
prose-pre:shadow-md
66+
"
67+
>
68+
{content}
69+
</Markdown>
70+
</div>
71+
</div>
72+
);
73+
}

src/components/HelpLayout.tsx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { Link, Outlet, useLocation } from 'react-router-dom';
2+
3+
export function HelpLayout() {
4+
const location = useLocation();
5+
6+
const isActive = (path: string) => {
7+
return location.pathname === path;
8+
};
9+
10+
const linkClass = (path: string) => {
11+
return `block px-4 py-2 rounded-lg transition-colors ${
12+
isActive(path)
13+
? 'bg-blue-100 text-blue-700 font-medium'
14+
: 'text-gray-600 hover:bg-gray-100'
15+
}`;
16+
};
17+
18+
return (
19+
<div className="container mx-auto px-4 py-8">
20+
<h1 className="text-3xl font-bold mb-8">Help Center</h1>
21+
<div className="flex gap-8">
22+
<aside className="w-64 flex-shrink-0">
23+
<nav className="flex flex-col gap-2 sticky top-8">
24+
<Link
25+
to="/help/continue-setup"
26+
className={linkClass('/help/continue-setup')}
27+
>
28+
Continue Setup
29+
</Link>
30+
<Link
31+
to="/help/copilot-setup"
32+
className={linkClass('/help/copilot-setup')}
33+
>
34+
CoPilot Setup
35+
</Link>
36+
</nav>
37+
</aside>
38+
<main className="flex-1 min-w-0">
39+
<Outlet />
40+
</main>
41+
</div>
42+
</div>
43+
);
44+
}

0 commit comments

Comments
 (0)