Skip to content

Commit ad98dd2

Browse files
committed
updated readme file
1 parent 897738e commit ad98dd2

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
---
3333

34-
## ✨ Features
34+
## <a id="features"></a>✨ Features
3535

3636
### Core Functionality
3737
- 🔐 **API Key Authentication** - Secure SHA-256 hashed API keys
@@ -52,7 +52,7 @@
5252

5353
---
5454

55-
## 🛠️ Tech Stack
55+
## <a id="tech-stack"></a>🛠️ Tech Stack
5656

5757
| Technology | Purpose | Why? |
5858
|------------|---------|------|
@@ -66,7 +66,7 @@
6666
| **Zod** | Validation | Type-safe schema validation |
6767

6868

69-
## 🚀 Getting Started
69+
## <a id="getting-started"></a>🚀 Getting Started
7070
### Prerequisites
7171

7272
- Node.js 20+
@@ -129,7 +129,7 @@ curl http://localhost:3000/api/v1/auth/me \
129129

130130
---
131131

132-
## 📁 Project Structure
132+
## <a id="project-structure"></a>📁 Project Structure
133133
```
134134
developer-metrics-api/
135135
├── src/
@@ -198,7 +198,22 @@ developer-metrics-api/
198198

199199
---
200200

201-
## ⚡ Performance
201+
## <a id="key-design-decisions"></a>🎯 Key Design Decisions
202+
203+
### 1. API Key Security
204+
API keys are never stored in plain text. We store only the SHA-256 hash of the key, ensuring that even if the database is compromised, the actual keys remain secure.
205+
206+
### 2. Rate Limiting Strategy
207+
We implement a **Sliding Window Log** algorithm using Redis Sorted Sets. This provides precise rate limiting without the "burst" issues found in Fixed Window counters.
208+
209+
### 3. Multi-layer Caching
210+
- **Browser/CDN**: Controlled via Cache-Control headers.
211+
- **Application Logic**: Redis stores frequently accessed repository metadata.
212+
- **Database**: Optimized indexes for high-speed retrieval.
213+
214+
---
215+
216+
## <a id="performance"></a>⚡ Performance
202217

203218
### Benchmarks
204219

@@ -227,7 +242,7 @@ developer-metrics-api/
227242

228243
---
229244

230-
## 🧪 Testing
245+
## <a id="testing"></a>🧪 Testing
231246

232247
### Run Tests
233248
```bash
@@ -259,7 +274,7 @@ time curl http://localhost:3000/api/v1/repositories/ID/metrics/summary \
259274

260275
---
261276

262-
## ⚙️ CI/CD Pipeline
277+
## <a id="cicd-pipeline"></a>⚙️ CI/CD Pipeline
263278

264279
The project uses GitHub Actions for continuous integration and automated quality checks.
265280

@@ -274,7 +289,7 @@ Current Build Status: [![CI/CD Pipeline](https://github.com/ajilkumar/Rate-Limit
274289

275290
---
276291

277-
## 🚢 Deployment
292+
## <a id="deployment"></a>🚢 Deployment
278293

279294
### Production Checklist
280295

@@ -310,7 +325,7 @@ docker run -p 3000:3000 --env-file .env devmetrics-api
310325

311326
---
312327

313-
## 🤝 Contributing
328+
## <a id="contributing"></a>🤝 Contributing
314329

315330
Contributions welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
316331

@@ -322,7 +337,7 @@ Contributions welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
322337

323338
---
324339

325-
## 📄 License
340+
## <a id="license"></a>📄 License
326341

327342
This project is licensed under the MIT License - see [LICENSE](LICENSE) file.
328343

0 commit comments

Comments
 (0)