Skip to content

Commit 4452de8

Browse files
authored
feat: redesign javascript quick start (#698)
* feat: redesign javascript quickstart Signed-off-by: Achanandhi-M <[email protected]> * feat: redesign javascript quickstart Signed-off-by: Achanandhi-M <[email protected]> --------- Signed-off-by: Achanandhi-M <[email protected]> Signed-off-by: Achanandhi M <[email protected]>
1 parent ae3d249 commit 4452de8

File tree

10 files changed

+203
-153
lines changed

10 files changed

+203
-153
lines changed

β€Žsrc/components/Community.jsβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ export const Community = () => {
8686

8787
<div className="flex-auto">
8888
<h3 className="font-bold">Substack</h3>
89-
<p className="text-sm text-gray-700">
90-
Ideas worth reading β€” delivered directly to you.
91-
</p>
89+
<p>Ideas worth reading β€” delivered directly to you.</p>
9290
</div>
9391
</a>
9492
</li>

β€Žsrc/components/QuickStartList.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ const quickstarts = [
351351
{
352352
title: "Express + Postgres + Prisma ",
353353
language: "JS/TS",
354-
server: "Docker",
354+
server: "Local",
355355
description:
356356
"A sample Task Management app to demonstrate how seamlessly Keploy integrates with Express, PostgreSQL, and Prisma ORM.",
357357
link: "/docs/quickstart/express-postgresql-prisma/#running-app-locally-on-linuxwsl",

β€Žversioned_docs/version-2.0.0/quickstart/nextjs-postgres.mdβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ keyword:
1717

1818
This is a sample app to test Keploy integration capabilities using NextJS and Postgres with Drizzle ORM. Buckle up, it's gonna be a fun ride! 🎒
1919

20-
import InstallationGuide from '../concepts/installation.md'
21-
22-
<InstallationGuide/>
23-
2420
## Get Started! 🎬
2521

2622
Now that we have bun installed, we will setup our application.

β€Žversioned_docs/version-2.0.0/quickstart/samples-bunjs.mdβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ keyword:
2525

2626
This is a sample app to test Keploy integration capabilities using Bun.js and MongoDB.
2727

28-
import InstallationGuide from '../concepts/installation.md'
29-
30-
<InstallationGuide/>
31-
3228
## Get Started! 🎬
3329

3430
## Clone a sample user data CRUD app πŸ§ͺ

β€Žversioned_docs/version-3.0.0/quickstart/express-postgresql-prisma.mdβ€Ž

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ keyword:
1818
- Auto Testcase generation
1919
---
2020

21-
## Introduction
21+
import InstallReminder from '@site/src/components/InstallReminder';
22+
import SectionDivider from '@site/src/components/SectionDivider';
2223

23-
A sample Task Management application and see how seamlessly Keploy integrates with Express, [PostgreSQL](https://www.postgresql.org/) and Prisma ORM. Buckle up, it's gonna be a fun ride! 🎒
24+
## Running App Locally on Linux/WSL
2425

25-
import InstallationGuide from '../concepts/installation.md'
26+
A sample Task Management application and see how seamlessly Keploy integrates with Express, PostgreSQL and Prisma ORM. Buckle up, it's gonna be a fun ride!
2627

27-
<InstallationGuide/>
28-
29-
## Get Started! 🎬
28+
<InstallReminder />
3029

3130
### Prerequisites
3231

@@ -43,8 +42,6 @@ git clone https://github.com/keploy/samples-typescript.git
4342
cd samples-typescript/express-postgresql-prisma
4443
```
4544

46-
### Running App Locally on Linux/WSL
47-
4845
#### Install the dependencies
4946

5047
```bash
@@ -175,7 +172,46 @@ The above command will start recording the API calls made to the application and
175172
176173
> πŸ’‘ You can use Postman or any other API testing tool to test the API calls. Additionally, the application will run a swagger UI on `http://localhost:3000/api/docs` to visualize the API calls.
177174
178-
### Running App using Docker Compose 🐳
175+
#### Test the Application
176+
177+
```bash
178+
keploy test -c "npm start"
179+
```
180+
181+
<SectionDivider />
182+
183+
## Running App using Docker Compose 🐳
184+
185+
A sample Task Management application and see how seamlessly Keploy integrates with Express, PostgreSQL and Prisma ORM. Buckle up, it's gonna be a fun ride!
186+
187+
<InstallReminder />
188+
189+
### Prerequisites
190+
191+
Ensure you have the following installed:
192+
193+
- Docker
194+
- Node.js and npm
195+
- Keploy CLI
196+
197+
Clone the repository and move to express-postgresql-prisma folder
198+
199+
```bash
200+
git clone https://github.com/keploy/samples-typescript.git
201+
cd samples-typescript/express-postgresql-prisma
202+
```
203+
204+
#### Install the dependencies
205+
206+
```bash
207+
npm install
208+
```
209+
210+
#### Set up environment variables:
211+
212+
```bash
213+
cp .env.example .env
214+
```
179215
180216
We will be using Docker compose to run the application as well as PostreSql on Docker container.
181217
@@ -334,14 +370,6 @@ curl -X 'DELETE' \
334370
335371
### Test the Application using Keploy
336372
337-
#### on Linux/WSL
338-
339-
```bash
340-
keploy test -c "npm start"
341-
```
342-
343-
#### On Docker Compose 🐳
344-
345373
```bash
346374
keploy test -c "docker compose up" --container-name "nodeMongoApp" --build-delay 50 --delay 10
347375
```

β€Žversioned_docs/version-3.0.0/quickstart/nextjs-postgres.mdβ€Ž

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ keyword:
1313
- Auto Testcase generation
1414
---
1515

16-
## Introduction
16+
## Running App Locally on Linux/WSL 🐧
1717

1818
This is a sample app to test Keploy integration capabilities using NextJS and Postgres with Drizzle ORM. Buckle up, it's gonna be a fun ride! 🎒
1919

20-
import InstallationGuide from '../concepts/installation.md'
20+
import Link from '@docusaurus/Link'
21+
import InstallReminder from '@site/src/components/InstallReminder';
2122

22-
<InstallationGuide/>
23+
<InstallReminder />
2324

24-
## Get Started! 🎬
25+
### Get Started! 🎬
2526

2627
Now that we have bun installed, we will se tup our application.
2728

@@ -35,12 +36,6 @@ npm install
3536
docker-compose up
3637
```
3738

38-
## Installation πŸ“₯
39-
40-
- [Using Docker container for Postgres and running application locally](#running-app-locally-on-linuxwsl-)
41-
42-
## Running App Locally on Linux/WSL 🐧
43-
4439
We'll be running our sample application right on Linux, but just to make things a tad more thrilling, we'll have the database (Redis) chill on Docker. Ready? Let's get the party started!πŸŽ‰
4540

4641
### Capture testcase
@@ -51,6 +46,8 @@ Ready, set, record! Here's how:
5146
sudo -E env PATH=$PATH keploy record -c 'npm run dev'
5247
```
5348

49+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/Keploy-record-nextjs-postgres.png" alt="Sample Keploy Record Javascript" width="100%" style={{ borderRadius: '5px' }} />
50+
5451
Alright, magician! With the app alive and kicking, let's weave some test cases. The spell? Making some API calls!
5552

5653
#### Generate testcases
@@ -82,7 +79,7 @@ This will return the response:
8279
curl -X GET http://localhost:3000/api/users
8380
```
8481

85-
![Test Record](../../../static/img/nextjs-postgres-record.png)
82+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/Keploy-record-output-nextjs-postgres.png" alt="Sample Keploy Record Javascript" width="100%" style={{ borderRadius: '5px' }} />
8683

8784
Give yourself a pat on the back! With that simple spell, you've conjured up test cases with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`.
8885

@@ -96,7 +93,7 @@ Time to put things to the test πŸ§ͺ
9693
sudo -E env PATH=$PATH keploy test -c "npm run dev" --delay 10
9794
```
9895

99-
![Test Run](../../../static/img/nextjs-postgres-test.png)
96+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/Keploy-result-output-postgres-nextjs.png" alt="Sample Keploy Record Javascript" width="100%" style={{ borderRadius: '5px' }} />
10097

10198
> The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking.
10299
@@ -105,5 +102,3 @@ Final thoughts? Dive deeper! Try different API calls, tweak the DB response in t
105102
### Wrapping it up πŸŽ‰
106103

107104
Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible. πŸ˜ŠπŸš€
108-
109-
Hope this helps you out, if you still have any questions, reach out to us .

β€Žversioned_docs/version-3.0.0/quickstart/node-express-mongoose.mdβ€Ž

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,18 @@ keyword:
1717
- Auto Testcase generation
1818
---
1919

20-
## Introduction
20+
import Link from '@docusaurus/Link'
21+
import InstallReminder from '@site/src/components/InstallReminder';
2122

22-
A simple sample CRUD application and see how seamlessly Keploy integrates with Express and MongoDB. Buckle up, it's gonna be a fun ride! 🎒
23+
import SectionDivider from '@site/src/components/SectionDivider';
24+
25+
## Using Docker Compose 🐳
2326

24-
import InstallationGuide from '../concepts/installation.md'
27+
A simple sample CRUD application and see how seamlessly Keploy integrates with Express and MongoDB. Buckle up, it's gonna be a fun ride! 🎒
2528

26-
<InstallationGuide/>
29+
<InstallReminder />
2730

28-
## Get Started! 🎬
31+
### Get Started! 🎬
2932

3033
Clone the repository and move to express-mongoose folder
3134

@@ -36,16 +39,6 @@ git clone https://github.com/keploy/samples-typescript && cd samples-typescript/
3639
npm install
3740
```
3841

39-
## Installation πŸ“₯
40-
41-
Depending on your OS, choose your adventure:
42-
There are 2 ways you can run this sample application.
43-
44-
- [Using Docker compose : running application as well as MongoDb on Docker container](#using-docker-compose-)
45-
- [Using Docker container for mongoDb and running application locally](#running-app-locally-on-linuxwsl-)
46-
47-
## Using Docker Compose 🐳
48-
4942
We will be using Docker compose to run the application as well as MongoDb on Docker container.
5043

5144
### Lights, Camera, Record! πŸŽ₯
@@ -59,6 +52,8 @@ Fire up the application and mongoDB instance with Keploy. Keep an eye on the two
5952
keploy record -c "docker compose up" --container-name "nodeMongoApp" --build-delay 50
6053
```
6154

55+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-record-express-new-mongo.png" alt="Sample Keploy Test Result Gin MongoDB" width="100%" style={{ borderRadius: '5px' }} />
56+
6257
πŸ”₯ Challenge time! Generate some test cases. How? Just **make some API calls**. Postman, Hoppscotch or even curl - take your pick!
6358

6459
#### Let's generate the testcases.
@@ -104,24 +99,37 @@ Time to put things to the test πŸ§ͺ
10499
keploy test -c "docker compose up" --container-name "nodeMongoApp" --build-delay 50 --delay 10
105100
```
106101

107-
> The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking.
108-
109-
Your results should be looking all _snazzy_, like this:
102+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-test-express-new-mongo.png" alt="Sample Keploy Test Result Gin MongoDB" width="100%" style={{ borderRadius: '5px' }} />
110103

111-
<img src="/docs/img/testrun-node-fail.png" alt="Sample Keploy Test Result Gin MongoDB" width="100%" style={{ borderRadius: '5px' }} />
112-
113-
Worry not, just add the ever-changing fields (like our **ts** here) to the **noise parameter** to **dodge those assertions**.
104+
> The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking.
114105
115-
<img src="/docs/img/testrun-node-pass.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
106+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-result-express-new-mongo.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
116107

117108
### Wrapping it up πŸŽ‰
118109

119110
Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible.πŸ˜ŠπŸš€
120111

121112
Happy coding! βœ¨πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»βœ¨
122113

114+
<SectionDivider />
115+
123116
## Running App Locally on Linux/WSL 🐧
124117

118+
A simple sample CRUD application and see how seamlessly Keploy integrates with Express and MongoDB. Buckle up, it's gonna be a fun ride! 🎒
119+
120+
<InstallReminder />
121+
122+
### Get Started! 🎬
123+
124+
Clone the repository and move to express-mongoose folder
125+
126+
```bash
127+
git clone https://github.com/keploy/samples-typescript && cd samples-typescript/express-mongoose
128+
129+
# Install the dependencies
130+
npm install
131+
```
132+
125133
We'll be running our sample application right on Linux, but just to make things a tad more thrilling, we'll have the database (mongoDB) chill on Docker. Ready? Let's get the party started!πŸŽ‰
126134

127135
If you are using WSL on windows then use below to start wsl in the user's home directory:
@@ -154,6 +162,8 @@ Ready, set, record! Here's how:
154162
sudo -E env PATH=$PATH keploy record -c 'node src/app.js'
155163
```
156164

165+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-mongoose-record-new.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
166+
157167
Keep an eye out for the `-c `flag! It's the command charm to run the app.
158168

159169
Alright, magician! With the app alive and kicking, let's weave some test cases. The spell? Making some API calls! Postman, Hoppscotch, or the classic curl - pick your wand.
@@ -181,14 +191,12 @@ Student registration successful!
181191

182192
πŸŽ‰ Woohoo! Give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`.
183193

184-
<img src="/docs/img/testcase-node.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
185-
186194
Now, the real fun begins. Let's weave more spells!
187195

188196
πŸš€ Follow the URL road...!
189197

190198
```bash
191-
curl --request GET \ --url http://localhost:8080/students
199+
curl --request GET \ --url http://localhost:8000/students
192200
```
193201

194202
Or simply wander over to your browser and visit `http://localhost:8000/students`.
@@ -203,12 +211,12 @@ Ready to put your spells to the test?
203211
sudo -E env PATH=$PATH keploy test -c "node src/app.js" --delay 10
204212
```
205213

206-
Worry not, just add the ever-changing fields (like our **ts** here) to the **noise parameter** to **dodge those assertions**.
214+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-mongo-test-new.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
207215

208-
<img src="/docs/img/testrun-node-pass.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
216+
output should look like
217+
218+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-mongooose-result-new.png" alt="Sample Keploy Test Result Node MongoDB" width="100%" style={{ borderRadius: '5px' }} />
209219

210220
### Wrapping it up πŸŽ‰
211221

212222
Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible.πŸ˜ŠπŸš€
213-
214-
Hope this helps you out, if you still have any questions, reach out to us .

0 commit comments

Comments
Β (0)