Skip to content

BowDotRed/microsocial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

μSocial Logo

A lightweight, single-file social media platform.

A minimal, functional social network in one PHP file. User auth, posts, comments, likes, follows, search, profiles, and moderation.


Report Bug · Request Feature

Interface Preview

Home Feed
Home feed
Profile
User profile
Auth
Login and registration
Mobile Home
Mobile home
Mobile Post
Mobile post view
Mobile Profile
Mobile profile

Overview

μSocial (microSocial) is a fully functional, minimalist social media platform built as a single PHP file. It includes user authentication, posts, comments, likes, follows, search, profiles, and moderation tools. Designed for learning, rapid prototyping, self-hosted communities, and clean PHP architecture.

Architecture

μSocial is intentionally minimal and self-contained.

  • Single index.php file; no frameworks or external PHP libraries
  • SQLite database; no separate database server
  • No analytics or third-party tracking
  • Session-based auth; history and preferences are session-local
  • Database and assets stay on your server; no cloud dependency

Quick Demo

Key Features

  • User Authentication — Registration and login with password hashing
  • Posts — Create and share posts (280 character limit)
  • Comments — Threaded comments on posts
  • Likes — Like posts
  • Follow System — Follow users and build a network
  • User Profiles — Profiles with bios
  • Search — Search users and posts
  • Feed Views — Home feed, explore, and personalized feed
  • Security — CSRF protection, rate limiting, prepared statements, XSS protection
  • Moderation — User blocking, admin bans (temporary/permanent), IP banning
  • Responsive Design — Mobile-first layout
  • Admin Panel — User management for administrators

Technology Stack

  • Runtime: PHP 8.0+ with SQLite
  • Database: SQLite 3
  • Deployment: Any web server (Apache, Nginx, or PHP built-in server)
  • Dependencies: None; single-file, zero external PHP libraries

Installation

Prerequisites

  • PHP 8.0 or higher with SQLite support
  • Web server (Apache, Nginx, or PHP built-in server)
  • Write permissions for the database directory

Setup

  1. Clone the repository:

    git clone https://github.com/kevintr303/microsocial.git
    cd microsocial
  2. Start a local server (development):

    php -S localhost:8000

    Or configure Apache or Nginx to point to the project directory.

  3. Open http://localhost:8000 in your browser. The SQLite database (social.db) is created automatically on first access.

  4. Optional: seed sample data:

    python3 scripts/seed.py

    This creates sample users, posts, comments, likes, and follows. All seeded users have the password password.

Available Scripts

  • php -S localhost:8000 — Run built-in PHP development server
  • python3 scripts/seed.py — Seed database with sample data

Usage

  1. Register an account or log in.
  2. Create posts from the composer on the home feed.
  3. Follow other users, like and comment on posts.
  4. Use search to find users and posts.
  5. Visit profiles to view bios and activity. Administrators can use the admin panel for user management and moderation.

License

This project is licensed under the GNU Affero General Public License v3.0.
See the LICENSE file for details.


Built by Bow Dot Red

About

A lightweight social media built on PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published