Skip to content

MehadiWritesCode/GlobeReport-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ PHP + Supabase Project

Stars License Version

A simple and lightweight PHP-based web application integrated with Supabase (PostgreSQL) for database management.
This project demonstrates how to connect a PHP backend with Supabase using environment-based configuration.


πŸ“– Table of Contents


πŸ“Έ UI Preview

{1FDF82BB-5468-46A7-84F3-D95DFE5DB615} {B1B1AB59-10DC-4258-A05A-606C8BE64A6D} {D5CE0819-18E3-47BE-B669-7DD708C3F711} {D02F426C-C42A-4C3A-AFEB-C418CD7183F1} {8124E102-39AD-4E97-9456-CD5FD17F1EBC}

{F245C9DC-D1BB-4B4E-80F5-BAD11661D830}


✨ Features

  • PHP backend with Supabase PostgreSQL
  • Environment variable–based configuration
  • Simple frontend using HTML, CSS, and JavaScript
  • Easy local development setup
  • Clean project separation (client & server)

πŸ›  Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: PHP
  • Database: Supabase (PostgreSQL)
  • Server: PHP Built-in Development Server

Follow the steps below to run the project locally.

πŸ“ Project Structure

  • project_folder/
    • GlobeReport-client/
    • GlobeReport-server/

πŸš€ Getting Started

1️⃣ Clone the Repositories

1️⃣ Clone the Repositories

➜ Clone the client repository: git clone https://github.com/MehadiWirtesCode/GlobeReport-client.git
➜ Clone the server repository: git clone https://github.com/MehadiWirtesCode/GlobeReport-server.git

2️⃣ Set Up Supabase

Create an account at https://supabase.com

Create a new project

Create the required database tables as shown below:

Database Tables

3️⃣ Environment Configuration ➜ From your Supabase dashboard, copy the following database credentials: SUPA_HOST= SUPA_PORT= SUPA_DB= SUPA_USER= SUPA_POOL_MODE= SUPA_PASS=

➜ Create a .env file inside the server directory and paste the values: SUPA_HOST=your_host SUPA_PORT=your_port SUPA_DB=your_database SUPA_USER=your_user SUPA_POOL_MODE=transaction SUPA_PASS=your_password

4️⃣ Run the Server ➜ Navigate to the root project folder and run: php -S localhost:8000 -t server server/index.php

βœ… Notes Make sure PHP is installed (php -v) Keep Supabase credentials private Use the PHP built-in server for local development only

πŸ“‘ API Endpoints

Authentication

Method Endpoint Description
POST /api/signup Register a new user
POST /api/login Authenticate an existing user

Posts

Method Endpoint Description
GET /api/getAllPosts Retrieve all posts (Admin view)
POST /api/posts Create a new post (Admin only)
POST /api/addToWatchLater Add a post to the "Watch Later" list
POST /api/deletePost Delete a post (Admin only)

News

Method Endpoint Description
GET /api/getAllNews Retrieve all news articles
GET /api/getBusinessNews Retrieve business-related news
GET /api/getNationalNews Retrieve national news
GET /api/getInternationalNews Retrieve international news
GET /api/getLifestyleNews Retrieve lifestyle-related news
GET /api/getSportsNews Retrieve sports news
GET /api/getPoliticsNews Retrieve politics-related news

Users (Admin)

Method Endpoint Description
GET /api/users Retrieve all registered users (Admin)

πŸ‘€ Author Mehadi Wirtes Code GitHub: https://github.com/MehadiWirtesCode

πŸ“„ License

This project is open-source and available under the MIT License.
See the LICENSE file for details.