Today was one of those days where I didn’t just write code — I actually fixed my mistakes and understood what I built.
Cleaning Up My Git Mistakes
I realized I had made some serious beginner mistakes:
- I committed my
.envfile (which contains secrets) - I pushed my database file to GitHub
- I didn’t have a
.gitignore
After guidance, I fixed everything properly:
- Removed
.envand.dbfrom the repository - Created a
.gitignoreto avoid future mistakes - Added
.env.exampleto show required environment variables without exposing secrets
This made me understand something important:
A clean and secure repository is as important as working code.
Understanding My Router Code
Earlier, my router files were just “working code” for me.
Today I actually understood what they do.
What is a Router?
In FastAPI, routers handle API requests.
Example:
@router.post("/login")
def login():
return {"message": "User logged in"}
Now I understand:
- Router = entry point for requests
- It connects frontend requests to backend logic
- It calls services and database operations
Real Flow in My Project
Frontend → Router → Service → Database
- User clicks something on UI
- Router receives request
- Service handles logic
- Database stores/retrieves data
What Changed Today
Before:
- Code was running, but I didn’t fully understand it
Now:
- I know how requests flow
- I understand how routers connect everything
Key Learning
- Never commit sensitive files like
.env - Always use
.gitignore - Routers are the backbone of API communication
- Understanding your code matters more than just running it
Final Thought
Fixing mistakes taught me more than writing new code.
Every small correction is making me a better developer.
Next Step
- Deep dive into services layer
- Improve authentication flow
- Prepare for technical discussion
If you’re building projects, take time to clean your repo and understand your code. That’s where real growth happens.
Top comments (0)