After getting comfortable with Supabase and building my first expense tracker, I started hearing this word everywhere - API.
At first, it sounded like something only advanced developers used.
But the more I explored, the more I realized something simple yet powerful
So, What Exactly Is an API?
The full form of API is Application Programming Interface
Here’s how I understand it in simple terms:
Imagine your app as a restaurant.
The kitchen is your database (where the real work happens).
The waiter is the API.
The customer is your frontend app (or the user interface).
The customer never goes into the kitchen,they just tell the waiter what they want.
The waiter carries that message to the kitchen, brings back the right food, and delivers it neatly.
That’s exactly what an API does,it carries requests and responses between your app and the backend
Why Do We Need APIs?
When I built my first version of the expense tracker, my Python app was directly talking to Supabase.
It worked fine… but I started noticing a few small yet annoying problems:
🧠 My code was getting messy : everything (login, database logic, calculations) was inside one big Python file.
🔒 Security felt uncertain: anyone who saw my code could technically find my database keys.
That’s when I realized:
The API handles all the data requests and rules.
The frontend only asks for information and displays it.
⚙️ How It Actually Works
The app sends a request,like “Get all expenses for user 1.”
The API connects to the database.
The database sends back the data.
The API formats it (usually as JSON) and returns it to your app.
Why I Chose FastAPI
Fast and simple : I could create an API in just a few lines.
Automatic docs : it built a /docs page where I could test my API instantly.
Safe by design : it handled input validation automatically.
Easy to connect — it worked beautifully with my Supabase backend.
✨ What I Learned
APIs are bridges between your frontend and backend.
FastAPI makes building and testing them simple and fun.
Separating backend logic with APIs makes your project more professional and scalable.
💬 Over to You
If you’ve ever had small problems that led you to discover something big
like APIs,I’d love to hear your story.
What was your “Aha!” moment?
Top comments (0)