Skip to content

Commit d3a4406

Browse files
authored
Update README.md
Signed-off-by: Pranav Metil <76805382+Pranav5255@users.noreply.github.com>
1 parent a36d7c9 commit d3a4406

1 file changed

Lines changed: 72 additions & 1 deletion

File tree

crud-app-mongodb/README.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
# samples-mongodb
1+
# CRUD app using MongoDB
2+
3+
This repository contains a sample .NET 7 Web API that uses MongoDB for CRUD operations and integrates with [Keploy](https://keploy.io) to auto-generate and run test cases by recording real API traffic.
4+
5+
---
6+
7+
## 📦 Tech Stack
8+
9+
- [.NET 8 Web API](https://dotnet.microsoft.com/)
10+
- [MongoDB](https://www.mongodb.com/)
11+
- [Keploy](https://keploy.io) – API testing and mocking tool
12+
13+
---
14+
15+
## 🚀 Getting Started
16+
17+
### 1. Clone the Repository
18+
19+
``` bash
20+
git clone https://github.com/Pranav5255/samples-mongodb.git
21+
cd samples-mongodb
22+
```
23+
24+
### 2. Configure MongoDB
25+
Update `appsettings.json` with your MongoDB connection string:
26+
27+
``` json
28+
{
29+
"ConnectionString": "mongodb://localhost:27017",
30+
"DatabaseName": "UserDb",
31+
"UsersCollectionName": "Users"
32+
}
33+
```
34+
### 3. Run the .NET App
35+
``` bash
36+
dotnet run
37+
```
38+
39+
App runs by default at:
40+
``` arduino
41+
http://localhost:5067
42+
```
43+
44+
You can test endpoints like:
45+
``` http
46+
GET /users
47+
POST /users
48+
GET /users/{id}
49+
```
50+
51+
## 🐾 Generate Test Cases with Keploy
52+
### 1. Download Keploy
53+
``` powershell
54+
curl -O -L https://keploy.io/install.sh && source install.sh
55+
```
56+
57+
### 2. Record API Calls
58+
``` bash
59+
keploy.exe record --proxy-port 8080 --app-port 5067 --path ./keploy-tests
60+
```
61+
62+
Now send traffic to:
63+
``` bash
64+
http://localhost:8080/users
65+
```
66+
Use Postman, Swagger or cURL to generate traffic.
67+
68+
### 3. Replay Tests
69+
After Recording:
70+
``` bash
71+
keploy.exe test --path ./keploy-tests
72+
```

0 commit comments

Comments
 (0)