Day 66 of #90DaysOfCode Today I built a Flask web application to manage a personal book library using SQLite and SQLAlchemy. This is my first project where I integrated a database instead of relying on file-based storage, which made the application more structured and scalable. The app allows users to add books with title, author, and rating, and stores them in a database that is dynamically rendered on the homepage. Key features implemented • SQLite database integration • SQLAlchemy ORM for data modeling • Dynamic data retrieval and rendering • Form handling with validation • Backend data persistence Key concepts learned • How databases integrate with backend applications • Using ORM instead of manual file handling • Structuring models using SQLAlchemy • Managing and querying persistent data This project gave me a much clearer understanding of how real-world applications manage data. GitHub Repository https://lnkd.in/gTAqTzFW #Python #Flask #SQLAlchemy #BackendDevelopment #WebDevelopment #90DaysOfCode
Flask App with SQLite and SQLAlchemy for Personal Book Library
More Relevant Posts
-
Day 65 of #90DaysOfCode Today I built a Flask web application to collect and display cafe data including location, opening hours, coffee quality, wifi strength, and power availability. The application allows users to submit cafe details through a form, which is validated on the backend and stored in a CSV file. The stored data is then rendered dynamically on a separate page. Key features implemented • Form handling using Flask-WTF • Input validation using WTForms • Handling GET and POST requests in Flask • Data storage using CSV files • Dynamic rendering using Jinja templates • Redirect flow after form submission Key concepts learned • How form submission works in backend systems • Difference between GET and POST requests • Validating and processing user input • Structuring Flask applications properly This project gave me a clearer understanding of how backend systems handle user input and store structured data. GitHub Repository https://lnkd.in/gNvjnbZT #Python #Flask #BackendDevelopment #WebDevelopment #SoftwareEngineering #90DaysOfCode
To view or add a comment, sign in
-
Day 3: SQLite, SQLAlchemy & Alembic CRUD needs some memory, and that's what day 3 is about. We swap out the in-memory Python list for a real SQLite database — adding SQLAlchemy as the ORM and Alembic to manage schema changes over time. If you've used Eloquent + Laravel migrations, the mental model is nearly identical. Here's what we cover: → Setting up SQLAlchemy's three core pieces: engine, session factory, and declarative base → Defining ORM models with a one-to-many relationship (tasks → notes) and cascade deletes → Wiring Alembic so autogenerate actually works (the __init__.py trick that trips everyone up) → The session lifecycle: why db.commit() is the single most common mistake → Running a real schema migration — adding a column to a live database without touching the file directly The part worth highlighting: the service/route separation from Day 2 paid off immediately. The routes layer barely changed. The database swap was almost entirely contained to the service layer. That's the point of keeping them separate. By the end, you stop the server, restart it, and your data is still there. 👉🏼 Read the full article - link is in the comments. #Python #Starlette #SQLAlchemy #WebDevelopment #BackendDevelopment
To view or add a comment, sign in
-
I'm often asked how to handle edge cases when building data layers with MongoDB and Python. Simple CRUD is great, but real-world apps need robust query patterns and clean architecture. Working in VS Code on this project, I focused on layering logic. Instead of calling the database directly from the application layer, I used a modular service pattern (like user_service.py calling db_utils.py). A few key practices I implemented: ✅ Robust Error Handling: Ensuring a clean return for cases like invalid ObjectIds, which prevents app crashes. ✅ Modular Query Logic: Abstracting queries into specific, reusable functions (e.g., get_users_by_college) makes the main logic much easier to read and test. ✅ Automated Postman-Free Testing: In my terminal, you can see I'm using curl and echo to script a "Full CRUD Test Cycle." This is a fast, reproducible way to verify APIs during development. What's your go-to pattern for structuring database interactions in your applications? Do you stick with raw queries, ORMs, or custom data access objects? Let me know in the comments! GitHub link - > https://lnkd.in/dASzkj7T #mongodb #python #development #dataservices #vscode #backend #programming #softwareengineering
To view or add a comment, sign in
-
-
𝐖𝐡𝐚𝐭 𝐢𝐟 𝐲𝐨𝐮 𝐧𝐞𝐯𝐞𝐫 𝐡𝐚𝐝 𝐭𝐨 𝐰𝐫𝐢𝐭𝐞 𝐫𝐚𝐰 𝐒𝐐𝐋 𝐚𝐠𝐚𝐢𝐧? That's Django's ORM (Object-Relational Mapper) in a nutshell. An ORM lets you interact with your database using Python instead of SQL. You define your data as Python classes (called models), and Django handles the database queries behind the scenes. Here's a simple example: Instead of writing: SELECT * FROM blog_post WHERE author_id = 1; You write: Post.objects.filter(author_id=1) Same result. Pure Python. No SQL dialect to worry about. What makes the Django ORM powerful: → Works with PostgreSQL, MySQL, SQLite, Oracle. Same code, different DB → Migrations: Change your model, run a command, database updates automatically → Querysets that are chainable, lazy, and incredibly readable → Relationships like ForeignKey, ManyToMany, OneToOne, all handled elegantly I've worked with Oracle 19c and PostgreSQL in production. The ORM made switching between them painless which required just a config change. The caveat? For very complex queries, raw SQL is still available. The ORM doesn't replace SQL knowledge. It reduces how often you need it. If you're building data-heavy apps, learning the Django ORM deeply is one of the best investments you can make. Tomorrow: Django REST Framework, turning Django into an API powerhouse. #Django #ORM #Python #BackendDevelopment #Database
To view or add a comment, sign in
-
-
📅 Day 14/30 — BookStore-Management-API(FastAPI + MySQL) 🔹 Project Overview: Built a complete BookStore-Management-API using Python (FastAPI) and MySQL. The system enables users and sellers to interact through a role-based structure, allowing book management, purchasing, and real-time business insights via an admin dashboard. 🔹 Tools Used: Python (FastAPI) | MySQL | SQLAlchemy 🔹 Key Features: • Role-based user system (User & Seller) 👥 • Book management system (add, update stock) 📚 • Purchase system with stock validation 🛒 • Admin dashboard with business metrics 📊 • Revenue tracking (total & daily) 💰 • Clean API design with form-based inputs ⚡ 🔹 What I Learned: • Designing REST APIs using FastAPI • Connecting Python with MySQL using SQLAlchemy • Implementing role-based logic in backend systems • Handling real-world scenarios like stock & transactions • Building admin analytics for business insights 🔗 GitHub Repository: https://lnkd.in/d4XAJZ2W #DataAnalytics #FastAPI #PythonProjects #SQL #BackendDevelopment #30DaysOfCoding 🚀
To view or add a comment, sign in
-
🚀 Built Lightweight Async ORMs for FastAPI (Inspired by LoopBack) While working on FastAPI projects, I got an idea based on my previous experience with LoopBack — what if we could have a simpler ORM with: minimal boilerplate built-in relation loading and straightforward query syntax So I built two async ORMs: oceanic-mysql-orm — built on aiomysql oceanic-postgres-orm — built on asyncpg 💡 Key Features Async-first (no session management) Automatic relation loading (no N+1 issues) Auto-migrate (additive only — never drops columns) Simple dict-based query system SQL echo mode for debugging ⚡ Example users = await connector.find(User, { "where": {"status": "active"}, "include": ["posts"], "limit": 20 }) 🔥 PostgreSQL Extras Soft deletes (deleted_at handled automatically) Raw SQL support when needed Nested includes (orders.items.product) Advanced filters (ilike, regexp, between) ⚠️ Scope This is intentionally designed for simplicity: No complex JOIN builder No multi-database abstraction SQLAlchemy is still a great choice for large, complex systems. This is aimed at the 80% use case where you want to build and ship quickly. 📦 Installation pip install oceanic-mysql-orm pip install oceanic-postgres-orm 🚧 Status Both packages are v1 (early stage). They’re functional, but I’d really value feedback from developers working with FastAPI. 🔗 Full Guide Complete usage guide here: https://lnkd.in/dj5eY4aN
To view or add a comment, sign in
-
Your queryset works. But your database is doing the heavy lifting. Most Django developers treat QuerySets like simple Python objects. Chain filters, loop over results, and ship it. But under the hood, every queryset translates into SQL executed by PostgreSQL (or your database). Inefficient queries, N+1 problems, and unnecessary evaluations don’t show up in code, they show up in performance, latency, and load. The real issue is not writing queries. It’s understanding when they execute, how many times they execute, and what SQL they generate. Methods like select_related, prefetch_related, and proper indexing are not optimizations—they are baseline requirements once your data grows. Ignoring them turns a working API into a slow system under real traffic. If you don’t know what SQL your queryset generates, are you really in control of your backend? #Django #QuerySet #BackendEngineering #Performance
To view or add a comment, sign in
-
-
My FastAPI Journey — and things are getting exciting! Module 2: Core Basics Coming from a Django background, I've been exploring FastAPI and today I completed Module 2: Core Basics — and I'm genuinely blown away by how clean and powerful it is! 🔥 What I built today: A complete Notes REST API with full CRUD operations using just Python! ✅ Here's what I implemented: 📌 GET /notes — Fetch all notes from the database 📌 GET /notes/{note_id} — Fetch a specific note using Path Parameters 📌 POST /notes — Create a new note with auto-generated ID 📌 PUT /notes/{note_id} — Update an existing note by ID 📌 DELETE /notes/{note_id} — Delete a note and return confirmation 💡 Key concepts I learned: 🔹 Path Parameters — Passing values directly in the URL like /notes/1 to fetch specific records. FastAPI automatically converts and validates the data type! 🔹 Query Parameters — Filtering data using URL params like /search?keyword=Python — no extra configuration needed! 🔹 Request Body — Sending structured JSON data to the server using Pydantic models for automatic validation 🔹 Response Model — Controlling exactly what data is returned to the client for security and clean APIs 🔹 Auto Swagger Docs — FastAPI automatically generates interactive API documentation at /docs — no extra tools needed! ⚡ What makes FastAPI special compared to Django: → No need for separate serializers — Pydantic handles validation automatically → No need for urls.py — routes are defined directly on functions → Auto generated API docs out of the box → Built on ASGI (Uvicorn) making it significantly faster This is just the beginning — next up: 📦 Pydantic Data Validation 🗄️ Database Integration with SQLAlchemy 🔐 JWT Authentication 🚀 Deploying a Production API Learning in public — follow along for daily updates! 💪 #FastAPI #Python #REST #API #BackendDevelopment #Django #LearningInPublic #100DaysOfCode #WebDevelopment #SoftwareEngineering #CRUD
To view or add a comment, sign in
-
🗓️ Release Notes — April 27, 2026 🔎 Span attribute filtering across the stack Pass attribute filters from the Python client, TypeScript client, REST API, or CLI. Type-aware (int/float/bool/str match their stored types). Filters are ANDed together. https://lnkd.in/ecJ-PQK9 🔐 Secrets settings page Admins can add, replace, delete, and search encrypted LLM provider credentials (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) directly in the UI—no REST calls. https://lnkd.in/eynXBPT2 🧪 Claude Opus 4.7 in the Playground https://lnkd.in/gwuzYJTk 🧬 `trace_id` in experiment evaluators Add a `trace_id` kwarg to any evaluator and Phoenix passes the originating trace ID for each run. Works sync/async, function- or class-based. Useful for trajectory evals. https://lnkd.in/e6_resgS ☁️ Azure Managed Identity for PostgreSQL Connect Phoenix to Azure Database for PostgreSQL with Entra managed identity—no static DB password required. https://lnkd.in/euepx9-9 📝 CLI span notes Add notes via `px span add-note <span-id> --text "..."`, and include notes with `--include-notes` on `px span list` / `px trace get`. https://lnkd.in/euzV22dy 📌 Full release notes https://lnkd.in/eFvGJ_Cy
To view or add a comment, sign in
-
𝗢𝗻𝗲 𝘀𝗺𝗮𝗹𝗹 𝗲𝗿𝗿𝗼𝗿 𝘁𝗮𝘂𝗴𝗵𝘁 𝗺𝗲 𝗮 𝗯𝗶𝗴 𝗹𝗲𝘀𝘀𝗼𝗻 𝗮𝗯𝗼𝘂𝘁 𝗱𝗲𝗯𝘂𝗴𝗴𝗶𝗻𝗴 🚀 Today while solving a SQL problem on LeetCode, I ran into this: TypeError: write() argument 1 must be unicode, not str At first glance, it looked like I had completely messed up. I rechecked my query. Tried different approaches. Still the same error. Then I realized the real issue… I had used ROWID — which works perfectly in Oracle. But LeetCode runs on MySQL, where ROWID doesn’t exist. And instead of a clear SQL error, it threw a Python error. That’s what made it confusing. That moment taught me something important: Not all errors mean your logic is wrong. Sometimes, you just need to understand the environment you’re working in. Debugging isn’t only about fixing code… It’s about thinking deeper and asking the right questions. Back to learning 🚀 #SQL #Debugging #LeetCode #BackendDevelopment #LearningJourney #ProblemSolving
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development