Arslon ErkinovToday I closed Day 17 — Part 1 of my AI Phishing Defense Platform. The system was “working”… but...
Today I closed Day 17 — Part 1 of my AI Phishing Defense Platform.
The system was “working”… but architecturally wrong.
The Problem
Audit logs were storing API keys as plain strings.
That breaks:
It looked like this:
api_key = models.CharField(max_length=64)
That’s not production-grade.
The Refactor
I replaced it with:
api_key = models.ForeignKey(
APIKey,
null=True,
blank=True,
on_delete=models.SET_NULL,
)
This allowed:
What Broke
What Was Fixed
• Correct FK assignment
• Refactored log_audit_event
• Unified rate limit logic
• Clean APIUsage logging
• Plan-aware audit entries
Now the system tracks:
Lesson
Day 17 is about backend maturity.
Tomorrow: analytics expansion layer.