惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
有赞技术团队
有赞技术团队
博客园 - 司徒正美
量子位
N
News and Events Feed by Topic
T
Threatpost
Last Week in AI
Last Week in AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
酷 壳 – CoolShell
酷 壳 – CoolShell
C
CERT Recently Published Vulnerability Notes
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
Intezer
人人都是产品经理
人人都是产品经理
T
Tenable Blog
IT之家
IT之家
雷峰网
雷峰网
腾讯CDC
博客园 - 聂微东
V
Visual Studio Blog
S
SegmentFault 最新的问题
Scott Helme
Scott Helme
Spread Privacy
Spread Privacy
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
N
Netflix TechBlog - Medium
J
Java Code Geeks
宝玉的分享
宝玉的分享
F
Full Disclosure
WordPress大学
WordPress大学
A
Arctic Wolf
小众软件
小众软件
AWS News Blog
AWS News Blog
Attack and Defense Labs
Attack and Defense Labs
NISL@THU
NISL@THU
AI
AI
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
N
News | PayPal Newsroom
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Day 88 of #100DaysOfCode — DevCollab: Data Models and Database Schema
M Saad Ahmad · 2026-05-01 · via DEV Community

Yesterday, the authentication foundation was laid; custom user model, JWT endpoints, everything tested in Postman. Today was about completing the entire database layer before writing a single API view. Models, relationships, constraints, migrations, admin registration, and seeded test data. By the end of today, the database will be fully shaped and ready for the API to be built on top of it tomorrow.


The Reason Behind Finishing Models First

It's tempting to build features incrementally: write a model, write its serializer, write its views, wire up its URLs, then move to the next model. That approach feels productive because you get working endpoints faster. But it has a hidden cost: every time you go back and change a model to support a new feature, you run another migration, potentially break existing serializers, and create technical debt in the API layer.

Finishing all models in one dedicated day means the database schema is stable before any API code is written. Serializers and views built on a finalized schema don't need to change because of a model tweak. The investment of one clean model day pays off across every API day that follows.


The Profile Model

Yesterday's Profile model was intentionally minimal, just enough fields to support the auth flow. Today, I reviewed it with fresh eyes now that the full picture is clear. The skills field stores a comma-separated string rather than a separate Skills table. This is a deliberate simplification. A join table for skills would be more normalized, but it adds a migration, a serializer, and API complexity for something that doesn't need it at this scale. The get_skills_list() helper method handles the string-to-list conversion wherever it's needed.


The Project Model

The Project model is the heart of DevCollab. A project belongs to one owner, has all the descriptive fields a developer needs to explain what they're building, and two control fields: status and is_open, that give the owner control over how the project appears to the outside world.

status has three choices: active, completed, and on_hold. This lets owners mark a project as finished without deleting it, preserving the collaboration history.

is_open is a simple boolean; true means the project is accepting collaboration requests, false means it isn't. When is_open is false, the project still appears in search results, but the request button on the frontend is replaced with a "Not accepting requests" label. Owners can toggle this without changing the project's status.

tech_stack and roles_needed are both comma-separated text fields with corresponding helper methods that return them as lists. This pattern is consistent with how skills are stored on Profile: simple, no extra tables, easy to work with in serializers and templates.

The model's Meta class sets default ordering to newest first and defines a __str__ that shows both the project title and the owner's username, useful in the admin panel when reviewing data.


The CollaborationRequest Model

CollaborationRequest is the most relationship-heavy model in the project. It links a requester (a User) to a Project, carries the message the requester wrote, and tracks the status of the request.

The status field has three choices: pending, reviewed, and accepted. The status field has three: pending, accepted, and rejected. Default is pending when a request is first created.

The most important constraint is unique_together on the project and requester fields. This is enforced at the database level, not just in form validation or view logic, which means it's impossible to create two requests from the same user for the same project, regardless of how the API is called. This constraint prevents a whole class of bugs before they can happen.

The on_delete behavior on both ForeignKeys deserves deliberate thought. If a User is deleted, their sent requests should be deleted too; CASCADE makes sense. If a Project is deleted, all its collaboration requests should go with it, CASCADE again. Both ForeignKeys use CASCADE.

related_name values are set carefully so that accessing relationships from the other side is readable: project.requests.all() gives all requests for a project, user.sent_requests.all() gives all requests sent by a user.


Migrations

Four tables total after today's migrations: the custom User table, Profile, Project, and CollaborationRequest. The migrations for accounts already ran yesterday. Today's migration covers the two new models in the projects app.

Running showmigrations after applying them confirms all migrations are applied cleanly with no pending changes. This is a habit worth forming: checking migration state before calling a day done means you never start the next day debugging a missing column.


Admin Registration

The admin panel is the most underrated tool in Django. For a project in active development, it's invaluable; it lets you inspect data, create test records, and verify relationships without writing any API clients or fixtures.

Both apps get thorough admin registration today.

For the accounts app, User registration extends Django's built-in UserAdmin rather than the plain ModelAdmin. This matters because the custom User model changed the login field to email; using plain ModelAdmin breaks the admin's built-in user management forms. Extending UserAdmin keeps all the password management, permissions, and group management interfaces working correctly. Profile is registered separately with an inline display of the user's username.

For the projects app, Project gets list_display showing title, owner, status, is_open flag, and created date. list_filter on status and is_open makes it easy to find active open projects during testing. search_fields on title and description supports quick lookup.

CollaborationRequest gets list_display showing the requester, the project, the status, and the created date. list_filter on status is particularly useful here; during testing, you'll want to quickly find all pending requests to accept or reject them.


Seeding Test Data

Writing an API without test data is frustrating; every endpoint returns empty lists, and edge cases are invisible. Today I seeded the database through the admin panel with enough data to make tomorrow's API work feel real.

Two employer-style users with filled-in profiles. Three projects, two active and open, one on hold. Two collaboration requests on the first project, one pending and one accepted. One request on the second project is pending.

This gives the API endpoints something to return, gives the filtering and search endpoints something to filter, and gives the permission checks something to enforce. A request from user A on user B's project, so ownership checks can be verified.


What the Database Looks Like Now

Four tables, all related:

The User table drives everything. Every Profile, Project, and CollaborationRequest traces back to a User. Delete a User and the cascade removes their Profile, their Projects, and all requests they've sent or received on their projects.

The project sits in the middle, owned by a User, receiving CollaborationRequests from other Users.

CollaborationRequest is the bridge, linking two Users indirectly through a Project, with a status that both sides can read and the owner can change.


Where Things Stand After Day 88

The entire database schema is finalized. Every model is defined, every migration is applied, every relationship is set up correctly, and the admin panel shows real seeded data. There are no pending model changes, no uncertain field types, and no relationships still being figured out.

Thanks for reading. Feel free to share your thoughts!