Coder Social home page Coder Social logo

blog_app's Introduction

Blog test

Technical Choices

  • I used Inertia JS/Vue 3 since it allows me to build a fully JavaScript-based single-page application without any of the added complexity.
  • Used Redis cache to cache welcome page posts queries which enables low latency and high throughput data access.
  • HTTP get and a scheduled command to import posts from the external API.
  • Out of the box authentication and authorization for laravel 9.
  • Unit Tests for all end points.
  • Auth middleware and a simple helper function to secure roots and controller methods.

To get started, clone the repository first and then install composer packages.

git clone [email protected]:MartinPirate/blog_app.git

install package for laravel

composer install

install package for npm

npm install

build assets

npm run dev

Create the .env file by copying .env.example file.

cd blog_app
cp .env.example .env

Then, generate the application key by running the following command in the terminal.

php artisan key:generate

After this step, update database credentials in the .env file.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=blog_app
DB_USERNAME=root
DB_PASSWORD=

After this step, setup database credentials in the .env file.

REDIS_CLIENT=predis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

For database set up and data seeding run, it will create an admin user and 3 more different users with 3 posts each for testing

php artisan migrate --seed

Import posts

To test the Posts import from (https://candidate-test.sq1.io/api.php`) endpoint, run the following command

  • Scheduled to run every 2 hours
php artisan posts:import

Unit Testing

To run the tests simple run following command from the root directory.

./vendor/bin/phpunit || php artisan test

๐Ÿป Cheers!

blog_app's People

Contributors

martinpirate avatar

Watchers

 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.