Skip to content

Commit e566d61

Browse files
committed
feat: add rust actix postgres quickstart
Signed-off-by: Atul Chahar <chaharatul92@gmail.com>
1 parent e565c9e commit e566d61

19 files changed

+221
-25
lines changed

src/components/QuickStartFilter.js

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, {useState} from "react";
1+
import React, { useState } from "react";
22
import quickstarts from "./QuickStartList";
33
import Link from "@docusaurus/Link";
4-
import {FaGolang} from "react-icons/fa6";
5-
import {FaJava, FaLaptopCode, FaDocker, FaPython, FaCheck, FaArrowRight, FaArrowLeft} from "react-icons/fa";
6-
import {TbBrandCSharp} from "react-icons/tb";
7-
import {IoLogoJavascript} from "react-icons/io5";
8-
import {useColorMode} from "@docusaurus/theme-common";
4+
import { FaGolang, FaRust } from "react-icons/fa6";
5+
import { FaJava, FaLaptopCode, FaDocker, FaPython, FaCheck, FaArrowRight, FaArrowLeft } from "react-icons/fa";
6+
import { TbBrandCSharp } from "react-icons/tb";
7+
import { IoLogoJavascript } from "react-icons/io5";
8+
import { useColorMode } from "@docusaurus/theme-common";
99

10-
export default function QuickstartFilter({defaultLanguage = null}) {
11-
const {colorMode} = useColorMode();
10+
export default function QuickstartFilter({ defaultLanguage = null }) {
11+
const { colorMode } = useColorMode();
1212
const isDark = colorMode === "dark";
1313

1414
const [currentStep, setCurrentStep] = useState(defaultLanguage ? 2 : 1);
@@ -23,22 +23,23 @@ export default function QuickstartFilter({defaultLanguage = null}) {
2323
});
2424

2525
const languages = [
26-
{name: "Go", icon: <FaGolang size={24} />, color: "#00ADD8"},
27-
{name: "Python", icon: <FaPython size={24} />, color: "#3776AB"},
28-
{name: "Java", icon: <FaJava size={24} />, color: "#007396"},
29-
{name: "JS/TS", icon: <IoLogoJavascript size={24} />, color: "#F7DF1E"},
30-
{name: "C#", icon: <TbBrandCSharp size={24} />, color: "#512BD4"},
26+
{ name: "Go", icon: <FaGolang size={24} />, color: "#00ADD8" },
27+
{ name: "Python", icon: <FaPython size={24} />, color: "#3776AB" },
28+
{ name: "Java", icon: <FaJava size={24} />, color: "#007396" },
29+
{ name: "JS/TS", icon: <IoLogoJavascript size={24} />, color: "#F7DF1E" },
30+
{ name: "C#", icon: <TbBrandCSharp size={24} />, color: "#512BD4" },
31+
{ name: "Rust", icon: <FaRust size={24} />, color: "#DEA584" },
3132
];
3233

3334
const servers = [
34-
{name: "Local", icon: <FaLaptopCode size={24} />, description: "Run directly on your machine"},
35-
{name: "Docker", icon: <FaDocker size={24} />, description: "Run in a Docker container"},
35+
{ name: "Local", icon: <FaLaptopCode size={24} />, description: "Run directly on your machine" },
36+
{ name: "Docker", icon: <FaDocker size={24} />, description: "Run in a Docker container" },
3637
];
3738

3839
const steps = [
39-
{id: 1, label: "Language", icon: languages.find(l => l.name === language)?.icon || null},
40-
{id: 2, label: "Environment", icon: server === "Docker" ? <FaDocker size={16} /> : server === "Local" ? <FaLaptopCode size={16} /> : null},
41-
{id: 3, label: "Quickstart", icon: null},
40+
{ id: 1, label: "Language", icon: languages.find(l => l.name === language)?.icon || null },
41+
{ id: 2, label: "Environment", icon: server === "Docker" ? <FaDocker size={16} /> : server === "Local" ? <FaLaptopCode size={16} /> : null },
42+
{ id: 3, label: "Quickstart", icon: null },
4243
];
4344

4445
const handleLanguageSelect = (lang) => {
@@ -372,10 +373,10 @@ export default function QuickstartFilter({defaultLanguage = null}) {
372373
</div>
373374
<span>{step.label}</span>
374375
{currentStep > step.id && step.id === 1 && language && (
375-
<span style={{color: '#ff914d', marginLeft: '0.25rem'}}>({language})</span>
376+
<span style={{ color: '#ff914d', marginLeft: '0.25rem' }}>({language})</span>
376377
)}
377378
{currentStep > step.id && step.id === 2 && server && (
378-
<span style={{color: '#ff914d', marginLeft: '0.25rem'}}>({server})</span>
379+
<span style={{ color: '#ff914d', marginLeft: '0.25rem' }}>({server})</span>
379380
)}
380381
</div>
381382
{idx < steps.length - 1 && (
@@ -402,7 +403,7 @@ export default function QuickstartFilter({defaultLanguage = null}) {
402403
<div className="wizard-option-radio">
403404
{language === lang.name && <FaCheck size={10} color="#fff" />}
404405
</div>
405-
<div className="wizard-option-icon" style={{color: lang.color}}>
406+
<div className="wizard-option-icon" style={{ color: lang.color }}>
406407
{lang.icon}
407408
</div>
408409
<span className="wizard-option-label">{lang.name}</span>
@@ -417,15 +418,15 @@ export default function QuickstartFilter({defaultLanguage = null}) {
417418
<>
418419
<h3 className="wizard-title">Select your environment</h3>
419420
<p className="wizard-subtitle">Choose where you want to run the application server</p>
420-
<div className="wizard-options" style={{gridTemplateColumns: 'repeat(auto-fill, minmax(220px, 1fr))'}}>
421+
<div className="wizard-options" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(220px, 1fr))' }}>
421422
{servers.map((srv) => (
422423
<button
423424
key={srv.name}
424425
className={`wizard-option ${server === srv.name ? 'selected' : ''}`}
425426
onClick={() => handleServerSelect(srv.name)}
426-
style={{flexDirection: 'column', alignItems: 'flex-start', gap: '0.5rem'}}
427+
style={{ flexDirection: 'column', alignItems: 'flex-start', gap: '0.5rem' }}
427428
>
428-
<div style={{display: 'flex', alignItems: 'center', gap: '0.75rem', width: '100%'}}>
429+
<div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem', width: '100%' }}>
429430
<div className="wizard-option-radio">
430431
{server === srv.name && <FaCheck size={10} color="#fff" />}
431432
</div>
@@ -434,7 +435,7 @@ export default function QuickstartFilter({defaultLanguage = null}) {
434435
</div>
435436
<span className="wizard-option-label">{srv.name}</span>
436437
</div>
437-
<p className="wizard-option-desc" style={{marginLeft: '3.5rem'}}>{srv.description}</p>
438+
<p className="wizard-option-desc" style={{ marginLeft: '3.5rem' }}>{srv.description}</p>
438439
</button>
439440
))}
440441
</div>

src/components/QuickStartList.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,23 @@ const quickstarts = [
395395
"A sample app to demonstrate Keploy integration capabilities using TypeScript and Nhost.",
396396
link: "/docs/quickstart/samples-typescript/#running-the-app-using-docker",
397397
},
398+
// Rust list
399+
{
400+
title: "Actix + Postgres",
401+
language: "Rust",
402+
server: "Docker",
403+
description:
404+
"A sample Actix-web app to demonstrate how seamlessly Keploy integrates with Rust and PostgreSQL.",
405+
link: "/docs/quickstart/rust-actix-postgres/#option-1-using-docker-compose-",
406+
},
407+
{
408+
title: "Actix + Postgres",
409+
language: "Rust",
410+
server: "Local",
411+
description:
412+
"A sample Actix-web app to demonstrate how seamlessly Keploy integrates with Rust and PostgreSQL.",
413+
link: "/docs/quickstart/rust-actix-postgres/#option-2-running-locally-",
414+
},
398415
];
399416

400417
export default quickstarts;
77 KB
Loading

static/img/rust-curl-traffic.png

115 KB
Loading

static/img/rust-docker-up.png

51.9 KB
Loading
141 KB
Loading

static/img/rust-local-curl.png

118 KB
Loading

static/img/rust-local-db-up.png

93.6 KB
Loading

static/img/rust-local-db.png

96.2 KB
Loading
141 KB
Loading

0 commit comments

Comments
 (0)