DEV Community

Rock
Rock

Posted on

Building a Shared Wishlist App for Couples with Flask and SQLite

When you're in a relationship, keeping track of gift ideas for each other can be a fun but chaotic process. You might text links back and forth, forget what you've already seen, or struggle to find something that feels truly personal. Instead of letting those ideas get lost, why not build a simple shared wishlist app? This is a great beginner-to-intermediate project for sharpening your Flask skills, and it solves a real problem.

We'll create a basic Flask app with SQLite where two people can log in, add items, mark them as purchased, and leave notes. Think of it as a private, collaborative list for anniversaries, birthdays, or just because.

First, set up your environment. You'll need Flask and Flask-SQLAlchemy.

pip install flask flask-sqlalchemy
Enter fullscreen mode Exit fullscreen mode

Now, create a file called app.py. We'll start with the database model. For a couple, we can keep it simple: one table for users and one for wishes.

from flask import Flask, render_template, request, redirect, url_for, flash
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user

app = Flask(__name__)
app.config['SECRET_KEY'] = 'your-secret-key-here'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///wishlist.db'
db = SQLAlchemy(app)
login_manager = LoginManager()
login_manager.init_app(app)

class User(UserMixin, db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)
    password = db.Column(db.String(120), nullable=False)
    wishes = db.relationship('Wish', backref='author', lazy=True)

class Wish(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(200), nullable=False)
    url = db.Column(db.String(500))
    note = db.Column(db.Text)
    purchased = db.Column(db.Boolean, default=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
Enter fullscreen mode Exit fullscreen mode

Next, add a route to display the wishlist. This is where the couple can see all their shared ideas.

@app.route('/')
@login_required
def index():
    wishes = Wish.query.all()
    return render_template('index.html', wishes=wishes)
Enter fullscreen mode Exit fullscreen mode

The template is where the magic happens. In templates/index.html, you can loop through wishes and show a toggle button for purchased status. Here's a snippet:

{% for wish in wishes %}



{{ wish.title }}

    {% if wish.url %}
        View Item
    {% endif %}


{{ wish.note }}



        {{ 'Mark as Purchased' if not wish.purchased else 'Unmark' }}



{% endfor %}
Enter fullscreen mode Exit fullscreen mode

This is a minimal but functional start. You can expand it with categories, images, or even a shared calendar for gifting deadlines.

The real value here is that you're not just coding for the sake of coding—you're building something that strengthens a relationship. It turns gift-giving into a collaborative, thoughtful experience rather than a last-minute scramble. And if you're looking for inspiration for actual gifts, you might check out curated collections like the one at Frishay for couple gifts, but the app itself is what makes the process personal.

By the end, you'll have a fully functional app that you and your partner can use daily. It's a perfect weekend project that combines database design, authentication, and front-end logic. Plus, it's way more romantic than another CRUD tutorial.

Top comments (3)

Collapse
 
frishay_ltd_a1987ef83aa1f profile image
Amelia

Interesting to see no content here yet. It makes me wonder: are you testing the waters, or is this a deliberate minimalist approach?

Collapse
 
frishay_ltd_a1987ef83aa1f profile image
Amelia

An empty post can be surprisingly powerful. It invites everyone to fill the silence with their own thoughts. Any particular direction you're hoping the conversation takes?

Collapse
 
frishay_ltd_a1987ef83aa1f profile image
Amelia

Thanks for putting this into words. I've had similar experiences, and it's refreshing to see someone articulate the quiet power of persistence over intensity.