How I went from “What’s FastAPI?” to a working Gmail OAuth app
So here’s the thing – I’ve been coding for years, but I’d never touched Python web development. Like, at all. My experience was mostly in other stacks, and Python was that language I used for scripts and data stuff, not for building actual web applications.
Then last weekend happened. I needed to build a Gmail OAuth integration with proper database storage. The catch? I had basically no time and zero Python web experience.
This is where AI came in, and honestly, it changed everything.
The Weekend That Changed My Mind About AI Coding
Friday night: “How hard can FastAPI be?”
I started by asking ChatGPT to help me understand the basic structure. Not to write everything for me, but to explain what I was looking at. Coming from other frameworks, I needed to understand the Python way of doing things.
The first few hours were just me asking questions like:
- “Why do you import things this way in Python?”
- “What’s this @app.get() decorator actually doing?”
- “How does dependency injection work in FastAPI?”
Saturday morning: Things started clicking
Instead of just copy-pasting code, I was having conversations with AI about architecture decisions. Like, “Should I put all routes in one file or split them up?” and “What’s the best way to handle OAuth state management?”
The AI would suggest patterns, I’d ask follow-up questions, then I’d implement my own version based on what I learned.
Saturday evening: Actually building stuff
By now I understood enough to start prompting for specific functionality:
- “Help me implement Google OAuth with proper error handling”
- “Show me how to integrate with Appwrite database”
- “What’s the right way to structure logging in a FastAPI app?”
But here’s the key part – I read and understood every single line before using it.
Sunday: Polish and deployment
Had a working app with Docker configs, proper error handling, and even a decent frontend. Not bad for someone who’d never used FastAPI before.
What Actually Worked (And What Almost Went Wrong)
The good stuff:
- AI was like having a really patient senior developer explaining Python web patterns
- I could ask “why” questions and get detailed explanations
- Got to see best practices I wouldn’t have known about
- Learned FastAPI, OAuth2, and Appwrite integration way faster than reading docs
What could’ve been a disaster:
- I almost just copied the first OAuth implementation without understanding the security implications
- Nearly skipped learning about proper error handling because the basic version “worked”
- Had to resist the urge to just ship the first version without understanding the database integration
The difference was treating AI like a knowledgeable colleague, not a magic code generator.
The Real Benefits (Beyond Just Speed)
Yeah, I built something fast. But the bigger win was learning a whole new stack properly in days instead of weeks.
When I look at my final code, I understand every piece:
- Why the OAuth flow is structured the way it is
- How the database integration handles edge cases
- What each endpoint does and why it’s necessary
- How the Docker setup works for deployment
That understanding means I can actually maintain and extend this thing. It’s not just throwaway prototype code.
For Other Developers Trying This
My advice? Use AI, but stay engaged:
- Ask lots of “why” questions – Don’t just ask for code, ask for explanations
- Build incrementally – Understand each piece before moving to the next
- Test edge cases – Ask AI about error scenarios and security considerations
- Refactor as you learn – Once you understand patterns, improve on the initial suggestions
The goal isn’t to have AI write your app. It’s to have AI teach you to write better apps faster.
Looking Back
Would this have taken me weeks without AI? Probably. Would I have learned as much? Honestly, maybe not. Having an AI explain patterns and answer questions in real-time was like having the best documentation and mentor rolled into one.
But here’s the thing – it only worked because I approached it like an engineer, not like someone looking for magic solutions.
The code I ended up with is production-ready, properly structured, and most importantly, I understand all of it. That’s what makes this approach powerful for experienced developers.
*The app handles Google OAuth, stores credentials in Appwrite, fetches Gmail data, and runs in Docker. Not bad for a weekend project in an unfamiliar stack.*Link: https://github.com/Shaieb524/fastapi-oauth