Learn-skills.dev supabase-backend
Expert in Supabase architecture, SQL optimization (PostgreSQL), and backend security (RLS) for real-time tracking systems.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/abelv22/project-foundation/supabase-backend" ~/.claude/skills/neversight-learn-skills-dev-supabase-backend && rm -rf "$T"
manifest:
data/skills-md/abelv22/project-foundation/supabase-backend/SKILL.mdsource content
Supabase & Backend Architecture Skill
This skill enables the assistant to provide high-level architectural advice and implementation details for the iTaxiBcn backend.
Knowledge Areas
1. Database Schema Optimization
- Time-Series Data: Guidelines for handling high-frequency location updates in
andregistros_reten
.geofence_logs - Indexing: Strategies for spatial indices (PostGIS) and temporal queries to speed up wait-time calculations.
- Materialized Views: Recommendation for replacing heavy queries on
with materialized views for zone aggregations.registros_reten
2. Row Level Security (RLS)
- Device-Based Access: Ensuring
based security since the app currently uses device identifiers instead of full user auth (until Phase 2).device_id - Audit Logs: Best practices for
andgeofence_logs
security.location_debug_logs
3. Edge Functions (Deno/TypeScript)
- Geofencing Logic: Optimization of the Ray-casting algorithm in
.check-geofence - Performance: Minimizing startup time and memory footprint of edge functions.
- Error Handling: Robust try-catch patterns and standard JSON responses.
4. SQL Scripting
- Migrations: Following the
structure.supabase/migrations/ - Stored Procedures: Writing efficient PL/pgSQL for complex logic like
score calculation on the server side.useWhereNext
Guidelines for Responses
- Always suggest Materialized Views for dashboard metrics that don't need second-by-second accuracy.
- When writing SQL, ensure idempotency (use
orCREATE OR REPLACE
).IF NOT EXISTS - Prioritize PostGIS functions for distance and polygon math.