Repository navigation
Production readiness: docs, config, CI, and fixes - #1
Merged
Merged
Conversation
- Add README, MIT LICENSE, .gitignore and flake8 config - Rename requirements_lib.txt to requirements.txt with minimum versions - Read SECRET_KEY from the environment (dev fallback with a warning) - Run Flask in debug mode only when FLASK_DEBUG is set - Fix sign-up crash on current Werkzeug (method='sha256' is no longer supported) - Fix database creation for Flask-SQLAlchemy 3 and use an absolute database path - Require login on /delete-note and validate request input - Stop tracking __pycache__ and the local SQLite database - Add module docstrings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the project documented, installable and safer to run, without changing normal behaviour.
LICENSE(MIT, copyright 2026 Diganta Datta).gitignoreand a lenient.flake8configrequirements_lib.txtrenamed torequirements.txt(no other file referenced the old name) with minimum versions: Flask>=2.3, Flask-SQLAlchemy>=3.0, Flask-Login>=0.6.2SECRET_KEYis now read from theSECRET_KEYenvironment variable; if unset, an obviously insecure dev key is used and a warning is loggedmain.pyruns in debug mode only whenFLASK_DEBUGis set to a truthy value (previously alwaysdebug=True)Bug fixes found while testing with current library versions
Invalid hash method 'sha256'on Werkzeug 3 (generate_password_hash(..., method='sha256')). It now uses the Werkzeug default (scrypt on Werkzeug 3), still salted and hashed.db.create_all(app=app)no longer exists in Flask-SQLAlchemy 3; replaced withcreate_all()inside an app context. The database path is now absolute (website/database.db) so it does not depend on the working directory./delete-notehad no@login_required(an anonymous request would raise an error); added. Malformed JSON or a non-integer id no longer causes a 500.TypeError; whitespace-only notes are now rejected.Password handling
Passwords were already hashed (not plain text); no plain-text passwords exist in the code or in the committed database. Verified end to end with a Flask test client: sign-up, add note, delete note, logout, wrong password, login.
Repository hygiene
website/__pycache__/*.pycandwebsite/database.dbare no longer tracked (files stay on disk, and are now in.gitignore). The committed database had 0 users and 0 notes, so no user data was exposed.Things the owner must check
LICENSEsays "Copyright (c) 2026 Diganta Datta". Change if you want a different name or license..github/workflows/ci.ymlis included (separate commitAdd GitHub Actions CI workflow). It installs requirements, runspy_compile,flake8and a small smoke test on Python 3.9 and 3.12. The runner is pinned toubuntu-24.04becauseubuntu-latestno longer provides Python 3.9. The workflow has run on this PR and passes on both Python versions.SECRET_KEYremains in git history. It was a placeholder-style dev key, but do not reuse it anywhere; set a new randomSECRET_KEYin any real deployment.sha256method, those hashes will not verify on Werkzeug 3 and those users must sign up again.Screenshot (6).pngshows browser tabs and a taskbar. It is referenced in the README; swap it if you prefer a cleaner image.