Skip to content
AngeArsenePublic

About

Chirper is a simple social media platform built with Laravel that demonstrates the framework's core features and best practices. The application showcases modern Laravel development techniques

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

388 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chirper

A Laravel 13 microblogging application built around Blade views, Tailwind CSS v4 assets, and SQLite-backed persistence. The application currently implements the familiar web flow for a simple social feed: registration, sign-in, creating and managing chirps, profile edits, and account removal.

What the app does

This repository is a small Laravel web application. Authenticated users can publish short messages to a paginated home feed, edit or delete their own chirps, and update their profile details. The middleware and policy layer protect the authenticated-only pages and authorize ownership-sensitive actions. Users can also like or unlike chirps, and the home feed ranks posts by how much engagement they receive. Users can also save chirps to a personal bookmarks page and remove those bookmarks later. Users can also reply to chirps and like individual comments in those conversations. Users can now like and unlike both chirps and comment threads through the same shared engagement flow. Users can upload a profile avatar that appears on their profile and beside their chirps and comments. Users can also update a profile cover image and complete password confirmation steps from the profile settings flow.

Features

  • Web routes are mounted from the framework bootstrap layer and grouped into authentication and profile flows.
  • The home page is a paginated chirp feed served by ChirpController@index and authorized through ChirpPolicy@viewAll.
  • Authenticated POST, PUT/PATCH, and DELETE chirp actions are defined as a resource route with auth.only authorization middleware and throttling settings for store/update/delete.
  • Registration, login, and logout are handled through AuthController and the auth route file.
  • Profile editing and account removal are routed through UserProfileController and the profile route file.
  • UpdatePasswordController and VerifyPasswordController handle password updates and password confirmation during the profile settings flow, and their route registrations live in routes/profile.php and bootstrap/app.php.
  • Middleware aliases expose guest.only, auth.only, and unconfirmed.only custom guard behavior through EnsureUserIsGuest, EnsureUserIsAuthenticated, and EnsureUserIsUnconfirmed.
  • The schema includes a users table, sessions table, password reset tokens, and a chirps table with a nullable unique idempotency_key column added in a later migration.
  • ChirpController@index now loads likes_count and liked_by_current_user metadata.
  • The app uses a shared Like model, Likeable contract, IsLikeable trait, and Messageable interface so chirps and comments participate in the same polymorphic like flow; the likes table stores user_id, likeable_id, likeable_type, and a unique user_id/likeable_id/likeable_type constraint in a dedicated migration.
  • Authenticated users can like and unlike a chirp through ChirpLikeController and the chirps.like route, using POST and DELETE requests with auth.only and throttle:16,1.
  • ChirpCommentController serves paginated comment threads on a chirp, and ChirpCommentPolicy restricts comment edits and deletions to the owning user while permitting like actions only once per user.
  • Authenticated users can add, edit, and delete comments on a chirp through the chirps.comments resource routes, and ChirpCommentLikeController and the chirps.comments.like endpoint let them like or unlike any individual comment.
  • The schema adds the chirp_comments table with user_id, chirp_id, message, and timestamps, and the chirp_comment_likes table with a unique chirp_comment_id/user_id pair to prevent duplicate likes; ChirpCommentSeeder and ChirpCommentLikeSeeder support local development examples.
  • Authenticated users can bookmark and unbookmark a chirp through ChirpBookmarkController and the chirps.bookmark route, using POST and DELETE requests with auth.only and throttle:16,1; ChirpBookmarkController@index serves the paginated bookmarks view.
  • The schema adds the chirp_bookmarks table with user_id, chirp_id, and created_at, plus a unique chirp_id/user_id pair constraint; ChirpBookmarkSeeder and ChirpBookmarkFactory support sample bookmark data for local development and tests.
  • Profile avatars are uploaded through UpdateProfileAvatarController at the profile.avatar.update route; UpdateProfileAvatarRequest accepts required JPG, JPEG, PNG, or WEBP images up to 1024 KB and stores them on the public disk under avatars/.
  • Profile cover images are uploaded through UpdateProfileCoverController at the profile.cover.update route; UpdateProfileCoverRequest validates JPG, JPEG, PNG, or WEBP cover images up to 1MB and stores them under covers/, while ProfileCover renders the uploaded image or a generated fallback.
  • The ProfileAvatar view component renders a user's uploaded avatar or a Laravolt-generated initials avatar, and profile and message views use it for user images; the users table stores the nullable avatar path and laravolt/avatar provides the avatar generation package.

Project structure

app/
├── Concerns/ # IsLikeable trait for engagement actions
├── Contracts/ # Likeable and Messageable contracts for shared engagement behavior
├── Enums/ # EngagementType, MessageableType, and AppRouteNameToAction enums
├── Exceptions/ # RouteNotNamedException and ViewResolutionException
├── Http/
│   ├── Controllers/ # AuthController, ChirpBookmarkController, ChirpCommentController, ChirpCommentLikeController, ChirpController, ChirpLikeController, UpdatePasswordController, UpdateProfileAvatarController, UpdateProfileCoverController, UserProfileController, VerifyPasswordController
│   ├── Controllers/Abstract/ # EngagementController and ProfileImageController base logic
│   ├── Middleware/ # EnsureUserIsGuest, EnsureUserIsAuthenticated, EnsureUserIsUnconfirmed
│   └── Requests/ # UpdatePasswordRequest, UpdateProfileAvatarRequest, UpdateProfileCoverRequest, VerifyPasswordRequest, StoreChirpCommentRequest, UpdateChirpCommentRequest
├── Models/ # User, Chirp, ChirpBookmark, ChirpComment, and Like Eloquent models
├── Pipelines/ # EngagementPipeline and engagement query pipeline stages
├── Policies/ # ChirpCommentPolicy and ChirpPolicy authorization rules
└── View/
    └── Components/ # BookmarkButton, Feed, LikeButton, Message, MessageForm, ProfileAvatar, and ProfileCover components
bootstrap/
└── app.php # route registration, middleware aliases, password-confirm route wiring
config/
└── laravolt/
    ├── avatar.php # Laravolt avatar generation configuration
    └── avatar-hd.php # high-definition avatar configuration
database/
├── migrations/ # users, password reset, sessions, chirps, chirp_comments, likes, chirp_bookmarks, chirp_comment_likes, and 2026_09_14_111921_add_avatar_path_to_users_table.php
├── seeders/ # DatabaseSeeder, UserAndChirpSeeder, LikeSeeder, ChirpCommentSeeder, and ChirpBookmarkSeeder local data setup
└── factories/ # UserFactory, ChirpFactory, ChirpCommentFactory, LikeFactory, and ChirpBookmarkFactory
resources/
└── views/
    ├── chirps/ # bookmarks.blade.php, comments/index.blade.php, and comments/edit.blade.php
    └── components/ # bookmark-button, comment-button, engagement, feed, like-button, message-form, and message partials
routes/
├── web.php # home feed, authenticated chirp resource routes, chirp like/bookmark endpoints, and comment routes
├── auth.php # sign-in/sign-up/logout endpoints
└── profile.php # profile view/edit/delete and password-update endpoints
.env.example # SQLite default settings plus DEFAULT_USER_* keys
composer.json
package.json

Setup

Quick start

git clone https://github.com/AngeArsene/chirper.git && cd chirper
composer run setup

The setup Composer script installs dependencies, creates .env from .env.example when missing, generates the app key, runs migrations, installs frontend dependencies with npm install --ignore-scripts, and builds assets with npm run build.

After the setup script completes, and before running the database migrations and seeders, set the required seeded default-user values in .env:

DEFAULT_USER_NAME="Example User Name"
DEFAULT_USER_EMAIL="some-valide@email.test"
DEFAULT_USER_PASSWORD="some-secure-password"

Those keys are consumed by the seeder in database/seeders/DatabaseSeeder.php and are exposed through config/app.php as the default user credentials for local development. The seeded default-user password must satisfy the runtime password policy defined in app/Providers/AppServiceProvider.php: Password::min(8)->mixedCase()->letters()->numbers()->symbols()->uncompromised().

Now run migrations and seed the database:

php artisan migrate --seed

Finally run composer run dev to starts the Laravel server, queue worker, and Vite dev server together.

composer run dev

Manual steps

composer install
cp .env.example .env
php artisan key:generate
npm install
npm run build
php artisan migrate

This repository currently has PHPUnit-based tests under tests/Feature/ChirpTest.php and related feature coverage. The package manifest does not declare Pest as a development dependency, so pest is not a currently supported command in this app layout.

Status

Last synced with commit ee84baf (2026-09-26)

About

Chirper is a simple social media platform built with Laravel that demonstrates the framework's core features and best practices. The application showcases modern Laravel development techniques

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages