{"id":25205540,"url":"https://github.com/dpedwards/php-chat","last_synced_at":"2026-04-13T00:41:22.762Z","repository":{"id":238754812,"uuid":"769725872","full_name":"dpedwards/php-chat","owner":"dpedwards","description":"Simple MySQL + PHP realtime chat","archived":false,"fork":false,"pushed_at":"2024-05-08T11:51:29.000Z","size":364,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T16:46:33.026Z","etag":null,"topics":["database","javascript","mysql","php","sqlschema"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpedwards.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-09T21:59:31.000Z","updated_at":"2024-05-08T11:51:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"4155dd46-8f9c-4880-9ff2-d2723a37da41","html_url":"https://github.com/dpedwards/php-chat","commit_stats":null,"previous_names":["dpedwards/php-chat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dpedwards/php-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpedwards%2Fphp-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpedwards%2Fphp-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpedwards%2Fphp-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpedwards%2Fphp-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpedwards","download_url":"https://codeload.github.com/dpedwards/php-chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpedwards%2Fphp-chat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260109487,"owners_count":22960031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","javascript","mysql","php","sqlschema"],"created_at":"2025-02-10T10:20:01.008Z","updated_at":"2026-04-13T00:41:17.739Z","avatar_url":"https://github.com/dpedwards.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PHP](https://img.shields.io/badge/PHP-darkblue.svg)](https://www.php.net/)\n[![JavaScript](https://img.shields.io/badge/JavaScript-yellow.svg)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)\n[![MySQL](https://img.shields.io/badge/MySQL-orange.svg)](https://www.mysql.com/)\n\n# DATABASESYSTEMS ASSIGNMENT (DBA20)\n# MYSQL + PHP CHAT DEVELOPMENT\n\n## Program Execution\n### Xampp\n[DOWNLOAD](https://www.apachefriends.org/download.html)\n\n### Visual Studio Code\nIT IS RECOMMENDED TO LAUNCH THE [PHP EXTENSION PACK](https://marketplace.visualstudio.com/items?itemName=xdebug.php-pack) APPLICATION WITH [VISUAL STUDIO CODE](https://code.visualstudio.com/).\n\n-------------------------------------------------------\n## ER diagram \u0026 UML\n\n### Simple chat:\n\n![image](out/assets/model/simple_ER_diagram/simple_chat_ER_diagram.mmd.png)\n\n### Complex chat:\n\n![image](out/assets/model/complex_ER_diagram/complex_chat_ER_diagram.mmd.png)\n\n\n-------------------------------------------------------\n## Database schema\n\n### Simple chat:\n\n```\n--\n-- Database: `chat_db`\n--\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `messages`\n--\n\nCREATE TABLE `messages` (\n  `msg_id` int(11) NOT NULL,\n  `incoming_msg_id` int(255) NOT NULL,\n  `outgoing_msg_id` int(255) NOT NULL,\n  `msg` varchar(1000) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `users`\n--\n\nCREATE TABLE `users` (\n  `user_id` int(11) NOT NULL,\n  `unique_id` int(255) NOT NULL,\n  `fname` varchar(255) NOT NULL,\n  `lname` varchar(255) NOT NULL,\n  `email` varchar(255) NOT NULL,\n  `password` varchar(255) NOT NULL,\n  `img` varchar(255) NOT NULL,\n  `status` varchar(255) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n--\n-- Indexes for dumped tables\n--\n\n--\n-- Indexes for table `messages`\n--\nALTER TABLE `messages`\n  ADD PRIMARY KEY (`msg_id`);\n\n--\n-- Indexes for table `users`\n--\nALTER TABLE `users`\n  ADD PRIMARY KEY (`user_id`);\n\n--\n-- AUTO_INCREMENT for dumped tables\n--\n\n--\n-- AUTO_INCREMENT for table `messages`\n--\nALTER TABLE `messages`\n  MODIFY `msg_id` int(11) NOT NULL AUTO_INCREMENT;\n\n--\n-- AUTO_INCREMENT for table `users`\n--\nALTER TABLE `users`\n  MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;\nCOMMIT;\n```\n\n\n### Complex chat:\n\n```\n-- Create `users` table\nCREATE TABLE `users` (\n  `user_id` int(11) NOT NULL AUTO_INCREMENT,\n  `unique_id` int(255) NOT NULL,\n  `fname` varchar(255) NOT NULL,\n  `lname` varchar(255) NOT NULL,\n  `email` varchar(255) NOT NULL,\n  `password` varchar(255) NOT NULL,\n  `status` varchar(255) NOT NULL,\n  PRIMARY KEY (`user_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- Create `conversations` table\nCREATE TABLE `conversations` (\n  `conv_id` int(11) NOT NULL AUTO_INCREMENT,\n  `title` varchar(255) DEFAULT NULL,\n  PRIMARY KEY (`conv_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- Create `messages` table\nCREATE TABLE `messages` (\n  `msg_id` int(11) NOT NULL AUTO_INCREMENT,\n  `incoming_msg_id` int(11) NOT NULL,\n  `outgoing_msg_id` int(11) NOT NULL,\n  `msg` varchar(1000) NOT NULL,\n  `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  `status` enum('sent', 'delivered', 'read') NOT NULL DEFAULT 'sent',\n  `conv_id` int(11) DEFAULT NULL,\n  PRIMARY KEY (`msg_id`),\n  FOREIGN KEY (`incoming_msg_id`) REFERENCES `users`(`user_id`),\n  FOREIGN KEY (`outgoing_msg_id`) REFERENCES `users`(`user_id`),\n  FOREIGN KEY (`conv_id`) REFERENCES `conversations`(`conv_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- Create `contacts` table\nCREATE TABLE `contacts` (\n  `contact_id` int(11) NOT NULL AUTO_INCREMENT,\n  `user_id` int(11) NOT NULL,\n  `contact_user_id` int(11) NOT NULL,\n  `status` enum('pending', 'accepted', 'blocked') NOT NULL DEFAULT 'pending',\n  PRIMARY KEY (`contact_id`),\n  FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`),\n  FOREIGN KEY (`contact_user_id`) REFERENCES `users`(`user_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- Create `conversation_participants` table\nCREATE TABLE `conversation_participants` (\n  `conv_participant_id` int(11) NOT NULL AUTO_INCREMENT,\n  `conv_id` int(11) NOT NULL,\n  `user_id` int(11) NOT NULL,\n  PRIMARY KEY (`conv_participant_id`),\n  FOREIGN KEY (`conv_id`) REFERENCES `conversations`(`conv_id`),\n  FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- Create `user_profiles` table\nCREATE TABLE `user_profiles` (\n  `profile_id` int(11) NOT NULL AUTO_INCREMENT,\n  `user_id` int(11) NOT NULL,\n  `birthdate` date DEFAULT NULL,\n  `bio` text DEFAULT NULL,\n  `location` varchar(255) DEFAULT NULL,\n  `img` varchar(255) NOT NULL, -- Added column for profile image\n  PRIMARY KEY (`profile_id`),\n  FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- Create `user_settings` table\nCREATE TABLE `user_settings` (\n  `settings_id` int(11) NOT NULL AUTO_INCREMENT,\n  `user_id` int(11) NOT NULL,\n  `theme` varchar(255) DEFAULT 'light',\n  `notifications` tinyint(1) DEFAULT 1,\n  `privacy` varchar(255) DEFAULT 'friends_only',\n  PRIMARY KEY (`settings_id`),\n  FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n-- Create `attachments` table\nCREATE TABLE `attachments` (\n  `attachment_id` int(11) NOT NULL AUTO_INCREMENT,\n  `msg_id` int(11) NOT NULL,\n  `file_path` varchar(255) NOT NULL,\n  PRIMARY KEY (`attachment_id`),\n  FOREIGN KEY (`msg_id`) REFERENCES `messages`(`msg_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\n```\n\n\n-------------------------------------------------------\n## PHP-Chat Projektstruktur\n```\nphp-chat\n├─ assets\n│  ├─ css\n│  │  └─ style.css\n│  ├─ model\n│  │  ├─ complex_chat_ER_diagram.mmd\n│  │  ├─ complex_UML.puml\n│  │  ├─ simple_chat_ER_diagram.mmd\n│  │  └─ simple_UML.puml\n│  └─ sql\n│     ├─ complex_chat_db.sql\n│     └─ simple_chat_db.sql\n├─ chat.php\n├─ header.php\n├─ index.php\n├─ info.php\n├─ javascript\n│  ├─ chat.js\n│  ├─ login.js\n│  ├─ pass-show-hide.js\n│  ├─ signup.js\n│  └─ users.js\n├─ login.php\n├─ out\n│  └─ assets\n│     └─ model\n│        ├─ complex_ER_diagram\n│        │  └─ complex_chat_ER_diagram.mmd.png\n│        ├─ complex_UML\n│        │  └─ complex_UML.png\n│        ├─ simple_ER_diagram\n│        │  └─ simple_chat_ER_diagram.mmd.png\n│        └─ simple_UML\n│           └─ simple_UML.png\n├─ php\n│  ├─ config.php\n│  ├─ confirm_password.php\n│  ├─ data.php\n│  ├─ get-chat.php\n│  ├─ images\n│  │  ├─ 1715077867user1-avatar.gif\n│  │  ├─ 1715078174user2-avatar.jpeg\n│  │  ├─ 1715083162user3-avatare.jpg\n│  │  └─ default.jpg\n│  ├─ insert-chat.php\n│  ├─ login.php\n│  ├─ logout.php\n│  ├─ search.php\n│  ├─ signup.php\n│  └─ users.php\n├─ README.md\n├─ unzipper.php\n└─ users.php\n\n```\n\n## Credits\n\n### Creator\n\n**Davain Pablo Edwards**\n\n---\n## License\n\nGNU General Public License Version 3\n\nCopyright (c) 2024 Davain Pablo Edwards\n\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nFor further information regarding the license, please see: \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpedwards%2Fphp-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpedwards%2Fphp-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpedwards%2Fphp-chat/lists"}