Skip to content

Commit

Permalink
update milvus homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
ThyeeZz committed Jul 5, 2024
1 parent c5a1efa commit 3798877
Show file tree
Hide file tree
Showing 20 changed files with 397 additions and 302 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ yarn-error.log*
.env
.env.development
.env.development.local

global-stats.json
39 changes: 29 additions & 10 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

const withLess = require('next-with-less');
const path = require('path');
const fs = require('fs');
const axios = require('axios');

const nextConfig = {
// reactStrictMode: true,
Expand All @@ -13,15 +15,32 @@ const nextConfig = {
},
};

module.exports = withLess({
lessLoaderOptions: {
/* ... */
},
...nextConfig,
webpack(config) {
config.resolve.alias['@'] = path.resolve(__dirname, 'src');
module.exports = async () => {
const fetchMilvusStats = async () => {
const result = await axios.get(
`${process.env.NEXT_PUBLIC_MSERVICE_URL}/milvus-stats`
);

return {
...config,
pipInstall: result.data.body?.pipInstall || 0,
milvusStars: result.data.body?.milvusStars || 0,
};
},
});
};

const result = await fetchMilvusStats();
console.log('result--', result);
fs.writeFileSync('./global-stats.json', JSON.stringify(result), 'utf8');

return withLess({
lessLoaderOptions: {
/* ... */
},
...nextConfig,
webpack(config) {
config.resolve.alias['@'] = path.resolve(__dirname, 'src');
return {
...config,
};
},
});
};
Binary file added public/images/home/blazing-fast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/home/feature-rich.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/home/integrations.png
Binary file not shown.
18 changes: 18 additions & 0 deletions public/images/home/milvus-union.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/home/reusable-code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home/scale-as-needed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 25 additions & 5 deletions src/components/header/DescktopHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ import {
GITHUB_MILVUS_CLI_LINK,
GITHUB_MILVUS_BACKUP_LINK,
GET_START_LINK,
GITHUB_MILVUS_LINK,
} from '@/consts/links';
import { DownArrowIcon } from '@/components/icons';

import { DownArrowIcon, GitHubIcon } from '@/components/icons';
import { LogoSection } from './Logos';
import milvusStats from '../../../global-stats.json';

type Props = { className?: string };

const startNum = `${(Number(milvusStats?.milvusStars || 0) / 1000).toFixed(
1
)}K`;

export default function DesktopHeader(props: Props) {
const { className } = props;
const { t } = useTranslation('header');
Expand Down Expand Up @@ -77,7 +82,7 @@ export default function DesktopHeader(props: Props) {
<div className="flex items-center gap-[40px]">
<LogoSection lightMode={true} />

<ul className="flex items-center list-none gap-[12px]">
<ul className="flex items-center list-none gap-[12px] max-[1080px]:gap-[10px]">
{menuConfigs.map(config => {
if (config.list) {
return (
Expand All @@ -93,7 +98,7 @@ export default function DesktopHeader(props: Props) {
className="group-hover:rotate-180 transition-transform"
/>
</button>
<ul className="flex flex-col items-stretch gap-[4px] bg-white py-[8px] absolute invisible -z-10 opacity-0 rounded-[4px] list-none shadow-nav-menu transition group-hover:visible group-hover:z-10 group-hover:opacity-100">
<ul className="flex flex-col items-stretch gap-[4px] bg-white py-[8px] absolute invisible -z-10 opacity-0 rounded-[4px] list-none shadow-nav-menu transition group-hover:visible group-hover:z-10 group-hover:opacity-100 ">
{config.list.map(item => (
<li key={item.label}>
<Link
Expand Down Expand Up @@ -125,7 +130,22 @@ export default function DesktopHeader(props: Props) {
</ul>
</div>

<div>
<div className="flex gap-[12px] items-center">
<a
href={GITHUB_MILVUS_LINK}
className={
'flex items-center basis-[77px] flex-shrink-0 flex-grow-0 px-[6px] py-[3px] '
}
target="_blank"
>
<GitHubIcon />
<span className="text-[12px] leading-[18px] ml-[2px] mr-[4px] text-black">
{t('star')}
</span>
<span className="text-[12px] font-[500] leading-[18px] text-black">
{startNum}
</span>
</a>
<Link href={GET_START_LINK}>
<div className="h-9 px-3 py-1.5 rounded-md border border-solid border-gray-300 hover:border-slate-950 justify-start items-center gap-1 inline-flex cursor-pointer transition">
<div className="text-center text-black1 text-sm font-medium leading-[21px]">
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/en/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
},
"blog": "Blog",
"community": "Community",
"start": "Get Started"
"start": "Get Started",
"star": "Star"
}
60 changes: 35 additions & 25 deletions src/i18n/en/home.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "The <1>Vector<0 /> Database</1> Built for<0 /> Developers",
"subTitle": "Milvus is an open-source vector database that brings search to GenAI applications. pip-install on your laptop, use with popular AI dev tools and scale to billions of vectors.",
"title": "The High-Performance<0 /> <1>Vector Database</1> Built for Scale",
"subTitle": "Milvus is an open-source vector database built for GenAI applications. Install with pip, perform high-speed searches, and scale to tens of billions of vectors with minimal performance loss.",
"news": "News",
"buttons": {
"download": "Download",
"star": "Star",
Expand Down Expand Up @@ -50,55 +51,64 @@
"vdbSection": {
"title": "Why Developers Prefer Milvus for Vector Databases",
"features": {
"setup": {
"title": "Easy Setup",
"desc": "Pip-install to start coding in a notebook within seconds."
"scale": {
"title": "Scale as needed",
"desc": "Scale elastically to support tens of billions of vectors with a fully distributed "
},
"fast": {
"title": "Blazing fast",
"desc": "Retrieve data quickly and accurately with Global Index, regardless of scale."
},
"reusable": {
"title": "Reusable Code",
"desc": "Write once, and deploy with one line of code into production environments."
"desc": "Write once, and deploy with one line of code into the production environment."
},
"integration": {
"title": "Integrations",
"desc": "Integrated with LangChain, LlamaIndex and many other AI dev tools."
"community": {
"title": "Supportive Community",
"desc": "Fan-favorite vector database with extensive resources and supportive contributors. "
},
"featureRich": {
"title": "Feature-rich",
"desc": "Metadata filtering, hybrid search, multi-vector and more."
},
"community": {
"title": "Supportive Community",
"desc": "Fan-favorite vector database with extensive resources and supportive contributors."
}
},
"prompt": "Want to learn more about Milvus? View our <0>documentation</0>"
},
"deploySection": {
"title": "Pick the size that works for you",
"title": "Deployment Options to Match Your Unique Journey",
"lite": {
"title": "Milvus Lite",
"advantage": "Lightweight, easy to start",
"features": [
"Get started in seconds",
"Runs on laptops, notebooks, mobile and edge devices"
"VectorDB-as-a-library runs in notebooks/ laptops with a pip install",
"Best for learning and prototyping"
]
},
"milvus": {
"title": "Milvus on Docker or K8s",
"advantage": "Highly scalable, optimized for performance",
"milvusStandalone": {
"title": "Milvus Standalone",
"advantage": "Robust, single-machine deployment",
"features": [
"Easy to deploy on Docker and Kubernetes",
"Scales to billions of vectors"
"Complete vector database for production or testing",
"Ideal for datasets with up to millions of vectors"
]
},
"milvusDistributed": {
"title": "Milvus Distributed",
"advantage": "Fully managed Milvus with minimal ops",
"features": [
"Highly reliable and distributed vector database with comprehensive toolkit",
"Scale horizontally to handle billions of vectors"
]
},
"cloud": {
"title": "Zilliz Cloud",
"advantage": "Fully managed Milvus with minimal ops",
"advantage": "Fully managed with minimal operations",
"features": [
"Production-ready reliability",
"Pay-as-you-go options without the DevOps hassles"
"Available in both serverless and dedicated cluster",
"SaaS and BYOC options for different security and compliance requirements"
]
}
},
"deployModels": "Learn more about different <0>Milvus deployment models</0>"
},
"developSection": {
"title": "Start building your GenAI app now",
Expand Down
20 changes: 8 additions & 12 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ import Layout from '@/components/layout/commonLayout';
import { getMilvusStats } from '@/http/home';
import { ProductionSection } from '@/parts/home/productionSection/ProductionSection';
import { ABSOLUTE_BASE_URL } from '@/consts';
import { getHomepageHeadline } from '@/utils/blogs';

export default function Homepage(props: {
pipInstall: number;
milvusStars: number;
headline: { label: string; link: string };
}) {
// deconstruction props
const { pipInstall, milvusStars } = props;

const { headline } = props;
return (
<Layout>
<main
Expand All @@ -36,28 +34,26 @@ export default function Homepage(props: {
/>
<link rel="alternate" href={`${ABSOLUTE_BASE_URL}/`} hrefLang="en" />
</Head>
<HomePageHeaderSection download={pipInstall} star={milvusStars} />
<HomePageHeaderSection {...headline} />
<CodeExampleSection />
<TryFreeSection />
{/* <TryFreeSection /> */}
<DeploySection />
<AIToolsSection />
<LovedSection />
<ProductionSection />
<VectorDatabaseSection />
<DevelopSection />
<VectorDatabaseSection />
<SubscribeSection />
</main>
</Layout>
);
}

export const getStaticProps = async () => {
const { pipInstall, milvusStars } = await getMilvusStats();

const headline = getHomepageHeadline();
return {
props: {
pipInstall,
milvusStars,
headline,
},
};
};
Loading

0 comments on commit 3798877

Please sign in to comment.