Skip to content

Feature: Implement basic user authentication #1

@the-nulldev

Description

@the-nulldev

Summary
Set up user registration and login for the web app. This will serve as the foundation for all user-specific functionality.

Motivation
We’ll need authenticated users to store personal data, preferences, and manage sessions. This feature also helps test database integration and request handling.

Proposed Implementation

  • Framework: Flask (or FastAPI, if async support is preferred)
  • Database: SQLite (for now), with migration support
  • Authentication: JWT-based or session cookie–based system

Acceptance Criteria

  • /register route to create a new user with username and password
  • /login route that authenticates a user and returns a token/session
  • Passwords are securely hashed (e.g., using bcrypt)
  • Protected route (/profile) that requires authentication
  • Unit tests for registration and login flows

Example Sketch

@app.post("/register")
def register():
    data = request.json
    hashed = bcrypt.hashpw(data["password"].encode(), bcrypt.gensalt())
    user = User(username=data["username"], password=hashed)
    db.session.add(user)
    db.session.commit()
    return jsonify({"message": "User created"}), 201

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions