Skip to content

Commit 9966750

Browse files
committed
feat(website): add website into the monorepo
1 parent f76ed66 commit 9966750

272 files changed

Lines changed: 23945 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/push-website.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Upload Site to Bunny
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
branches:
11+
- "main"
12+
paths:
13+
- "website/src/**"
14+
- "website/public/**"
15+
- ".github/workflows/push-website.yml"
16+
17+
jobs:
18+
build_push_website:
19+
name: Push Website
20+
runs-on: blacksmith-16vcpu-ubuntu-2404
21+
steps:
22+
- name: Checkout the repo
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: "22"
29+
30+
- name: Install dependencies
31+
run: cd website && npm ci
32+
33+
- name: Build
34+
run: cd website && npm run build
35+
36+
- name: Upload Dir to Bunny
37+
env:
38+
BUNNY_API_KEY: ${{ secrets.BUNNY_API_KEY }}
39+
STORAGE_ZONE: trieve-site
40+
UPLOAD_PATH: website/dist
41+
run: "bash website/upload-to-bunny.sh"
42+
43+
- name: Purge Cache
44+
env:
45+
BUNNY_NET_API_KEY: ${{ secrets.BUNNY_NET_API_KEY }}
46+
ZONE_ID: ${{ secrets.ZONE_ID }}
47+
run: |
48+
curl --request POST \
49+
--url https://api.bunny.net/pullzone/${ZONE_ID}/purgeCache \
50+
--header "AccessKey: ${BUNNY_NET_API_KEY}" \
51+
--header 'content-type: application/json'

website/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# build output
2+
dist/
3+
4+
# generated types
5+
.astro/
6+
7+
# dependencies
8+
node_modules/
9+
10+
# logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
.idea/

website/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/content

website/.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": ["prettier-plugin-astro"],
3+
"overrides": [
4+
{
5+
"files": "*.astro",
6+
"options": {
7+
"parser": "astro"
8+
}
9+
}
10+
]
11+
}

website/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Trieve Website
2+
3+
This is the source code for the Trieve website. It is built using [Astro](https://astro.build/), [Tailwind CSS](https://tailwindcss.com/), [TypeScript](https://www.typescriptlang.org/) and [Keystatic CMS](https://keystatics.com/).
4+
5+
## 🚀 Project Structure
6+
7+
Inside of the project, you'll see the following folders and files:
8+
9+
```text
10+
/
11+
├── public/ - Static files
12+
├── src/
13+
│ ├── assets/ - Images, fonts, etc. (also assets uploaded through Keystatic)
14+
│ ├── components/ - Reusable Astro components
15+
│ ├── content/ - Markdown files for content (managed by Keystatic)
16+
│ ├── layouts/ - Layout Astro components
17+
│ ├── lib/ - Utility functions (e.g. fetching data)
18+
│ │ └── keystatic/ - Keystatic API client, collection types and definitions
19+
│ ├── pages/ - Astro pages
20+
│ ├── styles/ - Global styles
21+
│ └── content.config.ts - Configuration for Astro content components
22+
├── astro.config.mjs - Astro configuration
23+
├── keystatic.config.ts - Keystatic configuration
24+
└── package.json
25+
```
26+
27+
To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).
28+
29+
## 🧞 Commands
30+
31+
All commands are run from the root of the project, from a terminal:
32+
33+
| Command | Action |
34+
| :------------------------ | :----------------------------------------------- |
35+
| `npm install` | Installs dependencies |
36+
| `npm run dev` | Starts local dev server at `localhost:4321` |
37+
| `npm run build` | Build your production site to `./dist/` |
38+
| `npm run preview` | Preview your build locally, before deploying |
39+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
40+
| `npm run astro -- --help` | Get help using the Astro CLI |
41+
42+
## 👀 Want to learn more?
43+
44+
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).

website/astro.config.mjs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// @ts-check
2+
import { defineConfig } from "astro/config";
3+
import icon from "astro-icon";
4+
import react from "@astrojs/react";
5+
import keystatic from "@keystatic/astro";
6+
import tailwindcss from "@tailwindcss/vite";
7+
8+
import sitemap from "@astrojs/sitemap";
9+
10+
import mdx from "@astrojs/mdx";
11+
12+
// https://astro.build/config
13+
export default defineConfig({
14+
site: "https://trieve.ai",
15+
devToolbar: {
16+
enabled: false,
17+
},
18+
image: {
19+
domains: ["127.0.0.1"],
20+
},
21+
integrations: [
22+
react(),
23+
...(process.env.SKIP_KEYSTATIC ? [] : [keystatic()]),
24+
sitemap(),
25+
icon(),
26+
mdx({
27+
shikiConfig: {
28+
theme: "nord",
29+
},
30+
}),
31+
],
32+
vite: {
33+
resolve: {
34+
alias: {
35+
"@": "/src",
36+
},
37+
},
38+
plugins: [tailwindcss()],
39+
optimizeDeps: {
40+
exclude: ["chunk-M7RVBV2D"],
41+
},
42+
},
43+
redirects: {
44+
"/accurate-hallucination-detection-with-ner":
45+
"/blog/accurate-hallucination-detection-with-ner",
46+
"/build-hotel-voice-assistant-with-trieve-and-vapi":
47+
"/blog/build-hotel-voice-assistant-with-trieve-and-vapi",
48+
"/building-blazingly-fast-typo-correction-in-rust":
49+
"/blog/building-blazingly-fast-typo-correction-in-rust",
50+
"/building-search-for-yc-company-directory":
51+
"/blog/building-search-for-yc-company-directory",
52+
"/firecrawl-and-trieve": "/blog/firecrawl-and-trieve",
53+
"/history-of-hnsearch": "/blog/history-of-hnsearch",
54+
"/open_ai_streaming": "/blog/open_ai_streaming",
55+
"/pgvector-missing-features": "/blog/pgvector-missing-features",
56+
"/success-story-billtrack50": "/blog/success-story-billtrack50",
57+
"/success-story-mintlify": "/blog/success-story-mintlify",
58+
"/trieve-fundraise-announcement": "/blog/trieve-fundraise-announcement",
59+
"/trieve-self-hosting-on-vps": "/blog/trieve-self-hosting-on-vps",
60+
"/trieve-sitesearch-launch": "/blog/trieve-sitesearch-launch",
61+
"/tvi-blog": "/blog/tvi-blog",
62+
"/usage-based-pricing": "/blog/usage-based-pricing",
63+
"/we-have-a-new-js-sdk": "/blog/we-have-a-new-js-sdk",
64+
"/sitesearch": "/products/sitesearch",
65+
},
66+
});

website/keystatic.config.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { config } from "@keystatic/core";
2+
import { blogCategories } from "@lib/keystatic/collections/blog-categories";
3+
import { blogPosts } from "@lib/keystatic/collections/blog-posts";
4+
import { comparisons } from "@lib/keystatic/collections/comparisons";
5+
import { integrations } from "@lib/keystatic/collections/integrations";
6+
import { pages } from "@lib/keystatic/collections/pages";
7+
import { products } from "@lib/keystatic/collections/products";
8+
import { testimonials } from "@lib/keystatic/collections/testimonials";
9+
import { aboutTrieve } from "@lib/keystatic/singletons/about-trieve";
10+
import { blog } from "@lib/keystatic/singletons/blog";
11+
import { callToAction } from "@lib/keystatic/singletons/call-to-action";
12+
import { homepage } from "@lib/keystatic/singletons/homepage";
13+
import { integrationsMegamenu } from "@lib/keystatic/singletons/integrations-megamenu";
14+
import { legal } from "@lib/keystatic/collections/legal";
15+
import { resources } from "@lib/keystatic/collections/resources";
16+
import { productsMegamenu } from "@lib/keystatic/singletons/products-megamenu";
17+
import { resourcesMegamenu } from "@lib/keystatic/singletons/resources-megamenu";
18+
import { trustedBrands } from "@lib/keystatic/singletons/trustedBrands";
19+
20+
export default config({
21+
storage: {
22+
kind: "local",
23+
},
24+
collections: {
25+
blogPosts,
26+
blogCategories,
27+
pages,
28+
comparisons,
29+
integrations,
30+
products,
31+
resources,
32+
testimonials,
33+
legal,
34+
},
35+
singletons: {
36+
homepage,
37+
blog,
38+
callToAction,
39+
trustedBrands,
40+
integrationsMegamenu,
41+
productsMegamenu,
42+
resourcesMegamenu,
43+
aboutTrieve,
44+
},
45+
});

0 commit comments

Comments
 (0)