This phase involved learning about databases, understanding SQL basics, and implementing a robust data storage solution for the NGO's feeding statistics.

Understanding Databases

Coming from an Excel background, I found databases to be like supercharged spreadsheets for websites. They maintain the familiar structure of rows and columns but add powerful features for online access, real-time updates, and data relationships.

Supabase Database Interface showing homeless statistics

The Supabase database interface showing our HomelessStats table with weekly feeding statistics.

SQL: The Database Language

SQL (Structured Query Language) serves as the communication bridge with our database. It allows us to:

  • Query weekly feeding totals
  • Add new feeding records
  • Update existing data
  • Analyze historical trends

Prisma: The Connector

Prisma acts as a translator between our TypeScript code and the database, allowing us to:

  • Write database queries in TypeScript
  • Ensure type safety
  • Manage database schema
  • Handle data migrations

Why Supabase?

Key Benefits

  • Cloud-based hosting
  • Real-time data updates
  • Built-in authentication
  • Excellent documentation
  • Prisma integration
  • User-friendly interface
  • Generous free tier
  • Modern development features

Database Structure

Our database is designed with simplicity and efficiency in mind:

  • HomelessStats table for weekly feeding records
  • Timestamp-based tracking for historical analysis
  • Integer fields for people count
  • Automated backup and recovery options