Saas mvp#1
Open
yomarakesha wants to merge 2 commits into
Open
Conversation
- Multi-tenancy: Organization owns SSLKey/Server/Access/User/Invite; all queries scoped via routes/_helpers.org_query/get_for_org_or_404. - Auth: /register creates org + admin; /team for inviting members with one-time tokens and admin/member roles. - Postgres-ready: DATABASE_URL + Flask-Migrate (Alembic); SQLite stays for local dev with auto db.create_all. - Reminders: APScheduler daily job emails admins about resources expiring within 30 days. - Billing: Stripe Checkout + Customer Portal + webhook; Free plan capped at 10 records, Pro unlimited; record_limit enforced in every add handler. - Secrets hygiene: removed /download-secret-db endpoint, moved SECRET_KEY/DATABASE_URL/Fernet to env, .gitignore covers fernet.key/*.db/.env/__pycache__/logs, untracked previously committed secrets and seed DB. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Org-level (admin role): - viewer role added (read-only access to resources) - editor_required decorator gates add/edit/delete; UI hides buttons for viewers - member management on /team: change role, remove member, transfer ownership; owner is protected from removal/demotion - /audit page lists last 200 actions with entity-type filter - AuditLog model and log_action helper persist actor, IP, entity, details for every sensitive action (CRUD, login, invites, role changes, billing, impersonation) Platform-level (User.is_staff): - /admin dashboard with stats (total/paid orgs, signups 7d, totals) - /admin/orgs list with search + plan filter; /admin/orgs/<id> detail with member list and manual plan/status override - /admin/users search by username/email - /admin/users/<id>/impersonate with banner + /admin/stop-impersonate to return to the original session Other: - Organization.owner_id (nullable FK to User, post_update); first registrant becomes owner - User.is_editor / is_owner / is_staff properties - init_db.py marks the bootstrap admin as is_staff=True and owner Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
No description provided.