https://github.com/mskian/php-supabase-comments
A Simple Comment system built using PHP and Supabase.
https://github.com/mskian/php-supabase-comments
bulma cloudflare-turnstile comment-widget comments comments-system css curl html php php-comment postgresql supabase supabase-comments supabase-db supacomments
Last synced: 3 months ago
JSON representation
A Simple Comment system built using PHP and Supabase.
- Host: GitHub
- URL: https://github.com/mskian/php-supabase-comments
- Owner: mskian
- License: mit
- Created: 2025-01-17T17:26:54.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-27T03:27:37.000Z (8 months ago)
- Last Synced: 2025-03-12T09:16:02.228Z (7 months ago)
- Topics: bulma, cloudflare-turnstile, comment-widget, comments, comments-system, css, curl, html, php, php-comment, postgresql, supabase, supabase-comments, supabase-db, supacomments
- Language: PHP
- Homepage:
- Size: 101 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Supabase Comments
A simple comment system built with PHP and Supabase.

## Features
- PHP (7.4 to 8.x.x) support
- Supabase for storing comments in the database
- Pagination for comments
- Modern and responsive UI using Bulma CSS
- Comprehensive security for input forms and spam prevention
- Cloudflare Turnstile for additional spam protection

## setup
- Create a database in Supabase:
```sql
-- Create the table with necessary fields
CREATE TABLE comments (
id SERIAL PRIMARY KEY, -- Auto-incrementing primary key
name VARCHAR(255) NOT NULL, -- Name of the user (max length 255)
comment TEXT NOT NULL, -- Comment field to store user input
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP -- Timestamp with timezone
);
```- Also, create Cloudflare Turnstile:
- Create a `.env` file to add the required API keys```env
## Supabase
supabaseUrl=https://example.supabase.co
apiKey=
pkey=
table=comments## Cloudflare turnstile
secretKey=
siteKey=
url=https://challenges.cloudflare.com/turnstile/v0/siteverify```
- View Single Comments/status by ID
```sh
http://localhost:6022/post.php?id=18
```- SEO Friendly URL
```sh
RewriteEngine On
RewriteRule ^post/([a-zA-Z0-9\-]+)$ post.php?id=$1 [L,QSA]
``````sh
http://localhost:6022/post/18
```- Done
## Base Concept
This project was inspired from Supacomments dev by [@mcnaveen](https://github.com/mcnaveen) - [Blazing fast comment system with Sveltejs and Supabase](https://github.com/mcnaveen/SupaComments)
## LICENSE
MIT