From a5895e21245f566bbcfed9ff9c74886d3e69455d Mon Sep 17 00:00:00 2001 From: bacalhau Date: Mon, 2 Mar 2026 01:13:05 +0000 Subject: [PATCH] added plan.md --- README.md | 28 +--------------- plan.md | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main.py | 16 ++++----- 3 files changed, 102 insertions(+), 35 deletions(-) create mode 100644 plan.md diff --git a/README.md b/README.md index b18d445..f967df8 100644 --- a/README.md +++ b/README.md @@ -1,27 +1 @@ -# shitty darknet website -cool website with python, flask, mariadb and monero. - -## description -We make a darknet dating website based darknet users (such as myself). Each user can provide their own web page and must pay to join. a list of users will be displayed on the main page. Website will not use javashit. - -## goals: -Website must contain these features when finished - - create accounts - - delete accounts - - monero payments - - search page - -## Database -### USER - - id (PK) - - username - - first name - - last name - - adress - - pgp - - xmpp - - email (optional) - - phone number (optional) - - likes - - dislikes - - sex +Minimal dating website writen in python diff --git a/plan.md b/plan.md new file mode 100644 index 0000000..4031c76 --- /dev/null +++ b/plan.md @@ -0,0 +1,93 @@ +# User System Plan + +## 1. Database Schema (`User` model) + +- **Identity & Security** + - `username` (unique, required) + - `pgp` (unique, required) + - `is_verified` (boolean) + +- **Contacts** + - `xmpp` (unique, required) + - `email` (unique, optional) + - `phone` (unique, optional) + +- **Personal Info** + - `firstname` (required) + - `lastname` (required) + - `sex` (`male` / `female`, required) + - `date_of_birth` (required) + - `race` (optional) + +- **Profile & Media** + - `profile_picture` (required) + - `pictures` (optional array) + +- **Location** + - `country` (required) + - `city` (optional) + +- **Physical Attributes** + - `height` (optional float) + - `weight` (optional int) + +- **Preferences** + - `prefered_age_range` (optional) + - `likes` (optional array) + - `dislikes` (optional array) + +--- + +## 2. Registration + +1. **User fills form** + - All fields except `id`, `is_verified`. + +2. **Server receives data** + - Validate required fields and unique constraints. + - Temporarily store as **unverified**. + +3. **PGP Verification** + - Server encrypts a message with user's PGP public key. + - Show **validation page** with encrypted message. + - User decrypts message and submits. + - Server validates ownership and sets `is_verified=True`. + +4. **Create Profile Page & Redirect** + - Generate user profile page with all info. + - Redirect user to main page or search page. + +--- + +## 3. Search Page + +- **Display**: Public user profiles as cards + - Show `profile_picture`, `firstname`, `lastname`, age, `country`, `city`. + +- **Filters**: + - All fields **except** `pgp`, `id`, `username`. + - Include boolean checks for presence of `email`, `phone`, `xmpp`. + +- **Profile Click** + - Open full profile page with all info, pictures, likes/dislikes. + +--- + +## 4. Login Flow + +1. User enters `username` + `PGP key`. +2. Server verifies PGP via challenge. +3. On success: + - User can edit **all fields** execpt `id` and `username`. + - User can change pgp key, new pgp key must be verified. + +--- + +## 5. Software Stack + +- **Software used**: + - Flask (backend framework) + - Postgres SQL (Database) + - SQLAlchemy (ORM) + - python-gnupg (PGP validation) + - Flask-WTF (Forms validation) diff --git a/src/main.py b/src/main.py index b7b3e6a..8c1e763 100644 --- a/src/main.py +++ b/src/main.py @@ -16,17 +16,17 @@ class SexEnum: class User(db.Model): id = db.Column(db.Integer, primary_key=True) - username = db.Column(db.String(80), unique=True, nullable=False) - pgp = db.Column(db.String(4096), unique=True, nullable=False) + username = db.Column(db.String(128), unique=True, nullable=False) + password = db.Column(db.String(128), unique=True, nullable=False) - firstname = db.Column(db.String(80), unique=False, nullable=False) - lastname = db.Column(db.String(80), unique=False, nullable=False) + firstname = db.Column(db.String(128), unique=False, nullable=False) + lastname = db.Column(db.String(128), unique=False, nullable=False) sex = db.Column(Enum('male', 'female', name="sex_enum"), nullable=False) date_of_birth = db.Column(db.Date, nullable=False) profile_picture = db.Column(db.String(200), nullable=False) pictures = db.Column(ARRAY(db.String), nullable=True) - country = db.Column(db.String(80), unique=False, nullable=False) - city = db.Column(db.String(80), unique=False, nullable=True) + country = db.Column(db.String(128), unique=False, nullable=False) + city = db.Column(db.String(128), unique=False, nullable=True) height = db.Column(db.Float, nullable=True) weight = db.Column(db.Integer, nullable=True) @@ -36,8 +36,8 @@ class User(db.Model): likes = db.Column(ARRAY(db.String), nullable=True) dislikes = db.Column(ARRAY(db.String), nullable=True) - xmpp = db.Column(db.String(80), unique=True, nullable=False) - email = db.Column(db.String(80), unique=True, nullable=True) + xmpp = db.Column(db.String(128), unique=True, nullable=False) + email = db.Column(db.String(128), unique=True, nullable=True) phone = db.Column(db.String(20), unique=True, nullable=True) is_verified = db.Column(db.Boolean, default=False)