Giter VIP home page Giter VIP logo

projectmark's Introduction

SquareBlog - POC

SquareBlog is a web blogging platform based on Laravel 7 PHP framework.

Requirements

Check you have the basic Laravel 7 requirements:

  • PHP >= 7.2.5
  • MySQL installed.
  • Composer installed.
  • A cron task scheduler running (mac, ubuntu: crontab -l)
  • BCMath PHP Extension
  • Ctype PHP Extension
  • Fileinfo PHP extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

Unit Test

TDD was used for this example, so you can check unit tests:

cd squareblog
vendor/bin/phpunit

Installation

Clone this repository and: Install the dependencies and devDependencies and start the server.

$ cd squareblog
$ composer install
$ cp env.example .env
"Update .env file with your local MySQL credentials before continue"
$ php artisan key:generate
$ php artisan migrate
$ composer dump-autoload
$ php artisan db:seed

To start the app...

$ php artisan serve

It will create a local server and serve the app at http://127.0.0.1:8000/ unless you change it.

Post import scheduler

The post import from the external platform, is based on Laravel scheduler, which is configurable by time, for this example, the scheduler is configured to run everyminute and import only posts that are not already imported (matching title + publication_date fields). An artisan command was created for that task, called posts:import, localted at app/Console/Commands/ImportPost.php

For a PROD enviroment, the ideal configuration of the scheduler to avoid conflicts with site traffic and resources used is:

// Run hourly from 12 AM to 2 AM on weekdays...
$schedule->command('posts:import')
          ->weekdays()
          ->hourly()
          ->timezone('America/Managua')
          ->between('0:00', '2:00');

Users

Laravel DB seeder is used to populare the DB with dummy users and posts, all users, including admin use "password" text as password.

Code comments

Each part of the application code is commented with instructions about the logic about it.

projectmark's People

Contributors

m3chas avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.