diff --git a/package.json b/package.json
index 2cc669c6e..13522b2d8 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,7 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
+ "clean": "rimraf build",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
@@ -25,10 +26,10 @@
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"lint": "^0.8.19",
+ "prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-player": "^2.6.0",
- "prism-react-renderer": "^2.1.0",
"remark-typescript-tools": "1.0.9",
"typescript": "5",
"uuid": "^8.3.2",
@@ -61,9 +62,10 @@
"postcss-preset-env": "^7.4.1",
"prettier": "^2.5.1",
"prettier-plugin-tailwindcss": "^0.1.4",
+ "rimraf": "^6.0.1",
"tailwindcss": "^3.0.1"
},
"engines": {
- "node":">=18.0"
+ "node": ">=18.0"
}
}
diff --git a/static/img/Flask-redis-Captured test cases.png b/static/img/Flask-redis-Captured test cases.png
new file mode 100644
index 000000000..cf37b11e7
Binary files /dev/null and b/static/img/Flask-redis-Captured test cases.png differ
diff --git a/static/img/Pet-clinic-record.png b/static/img/Pet-clinic-record.png
new file mode 100644
index 000000000..cd94e40b2
Binary files /dev/null and b/static/img/Pet-clinic-record.png differ
diff --git a/static/img/Pet-clinic-test1.png b/static/img/Pet-clinic-test1.png
new file mode 100644
index 000000000..81ee6f541
Binary files /dev/null and b/static/img/Pet-clinic-test1.png differ
diff --git a/static/img/Pet-clinic-test2.png b/static/img/Pet-clinic-test2.png
new file mode 100644
index 000000000..fef05a508
Binary files /dev/null and b/static/img/Pet-clinic-test2.png differ
diff --git a/static/img/Sanic-Mongo-Test.png b/static/img/Sanic-Mongo-Test.png
new file mode 100644
index 000000000..9b9579e14
Binary files /dev/null and b/static/img/Sanic-Mongo-Test.png differ
diff --git a/static/img/Sanic-mongo-record.png b/static/img/Sanic-mongo-record.png
new file mode 100644
index 000000000..a1a5286ba
Binary files /dev/null and b/static/img/Sanic-mongo-record.png differ
diff --git a/static/img/wsl-record-ts.png b/static/img/wsl-record-ts.png
new file mode 100644
index 000000000..55d4c4c40
Binary files /dev/null and b/static/img/wsl-record-ts.png differ
diff --git a/static/img/wsl-test-summary-ts.png b/static/img/wsl-test-summary-ts.png
new file mode 100644
index 000000000..99cbf25c7
Binary files /dev/null and b/static/img/wsl-test-summary-ts.png differ
diff --git a/static/img/wsl-test-ts.png b/static/img/wsl-test-ts.png
new file mode 100644
index 000000000..d72f15eb9
Binary files /dev/null and b/static/img/wsl-test-ts.png differ
diff --git a/versioned_docs/version-2.0.0/concepts/installation.md b/versioned_docs/version-2.0.0/concepts/installation.md
index bf1911e57..0b7e5c0ab 100644
--- a/versioned_docs/version-2.0.0/concepts/installation.md
+++ b/versioned_docs/version-2.0.0/concepts/installation.md
@@ -24,7 +24,10 @@ import PlatformRequirements from '../concepts/platform-requirements.md'
-## Quick Installation
+# Keploy Installation
+
+## Quick Installation Using CLI
+
Let's get started by setting up the Keploy alias with this command:
@@ -64,12 +67,20 @@ Use "keploy [command] --help" for more information about a command.
🎉 Wohoo! You are all set to use Keploy.
+
+
## Other Installation Methods
+
+Install using Docker
+
+
### Downloading and running Keploy in Docker
#### On macOS
+Note : Keploy is not supported natively on MacOS, so you can follow the below method to run with docker
+
1. Open up a terminal window.
2. Create a bridge network in Docker using the following docker network create command:
@@ -84,6 +95,103 @@ docker network create keploy-network
alias keploy="docker run --name keploy-v2 -p 16789:16789 --network keploy-network --privileged --pid=host -v $(pwd):$(pwd) -w $(pwd) -v /sys/fs/cgroup:/sys/fs/cgroup -v /sys/kernel/debug:/sys/kernel/debug -v /sys/fs/bpf:/sys/fs/bpf -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/keploy/keploy"
```
+
+
+
+
+Running Keploy Natively on MacOS by setting up a linux env
+
+### Downloading and running Keploy in Native using Debian on MacOS
+
+1. Open the terminal Session.
+2. Run the following command
+
+```bash
+limactl show-ssh --format=config debian-12 & add it to its ssh config
+```
+3. Open a remote window on your code editor
+4. Click on connect to host
+5. Now select the configured SSH as "lima-debian"
+6. Once you are in the terminal run the following commands to go into your directory
+
+```bash
+cd /Users
+```
+
+```bash
+cd /{Username}
+```
+7. Run the following command to install Keploy
+
+```bash
+curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_arm64.tar.gz" | tar xz --overwrite -C /tmp
+sudo mkdir -p /usr/local/bin && sudo mv /tmp/keploy /usr/local/bin/keploy
+```
+8. Run the following command to install Zsh
+
+```bash
+sudo apt-get -y install zsh
+```
+**Why?** : zsh (Z Shell) is an advanced shell that offers enhanced features compared to the default bash shell. It provides better autocompletion, advanced globbing, improved history management, and more customization options.
+
+9. Install Git
+
+```bash
+sudo apt-get -y install git
+```
+
+10. Install 'Oh-my-zsh'
+
+```bash
+sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
+```
+**Why?** : oh-my-zsh is a framework for managing your zsh configuration. It comes with a collection of plugins, themes, and helpful features that enhance the zsh experience.
+
+11. Commands to Install docker
+
+```bash
+sudo apt-get -y update
+```
+```bash
+sudo apt-get -y install ca-certificates curl
+```
+```bash
+sudo install -m 0755 -d /etc/apt/keyrings
+```
+```bash
+sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
+```
+```bash
+sudo chmod a+r /etc/apt/keyrings/docker.asc
+```
+```bash
+echo \
+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
+ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+```
+```bash
+sudo apt-get -y update
+```
+```bash
+sudo apt-get -y update
+```
+```bash
+sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+```
+
+12. Add docker to sudoers
+```bash
+sudo groupadd docker
+```
+```bash
+sudo gpasswd -a $USER docker
+```
+
+
+
+Downloading and running Keploy in Native
+
### Downloading and running Keploy in Native
**Prequisites:**
@@ -92,6 +200,9 @@ alias keploy="docker run --name keploy-v2 -p 16789:16789 --network keploy-networ
- Run `uname -a` to verify the system architecture.
- In case of Windows, use WSL with Ubuntu 20.04 LTS or higher.
+Downloading and running Keploy On WSL/Linux AMD
+
+
#### On WSL/Linux AMD
1. Open the terminal Session.
@@ -126,6 +237,11 @@ By default, Docker Desktop may not be configured to work with all WSL 2 distros
> This setup is essential for Keploy to function correctly in a WSL 2 environment, as it needs to interact with the Docker daemon to manage containers and networks effectively.
> For detailed instructions on how to configure `Docker Desktop` for WSL 2, please refer to the [official Docker documentation](https://docs.docker.com/desktop/wsl/).
+
+
+
+With Arkade
+
### With Arkade
1. Installing Arkade
@@ -152,3 +268,4 @@ Or you can also download specific version of Keploy using the following command:
```bash
arkade get keploy@2.2.0-alpha23
```
+
\ No newline at end of file
diff --git a/versioned_docs/version-2.0.0/quickstart/flask-redis.md b/versioned_docs/version-2.0.0/quickstart/flask-redis.md
new file mode 100644
index 000000000..f4d7afc13
--- /dev/null
+++ b/versioned_docs/version-2.0.0/quickstart/flask-redis.md
@@ -0,0 +1,183 @@
+---
+id: flask-redis
+title: Sample Library App (Flask + Redis)
+sidebar_label: Flask + Redis
+description: This application is a simple Library API built using Flask and Redis for data storage. It allows you to perform basic CRUD (Create, Read, Update, Delete) operations on Movie records.
+
+tags:
+ - flask
+ - quickstart
+ - samples
+ - examples
+ - tutorial
+ - python-framework
+ - redis
+keyword:
+ - FastAPI Framework
+ - Flask
+ - Redis
+ - Python
+ - API Test generator
+ - Auto case generation
+---
+
+## Introduction
+
+🪄 Dive into the world of Student CRUD Apps and see how seamlessly Keploy integrated with [Flask](https://flask.palletsprojects.com/en/3.0.x/) and [Redis](https://redis.io/). Buckle up, it's gonna be a fun ride! 🎢
+
+import InstallationGuide from '../concepts/installation.md'
+
+
+
+## Get Started! 🎬
+
+## Clone the application 🧪
+
+```bash
+git clone https://github.com/keploy/samples-python.git && cd samples-python/flask-redis
+```
+
+## Installation Keploy
+
+Depending on your OS, choose your adventure:
+
+We are going to run the application the following way
+
+- [Using Docker compose : running application as well as Mongo on Docker container](#using-docker-compose-)
+
+## Using Docker Compose 🐳
+
+We will be using Docker compose to run the application as well as Mongo on Docker container.
+
+### Lights, Camera, Record! 🎥
+
+Capture the test-cases-
+
+```shell
+keploy record -c "docker compose up" --container-name "flask-web" --buildDelay 50
+```
+
+🔥**Make some API calls**. Postman, Hoppscotch or even curl - take your pick!
+
+Let's make URLs short and sweet:
+
+### Generate testcases
+
+To generate testcases we just need to **make some API calls.**
+
+1. **Make a POST request:**
+
+```bash
+curl -X POST http://localhost:5000/books/ \
+-H "Content-Type: application/json" \
+-d '{"title": "1984", "author": "George Orwell"}'
+```
+
+2. **Make a GET request:**
+
+```bash
+curl -X GET "http://localhost:5000/books/?page=1&limit=10"
+```
+
+3. **Make a PUT request:**
+
+```bash
+curl -X PUT http://localhost:5000/books/1 \
+-H "Content-Type: application/json" \
+-d '{"title": "1984 - Updated", "author": "George Orwell"}'
+```
+
+4. **Make a DELETE request:**
+
+```bash
+curl -X DELETE http://localhost:5000/books/1
+```
+And once you are done, you can stop the recording and 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 `tests` directory and `mocks.yml`.
+
+```yaml
+version: api.keploy.io/v1beta1
+kind: Redis
+name: mock-0
+spec:
+ metadata:
+ type: config
+ redisrequests:
+ - origin: client
+ message:
+ - type: string
+ data: "*4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$8\r\nredis-py\r\n"
+ redisresponses:
+ - origin: server
+ message:
+ - type: string
+ data: "+OK\r\n"
+ reqtimestampmock: 2024-08-02T22:15:10.6084523Z
+ restimestampmock: 2024-08-02T22:15:10.608930466Z
+---
+```
+
+### **Time to run the testcases**
+
+```bash
+keploy test -c 'sudo docker compose up' --containerName "flask-web" --delay 10
+```
+You can also check the test summary from your cli
+
+```bash
+<=========================================>
+ COMPLETE TESTRUN SUMMARY.
+ Total tests: 11
+ Total test passed: 10
+ Total test failed: 1
+ Total time taken: "15.13 s"
+
+ Test Suite Name Total Test Passed Failed Time Taken
+
+ "test-set-0" 6 6 0 "5.06 s"
+ "test-set-1" 1 1 0 "5.02 s"
+ "test-set-2" 4 3 1 "5.04 s"
+<=========================================>
+```
+
+## Some errors you may run into ?
+
+1. While running the application you might have some ports up and running that you are trying to access again. This would throw a EBPF error
+
+You can check the ports from the below command and
+
+```bash
+sudo lsof -p
+```
+
+If you want to check which process is using a specific port (e.g., port 5000), use:
+
+```bash
+sudo lsof -i :5000
+```
+
+Once you have identified the PID of the process using the port you need, you can terminate the process with the kill command:
+
+```bash
+sudo kill -9
+```
+
+2. ERROR: for redis 'ContainerConfig'
+
+The KeyError: 'ContainerConfig' issue you're encountering with Docker Compose is indicative of a problem with the Docker Compose file or its version compatibility.
+
+Here’s how you can address and troubleshoot this error:
+
+```bash
+sudo apt-get update
+sudo apt-get install docker-compose
+```
+
+Check your compose file's permissions
+
+```bash
+ls -l docker-compose.yml
+```
+
+Re-run the record or test command from above
+
+
diff --git a/versioned_docs/version-2.0.0/quickstart/java-spring-postgres.md b/versioned_docs/version-2.0.0/quickstart/java-spring-postgres.md
index 433ddc510..4a1f393d3 100644
--- a/versioned_docs/version-2.0.0/quickstart/java-spring-postgres.md
+++ b/versioned_docs/version-2.0.0/quickstart/java-spring-postgres.md
@@ -106,6 +106,8 @@ docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES
keploy record -c "java -jar target/spring-petclinic-rest-3.0.2.jar"
```
+
+
Now you can start interacting with the UI and Keploy will automatically create the testcases and mocks for it in a folder named 'keploy'.
## Running the testcases using Keploy
@@ -130,12 +132,20 @@ Here we just need to change the command used to start the application.
keploy record -c "docker compose up" --container-name javaApp --build-delay 100
```
+
+
+
## Running the testcases using Keploy
```bash
keploy test -c "docker compose up" --container-name javaApp --build-delay 50 --delay 20
```
+
+
+
+
+
Here `delay` is the time it takes for your application to get started, after which Keploy will start running the testcases. If your application takes longer than 10s to get started, you can change the `delay` accordingly.
`buildDelay` is the time that it takes for the image to get built. This is useful when you are building the docker image from your docker compose file itself.
@@ -143,4 +153,4 @@ Hope this helps you out, if you still have any questions, reach out to us .
import GetSupport from '../concepts/support.md'
-
+
\ No newline at end of file
diff --git a/versioned_docs/version-2.0.0/quickstart/sample-ts.md b/versioned_docs/version-2.0.0/quickstart/sample-ts.md
new file mode 100644
index 000000000..c30c7acba
--- /dev/null
+++ b/versioned_docs/version-2.0.0/quickstart/sample-ts.md
@@ -0,0 +1,282 @@
+---
+id: samples-typescript
+title: Typescript Sample Application
+sidebar_label: Typescript - Nhost
+description: The following sample app to test Keploy integration capabilities using Typescript and Nhost.
+tags:
+ - Typescript
+ - Nhost
+keyword:
+ - Typescript
+ - Nhost
+ - API Test generator
+ - Auto Testcase generation
+---
+
+## Introduction
+
+This is a sample app to test Keploy integration capabilities using Typescript and Nhost Let's get started without delaying any further! 🎢
+
+import InstallationGuide from '../concepts/installation.md'
+
+
+
+## Get Started! 🎬
+
+### Setup app
+
+Clone and install the necessary packages with the below command
+
+```bash
+git clone https://github.com/keploy/samples-typescript && cd samples-typescript/ts-nhost
+```
+
+```bash
+npm install
+```
+### Creating .env
+
+Create a .env file which should contain `HASURA_ADMIN_SECRET`and `GRAPHQL_ENDPOINT` (as mentioned in ts-nhost/sample.env)
+
+Steps on how to generate your HASURA_ADMIN_SECRET and GRAPHQL_ENDPOINT :
+
+1. Go to https://nhost.io/
+2. Sign Up/Sign In and create new project
+3. Go to Hasura Console and open Hasura (Make sure to save your secret key before going to the next step)
+4. Get the `x-hasura-admin-secret` and `GraphQL Endpoint` and name them as `HASURA_ADMIN_SECRET` and `GRAPHQL_ENDPOINT `respectively in .env
+
+## Running the Application 📥
+
+There are 2 ways you can run this sample application.
+
+- [Running Natively on Linux/WSL](#running-natively-on-linuxwsl)
+- [Running the app using Docker](#running-the-app-using-docker)
+
+
+## Running Natively on Linux/WSL
+
+ We're about to set up our sample application right on Linux, with a twist—our GraphQL backend will be powered by Hasura through Nhost. And to add a bit of flair, we’ll handle the database management with Nhost’s cloud-based service.
+
+Ready to dive in? Let’s make this setup as smooth as a breeze! 🌟
+
+### Start recording tests:
+
+```bash
+sudo -E env "PATH=$PATH" keploy record -c 'ts-node src/app.ts'
+```
+
+`sudo -E`: Runs the command with elevated privileges while preserving the user environment.
+
+`env "PATH=$PATH"`: Ensures that the current PATH environment variable is preserved and used.
+
+`keploy record`: Invokes Keploy in recording mode.
+
+`-c 'ts-node src/app.ts`': Specifies the command to start your application (in this case, using ts-node to execute the TypeScript application entry point).
+
+
+### Generating the test cases
+
+1. Create User
+
+```bash
+curl --request POST \
+ --url http://localhost:3000/users \
+ --header 'Host: localhost:3000' \
+ --header 'User-Agent: curl/8.6.0' \
+ --header 'Accept: */*' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "email": "a@gmail.com",
+ "password": "123456789",
+ "locale": "en",
+ "displayName": "A"
+ }'
+```
+
+2. Get User
+
+```bash
+ curl --request GET \
+ --url http://localhost:3000/users \
+ --header 'User-Agent: curl/8.6.0' \
+ --header 'Accept: */*' \
+ --header 'Content-Type: application/json' \
+ --header 'Host: localhost:3000'
+
+```
+
+3. Delete User
+
+```bash
+ curl --request DELETE \
+ --url http://localhost:3000/users/ \
+ --header 'Host: localhost:3000' \
+ --header 'User-Agent: curl/8.6.0' \
+ --header 'Accept: */*' \
+ --header 'Content-Type: application/json'
+```
+
+Voila we have captured our api calls!
+
+Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`.
+
+This is a sample of what your yaml file would look like
+
+```bash
+version: api.keploy.io/v1beta1
+kind: Http
+name: test-1
+spec:
+ metadata: {}
+ req:
+ method: POST
+ proto_major: 1
+ proto_minor: 1
+ url: http://localhost:3000/users
+ header:
+ Accept: '*/*'
+ Content-Length: "113"
+ Content-Type: application/json
+ Host: localhost:3000
+ User-Agent: curl/8.6.0
+ body: |-
+ {
+ "email": "arpit@gmail.com",
+ "password": "123456789",
+ "locale": "en",
+ "displayName": "Arpit"
+ }
+ timestamp: 2024-07-31T21:13:23.94427882Z
+ resp:
+ status_code: 200
+ header:
+ Access-Control-Allow-Origin: '*'
+ Connection: keep-alive
+ Content-Length: "142"
+ Content-Type: application/json; charset=utf-8
+ Date: Wed, 31 Jul 2024 21:13:24 GMT
+ Etag: W/"8e-qRQmCOp8z1PPQCp1OFSshzkDzmQ"
+ Keep-Alive: timeout=5
+ X-Powered-By: Express
+ body: '{"message":"Successfully created a user","user":{"id":"f14a7f34-c7c6-4c60-a81f-7ca895e08af0","displayName":"Arpit","email":"arpit@gmail.com"}}'
+ status_message: OK
+ proto_major: 0
+ proto_minor: 0
+ timestamp: 2024-07-31T21:13:27.09463946Z
+ objects: []
+ assertions:
+ noise:
+ header.Date: []
+ created: 1722460407
+curl: |-
+ curl --request POST \
+ --url http://localhost:3000/users \
+ --header 'Host: localhost:3000' \
+ --header 'User-Agent: curl/8.6.0' \
+ --header 'Accept: */*' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "email": "arpit@gmail.com",
+ "password": "123456789",
+ "locale": "en",
+ "displayName": "Arpit"
+ }'
+```
+
+### Running the test cases
+
+Now, let's put things to test and run the keploy in test mode again:-
+
+```bash
+sudo -E env "PATH=$PATH" keploy test -c 'ts-node src/app.ts' --delay 10
+```
+Voila!! Our test cases have passed 🌟
+
+You will be able to see the summary of your test cases run in your terminal!
+
+
+Now its time for you to experiment further with different API calls and tweak the responses accordingly!
+
+## Running the app using Docker
+
+We will be using Docker compose to run the application as well as GraphQL on Docker container.
+
+### Capture the testcases
+
+We will run the keploy in record mode with docker-compose to start our application:-
+
+```bash
+keploy record -c "sudo docker-compose up" --containerName "ts-nhost"
+```
+
+
+### Generate the testcases
+
+Let's generate the testcases.
+
+Make API Calls using Hoppscotch, Postman or cURL command. Keploy will capture those calls to generate test suites containing test cases and data mocks.
+
+1. Create User
+
+```bash
+curl --request POST \
+ --url http://localhost:3000/users \
+ --header 'Host: localhost:3000' \
+ --header 'User-Agent: curl/8.6.0' \
+ --header 'Accept: */*' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "email": "arpit@gmail.com",
+ "password": "123456789",
+ "locale": "en",
+ "displayName": "Arpit"
+ }'
+```
+
+2. Get User
+
+```bash
+ curl --request GET \
+ --url http://localhost:3000/users \
+ --header 'User-Agent: curl/8.6.0' \
+ --header 'Accept: */*' \
+ --header 'Content-Type: application/json' \
+ --header 'Host: localhost:3000'
+```
+
+3. Delete User
+```
+ curl --request DELETE \
+ --url http://localhost:3000/users/ \
+ --header 'Host: localhost:3000' \
+ --header 'User-Agent: curl/8.6.0' \
+ --header 'Accept: */*' \
+ --header 'Content-Type: application/json'
+```
+
+### Running the testcases
+
+Let's run our captured test cases
+
+```bash
+keploy test -c 'sudo docker-compose up' --containerName "ts-nhost" --delay 10
+```
+This is what your response should look like!
+
+
+
+
+
+## Wrapping it up 🎉
+
+🎉 **Congratulations on Reaching This Milestone!** 🎉
+
+You've successfully tested the tool and created your mocks and test cases—fantastic work! Now that you've laid a solid foundation, it's time to elevate your achievements even further.
+
+Here’s to building more, innovating, and reaching new heights with your project! 🚀
+
+Hope this helps you out, if you still have any questions, reach out to us .
+
+import GetSupport from '../concepts/support.md'
+
+
diff --git a/versioned_docs/version-2.0.0/quickstart/sanic-mongo.md b/versioned_docs/version-2.0.0/quickstart/sanic-mongo.md
new file mode 100644
index 000000000..db39b30e6
--- /dev/null
+++ b/versioned_docs/version-2.0.0/quickstart/sanic-mongo.md
@@ -0,0 +1,161 @@
+---
+id: sanic-mongo
+title: Sample Movie Management App (Sanic + Mongo)
+sidebar_label: Sanic + Mongo
+description: This application is a simple movie management API built using Python's Sanic framework and MongoDB for data storage. It allows you to perform basic CRUD (Create, Read, Update, Delete) operations on Movie records.
+
+tags:
+ - python
+ - quickstart
+ - samples
+ - examples
+ - tutorial
+ - python-framework
+ - sanic
+ - postgres
+ - sms
+ - Mongo
+keyword:
+ - FastAPI Framework
+ - MongoDB
+ - Sanic
+ - Python
+ - API Test generator
+ - Auto case generation
+---
+
+## Introduction
+
+This application is a simple movie management API built using Python's [Sanic framework](https://sanic.dev/en/) and [MongoDB](https://mongodb.com/) for data storage. It allows you to perform basic CRUD (Create, Read, Update, Delete) operations on Movie records.
+
+import InstallationGuide from '../concepts/installation.md'
+
+
+
+
+# Get Started! 🎬
+
+## Clone the app 🧪
+
+```bash
+git clone https://github.com/keploy/samples-python.git && cd samples-python/sanic-mongo
+```
+
+## Download the requirements.txt file and DB setup
+
+Head to the folder of the application and run
+```shell
+pip3 install -r requirements.txt
+```
+
+Open a different terminal and setup your MongoDB through docker
+```shell
+sudo docker network create keploy-network
+```
+
+```shell
+docker run -p 27017:27017 -d --rm --name mongoDB --net keploy-network mongo
+```
+
+## Lights, Camera, Record! 🎥
+
+Capture the test-cases-
+
+```shell
+keploy record -c "python3 server.py"
+```
+You should be able to see this in your terminal
+
+
+
+
+🔥**Make some API calls**. Postman, Hoppscotch or even curl - take your pick!
+
+Let's make URLs short and sweet:
+## Generate testcases
+
+To generate testcases we just need to **make some API calls.**
+
+1. **Make a POST request:**
+
+```bash
+ curl -X "POST" "http://127.0.0.1:8000/add_movie" \
+ -H 'Accept: application/json' \
+ -H 'Content-Type: application/json; charset=utf-8' \
+ -d '{
+ "name": "Whiplash"
+ }'
+```
+
+2. **Make a GET request:**
+
+```bash
+ curl -X "GET" "http://127.0.0.1:8000/movies" \
+ -H 'Accept: application/json' \
+ -H 'Content-Type: application/json; charset=utf-8'
+```
+
+3. **Make a DELETE request:**
+
+```bash
+ curl -X "DELETE" "http://127.0.0.1:8000/movies" \
+ -H 'Accept: application/json' \
+ -H 'Content-Type: application/json; charset=utf-8'
+
+```
+
+And once you are done, you can stop the recording and 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 `tests` directory and `mocks.yml`.
+
+This is an example of what your mocks would look like
+
+```yaml
+version: api.keploy.io/v1beta1
+kind: Mongo
+name: mock-0
+spec:
+ metadata:
+ operation: '{ OpQuery flags: [], fullCollectionName: admin.$cmd, numberToSkip: 0, numberToReturn: -1, query: {"ismaster": {"$numberInt":"1"},"helloOk": true,"client": {"driver": {"name": "PyMongo|Motor","version": "4.6.3|3.4.0"},"os": {"type": "Linux","name": "Linux","architecture": "x86_64","version": "5.15.146.1-microsoft-standard-WSL2"},"platform": "CPython 3.10.12.final.0|asyncio"}}, returnFieldsSelector: }'
+ type: config
+ requests:
+ - header:
+ length: 303
+ requestId: 1804289383
+ responseTo: 0
+ Opcode: 2004
+ message:
+ flags: 0
+ collection_name: admin.$cmd
+ number_to_skip: 0
+ number_to_return: -1
+ query: '{"ismaster":{"$numberInt":"1"},"helloOk":true,"client":{"driver":{"name":"PyMongo|Motor","version":"4.6.3|3.4.0"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"5.15.146.1-microsoft-standard-WSL2"},"platform":"CPython 3.10.12.final.0|asyncio"}}'
+ return_fields_selector: ""
+ responses:
+ - header:
+ length: 329
+ requestId: 13
+ responseTo: 1804289383
+ Opcode: 1
+ message:
+ response_flags: 8
+ cursor_id: 0
+ starting_from: 0
+ number_returned: 1
+ documents:
+ - '{"helloOk":true,"ismaster":true,"topologyVersion":{"processId":{"$oid":"667b1d2066b0c1d16885b016"},"counter":{"$numberLong":"0"}},"maxBsonObjectSize":{"$numberInt":"16777216"},"maxMessageSizeBytes":{"$numberInt":"48000000"},"maxWriteBatchSize":{"$numberInt":"100000"},"localTime":{"$date":{"$numberLong":"1719344783026"}},"logicalSessionTimeoutMinutes":{"$numberInt":"30"},"connectionId":{"$numberInt":"4"},"minWireVersion":{"$numberInt":"0"},"maxWireVersion":{"$numberInt":"21"},"readOnly":false,"ok":{"$numberDouble":"1.0"}}'
+ read_delay: 560917
+ created: 1719344783
+ reqTimestampMock: 2024-06-26T01:16:23.025984506+05:30
+ resTimestampMock: 2024-06-26T01:16:23.026710262+05:30
+```
+
+## **Time to put things to the test 🧪:**
+
+```bash
+ keploy test -c "python server.py"
+```
+This is how your terminal would look like :
+
+
+
+
+You can experiment with different API calls, modify the database response in mocks.yml, or adjust the request or response in test-x.yml. Then, run the tests again to see the change in response
diff --git a/versioned_docs/version-2.0.0/server/sdk-installation/go.md b/versioned_docs/version-2.0.0/server/sdk-installation/go.md
index 740f49df3..39f332bb1 100644
--- a/versioned_docs/version-2.0.0/server/sdk-installation/go.md
+++ b/versioned_docs/version-2.0.0/server/sdk-installation/go.md
@@ -26,7 +26,7 @@ import WhatAreKeployFeatures from './index.md'
| Programming Language | Prerequisites |
| :------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| go | 1. The application should have a graceful shutdown to stop the API server on `SIGTERM` or `SIGINT` signals. Refer [appendix](#appendix) for basic implementation of graceful shutdown function.
2. The go binary should be built with `-cover` flag. |
+| go | 1. The application should have a graceful shutdown to stop the API server on `SIGTERM` or `SIGINT` signals. Refer [appendix](#graceful-shutdown) for basic implementation of graceful shutdown function.
2. The go binary should be built with `-cover` flag. |
## Graceful Shutdown
diff --git a/versioned_sidebars/version-2.0.0-sidebars.json b/versioned_sidebars/version-2.0.0-sidebars.json
index 697727516..c3dc4c89a 100644
--- a/versioned_sidebars/version-2.0.0-sidebars.json
+++ b/versioned_sidebars/version-2.0.0-sidebars.json
@@ -90,8 +90,7 @@
"quickstart/samples-django",
"quickstart/samples-flask",
"quickstart/samples-fastapi",
- "quickstart/samples-fastapi-twilio"
- ]
+ "quickstart/samples-fastapi-twilio" ]
},
{
"type": "category",