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.
Home Feed![]() |
Profile![]() |
Auth![]() |
Mobile Home![]() |
Mobile Post![]() |
Mobile Profile![]() |
μ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.
μSocial is intentionally minimal and self-contained.
- Single
index.phpfile; 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
- 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
- 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
- PHP 8.0 or higher with SQLite support
- Web server (Apache, Nginx, or PHP built-in server)
- Write permissions for the database directory
-
Clone the repository:
git clone https://github.com/kevintr303/microsocial.git cd microsocial -
Start a local server (development):
php -S localhost:8000
Or configure Apache or Nginx to point to the project directory.
-
Open http://localhost:8000 in your browser. The SQLite database (
social.db) is created automatically on first access. -
Optional: seed sample data:
python3 scripts/seed.py
This creates sample users, posts, comments, likes, and follows. All seeded users have the password
password.
php -S localhost:8000— Run built-in PHP development serverpython3 scripts/seed.py— Seed database with sample data
- Register an account or log in.
- Create posts from the composer on the home feed.
- Follow other users, like and comment on posts.
- Use search to find users and posts.
- Visit profiles to view bios and activity. Administrators can use the admin panel for user management and moderation.
This project is licensed under the GNU Affero General Public License v3.0.
See the LICENSE file for details.
Built by Bow Dot Red





