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.
- πΈ UI Preview
- β¨ Features
- π Tech Stack
- βοΈ Prerequisites
- π Getting Started
- π‘ API Endpoints
- ποΈ Database Structure
- π License
- 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)
- Frontend: HTML, CSS, JavaScript
- Backend: PHP
- Database: Supabase (PostgreSQL)
- Server: PHP Built-in Development Server
- project_folder/
- GlobeReport-client/
- GlobeReport-server/
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:
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
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/signup | Register a new user |
| POST | /api/login | Authenticate an existing user |
| 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) |
| 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 |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users | Retrieve all registered users (Admin) |
π€ Author Mehadi Wirtes Code GitHub: https://github.com/MehadiWirtesCode
This project is open-source and available under the MIT License.
See the LICENSE file for details.









