Skip to content

AiAiAi-Hackathon/laravel-medium-clone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Logo

Build Status Total Downloads Latest Stable Version License

Laravel Medium Clone

A Medium-like blogging platform built with Laravel 12, featuring article publishing, user authentication, and media management.

Requirements

  • PHP 8.2 or higher
  • Composer
  • Node.js 18+ and npm
  • SQLite (default) or MySQL/PostgreSQL

Setup Instructions

🐳 Using Docker Compose

  1. Make sure you have a .env file with your environment variables, and Docker up and running:

  2. Build and start the services:

    touch database/database.sqlite
    php artisan migrate --force
    php artisan db:seed --force
    npm install && npm run build
    docker-compose build --no-cache && docker-compose up -d

    This will build the Docker image if needed and start the containers.

     >> Web App - Blog
     http://localhost:8000/
    
     Name: Jane Doe
     user: jane@acme.com
     pwd: password
    
     Name: John Doe
     user: john@acme.com
     pwd: password
    
     >> MinIO
     http://127.0.0.1:9090/login
    
     user: minioadmin
     pwd: minioadmin
    
     >> Mailpit
     http://localhost:8025/
    
  3. To stop the services:

    docker-compose down

Local Project Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/laravel-medium-clone.git
    cd laravel-medium-clone
  2. Install PHP dependencies:

    composer install
  3. Install JavaScript dependencies:

    npm install
  4. Build JavaScript dependencies:

    npm run build
  5. Copy the environment file:

    cp .env.example .env
  6. Generate application key:

    php artisan key:generate

Database Setup

The project is configured to use SQLite by default:

  1. First, ensure your file has the correct database configuration: .env
DB_CONNECTION=sqlite
DB_DATABASE=/absolute/path/to/your/project/database/database.sqlite

Note: You can remove other DB_* variables (DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD) as they're not needed for SQLite.

  1. Create the SQLite database file:

    touch database/database.sqlite
  2. Run migrations:

    php artisan migrate
  3. (Optional) Seed the database with sample data:

    php artisan db:seed

If you want to start fresh at any point, you can use:

 php artisan migrate:fresh

This will drop all tables and re-run all migrations. Add --seed flag if you want to reseed the database:

php artisan migrate:fresh --seed

Running the Application

You can run the application using the custom dev script that starts the Laravel server, queue worker, and Vite development server concurrently:

 composer dev

Or run each service separately:

  1. Start the Laravel development server:

    php artisan serve
  2. Start the queue worker:

    php artisan queue:listen
  3. Compile assets with Vite:

    npm run dev

The application will be available at http://localhost:8000

Testing

This project uses PestPHP for testing. To run the tests:

php artisan test

Or to run tests with Pest directly:

./vendor/bin/pest

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, Laracasts can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Partners program.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

About

Minimalistic version of medium built with Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 67.4%
  • Blade 30.7%
  • Other 1.9%