From 0a3510be04e6b6d0b39b49c094c75c72c4d8772e Mon Sep 17 00:00:00 2001 From: Sumith Kumar Saini <140690202+Sumith-Kumar-Saini@users.noreply.github.com> Date: Mon, 16 Jun 2025 20:39:18 +0530 Subject: [PATCH 1/2] docs: Create CONTRIBUTING.md This helps new contributors get started --- CONTRIBUTING.md | 107 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0292520 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,107 @@ +# Contributing to TestDog + +Thanks for checking out TestDog! This guide will help you get set up and ready to contribute effectively. + +--- + +## 🔧 Tech Stack + +* **Node.js (ESM)** + **Express v5** +* **Passport** with Google OAuth 2.0 +* **MongoDB** (via Mongoose) +* **Redis** (via ioredis) +* **Security**: Helmet, rate limiting, JWT +* **Testing**: Jest + Supertest + in-memory mocks +* **Linting/Formatting**: ESLint + Prettier + Husky + +--- + +## 📁 Project Structure (quick overview) + +``` +src/ +├── app.js → Express setup +├── config/ → Passport, Redis config +├── controllers/ → Auth & user logic +├── middlewares/ → Custom logic (auth, rate-limit, etc.) +├── routes/ → /auth, /users API routes +server.js → App entry point +Dockerfile → Production build config +.husky/ → Git hooks +.github/workflows/ → CI/CD +``` + +--- + +## 🚀 Getting Started + +### 1. Clone & Install + +```bash +git clone https://github.com/Ankur77720/testdog.git +cd testdog +npm install +``` + +### 2. Environment Setup + +Copy `.env.example` → `.env` and fill in: + +* `MONGO_URI`, `REDIS_URL`, `JWT_SECRET` +* `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` +* `PORT`, etc. + +### 3. Run the Server + +```bash +npm run dev +``` + +--- + +## ✅ Scripts You’ll Use + +| Script | Purpose | +| ---------------- | ------------------------------ | +| `npm run dev` | Run dev server (nodemon + ESM) | +| `npm test` | Run tests (Jest + mocks) | +| `npm run lint` | Check linting rules | +| `npm run format` | Format files via Prettier | + +--- + +## 🧪 Testing Notes + +* Uses in-memory Mongo & Redis for fast, isolated tests. +* No need for local DBs while testing—just run `npm test`. + +--- + +## 📦 Git & Contribution Flow + +1. **Create a branch** for your feature or fix. +2. Code changes go in `src/`. +3. Run `npm run lint`, `format`, and `test` before committing. +4. Husky runs pre-commit checks automatically. +5. Push and open a PR—GitHub Actions will validate your changes. + +--- + +## 🐳 Docker Notes + +* The `Dockerfile` is for **production**. +* For local dev, use `npm run dev` and connect to local or Docker Mongo/Redis. +* No `docker-compose.yml` yet, but it's easy to add if needed. + +--- + +## 💡 Tips for New Contributors + +* Start with small issues—validation, middlewares, route cleanup. +* Check `passport.js` to understand how Google login is set up. +* Explore Redis config if working on rate-limiting or caching. + +--- + +Feel free to open issues, suggest improvements, or ask questions on PRs. +We appreciate every contribution—big or small. From 0e6c3697440eeeeb9ad92de6c472aefa0528be9f Mon Sep 17 00:00:00 2001 From: Sumith Kumar Saini Date: Mon, 16 Jun 2025 20:45:04 +0530 Subject: [PATCH 2/2] docs(readme): improve contributor guidance and setup steps (#1) --- CONTRIBUTING.md | 107 ----------------------------------------------- readme.md | 109 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 98 insertions(+), 118 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 0292520..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,107 +0,0 @@ -# Contributing to TestDog - -Thanks for checking out TestDog! This guide will help you get set up and ready to contribute effectively. - ---- - -## 🔧 Tech Stack - -* **Node.js (ESM)** + **Express v5** -* **Passport** with Google OAuth 2.0 -* **MongoDB** (via Mongoose) -* **Redis** (via ioredis) -* **Security**: Helmet, rate limiting, JWT -* **Testing**: Jest + Supertest + in-memory mocks -* **Linting/Formatting**: ESLint + Prettier + Husky - ---- - -## 📁 Project Structure (quick overview) - -``` -src/ -├── app.js → Express setup -├── config/ → Passport, Redis config -├── controllers/ → Auth & user logic -├── middlewares/ → Custom logic (auth, rate-limit, etc.) -├── routes/ → /auth, /users API routes -server.js → App entry point -Dockerfile → Production build config -.husky/ → Git hooks -.github/workflows/ → CI/CD -``` - ---- - -## 🚀 Getting Started - -### 1. Clone & Install - -```bash -git clone https://github.com/Ankur77720/testdog.git -cd testdog -npm install -``` - -### 2. Environment Setup - -Copy `.env.example` → `.env` and fill in: - -* `MONGO_URI`, `REDIS_URL`, `JWT_SECRET` -* `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` -* `PORT`, etc. - -### 3. Run the Server - -```bash -npm run dev -``` - ---- - -## ✅ Scripts You’ll Use - -| Script | Purpose | -| ---------------- | ------------------------------ | -| `npm run dev` | Run dev server (nodemon + ESM) | -| `npm test` | Run tests (Jest + mocks) | -| `npm run lint` | Check linting rules | -| `npm run format` | Format files via Prettier | - ---- - -## 🧪 Testing Notes - -* Uses in-memory Mongo & Redis for fast, isolated tests. -* No need for local DBs while testing—just run `npm test`. - ---- - -## 📦 Git & Contribution Flow - -1. **Create a branch** for your feature or fix. -2. Code changes go in `src/`. -3. Run `npm run lint`, `format`, and `test` before committing. -4. Husky runs pre-commit checks automatically. -5. Push and open a PR—GitHub Actions will validate your changes. - ---- - -## 🐳 Docker Notes - -* The `Dockerfile` is for **production**. -* For local dev, use `npm run dev` and connect to local or Docker Mongo/Redis. -* No `docker-compose.yml` yet, but it's easy to add if needed. - ---- - -## 💡 Tips for New Contributors - -* Start with small issues—validation, middlewares, route cleanup. -* Check `passport.js` to understand how Google login is set up. -* Explore Redis config if working on rate-limiting or caching. - ---- - -Feel free to open issues, suggest improvements, or ask questions on PRs. -We appreciate every contribution—big or small. diff --git a/readme.md b/readme.md index 1ba0a5e..66063df 100644 --- a/readme.md +++ b/readme.md @@ -1,22 +1,22 @@ # Testdog API Server -Testdog is an open-source, community-powered API server offering a growing collection of free-to-use APIs for your projects. Whether you're building a side project, a portfolio piece, or an MVP feel free to plug in and go! +Testdog is an open-source, community-powered API server offering a growing collection of free-to-use APIs for your projects. Whether you're building a side project, a portfolio piece, or an MVP — feel free to plug in and go! --- -## Use These APIs in Your Projects +## 🚀 Use These APIs in Your Projects All APIs provided by Testdog are **completely free**. You can integrate them into your personal or commercial projects without any restrictions. -- No API keys required -- No rate limiting (unless explicitly mentioned) +- No API keys required +- No rate limiting (unless explicitly mentioned) - Easy to explore and consume > ✨ Want a specific API? Raise a request or contribute by adding one yourself! --- -## Open for Contributions +## 🤝 Open for Contributions Testdog is **open-source**, and we're always looking for contributors! @@ -27,23 +27,110 @@ Testdog is **open-source**, and we're always looking for contributors! 3. Add your API or improve existing ones 4. Raise a Pull Request (PR) -If your PR aligns with our development direction and passes checks we’ll merge it. Simple as that. +If your PR aligns with our development direction and passes checks, we’ll merge it. Simple as that. > Please make sure to follow best practices and write clean, modular code. --- -## Found a Bug or Issue? +## 🛠 Dev Setup & Contribution Guide + +### Tech Stack +- Node.js (ESM) + Express v5 +- MongoDB (Mongoose), Redis (ioredis) +- Passport (Google OAuth 2.0), JWT +- Testing: Jest + Supertest +- Linting & Formatting: ESLint + Prettier + Husky + +### Folder Structure +``` +src/ +├── app.js → Express setup +├── config/ → Passport, Redis config +├── controllers/ → Auth & user logic +├── middlewares/ → Custom logic (auth, rate-limit, etc.) +├── routes/ → /auth, /users API routes +server.js → App entry point +Dockerfile → Production build config +.husky/ → Git hooks +.github/workflows/ → CI/CD + +```` + +### ⚙️ Getting Started + +#### 1. Install dependencies +```bash +git clone https://github.com/Ankur77720/testdog.git +cd testdog +npm install +```` + +#### 2. Setup Environment Variables + +Configure `.env` with: + +* `MONGO_URI`, `REDIS_URL` +* `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` +* `JWT_SECRET`, `PORT`, etc. + +#### 3. Start the Dev Server + +```bash +npm run dev +``` + +### Available Scripts + +| Script | Purpose | +| ---------------- | ------------------------------ | +| `npm run dev` | Run dev server (nodemon + ESM) | +| `npm test` | Run tests (Jest + mocks) | +| `npm run lint` | Check linting rules | +| `npm run format` | Format files via Prettier | + +### Pre-Commit Workflow + +* Git hooks are configured using **Husky** +* On every commit: + + * Lint & format checks run automatically + * Tests are expected to pass locally and in CI + +### Docker Notes + +* The included `Dockerfile` is for **production builds**. +* For local development, use `npm run dev` and connect to local or containerized Mongo/Redis. +* No `docker-compose.yml` yet, but it’s easy to add if needed. + +--- + +## 🧪 Testing + +Run all tests with: + +```bash +npm test +``` + +* Uses **in-memory MongoDB and Redis mocks** — no need for local services during tests. +* Fast and isolated test environment using `mongodb-memory-server` and `ioredis-mock`. + +--- + +## 🐛 Found a Bug or Issue? If you encounter any problems or have suggestions: -- [Open an issue](https://github.com/yourusername/testdog/issues) describing the problem. -- Be as detailed as possible so contributors can replicate and resolve it. +* [Open an issue](https://github.com/Ankur77720/testdog/issues) describing the problem. +* Be as detailed as possible so contributors can replicate and resolve it. --- -## Note +## 💡 Final Note -Testdog is powered entirely by its contributors. The addition of any new API depends on community support and availability. So if something’s missing feel free to build it! +Testdog is powered entirely by its contributors. The addition of any new API depends on community support and availability. So if something’s missing — feel free to build it! --- + +Happy hacking! ✨ \ No newline at end of file