Coder Social home page Coder Social logo

kevoking / book-library Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 176 KB

A small PHP/Laravel, ReactJS & MySQL web application to manage a list of Books. Each book has a name, ISBN, and author. Each author has a name, gender, age, country and genre of books.

PHP 51.07% JavaScript 31.23% Blade 16.91% HTML 0.21% CSS 0.58%

book-library's Introduction

book-library

A small PHP/Laravel, ReactJS & MySQL web application to manage a list of Books. Each book has a name, ISBN, and author. Each author has a name, gender, age, country and genre of books.

It consists of two main sections

  • laravel-api
  • react-app

laravel-api

Inside the main repo you will find a folder /laravel-api/ which contains the backend section of the app. It's a REST API using a MySQL database and PHP/Laravel.

react-app

I side the main repo you will find a folder /react-app/ which contains the frontend section of the app. It's a react app using JavaScript and Tailwind CSS.

Installation

  • Clone this repo

        gh repo clone kevoking/book-library
        cd book-library
  • laravel-api

        cd laravel-api
        composer install
        npm install
    • Copy .env.example to .env edit the .env file to update the database configuration

          DB_CONNECTION=mysql
          DB_HOST=127.0.0.1
          DB_PORT=3306
          DB_DATABASE=book_library_db
          DB_USERNAME=root
          DB_PASSWORD=
      
    • Now run laravel migrations to create our database tables. If you haven't created the database yet the migration event will create it for you using the config provided in the .env file.

          php artisan migrate:fresh --seed

      The --seed option will generate sample data in the database

    • after a successful migration run the api

          php artisan serve

      By default laravel will serve your app at http://127.0.0.1:8000 this maybe different depending on the available ports in you machine. Take note of laravels server address since you will need it in the react-app.

    • Testing has been implemented using Pest, run the following comand to test

          ./vendor/bin/pest
  • react-app

        cd react-app
        npm install
    • If your laravel-api is not running on the default port http://127.0.0.1:8000 you will need to set the correct API_URL in the react app

      • Browse and edit file book-library/react-app/src/utils/api.js and set the correct laravel-api url
          ...
      
          export const API_URL="http://127.0.0.1:8000/api/v1/"

      Please note the trailing forward slash in the url.

book-library's People

Contributors

kevoking 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.