Giter Site home page Giter Site logo

vedmant / running-time Goto Github PK

View Code? Open in Web Editor NEW
91.0 6.0 35.0 6.44 MB

Sample Single Page Application using Laravel & Vue.js + Vuex + Vue-Router

Home Page: https://vedmant.com/sample-single-page-application-spa-using-laravel-5-vue2-vuex-vue-router/

PHP 54.34% Vue 31.16% Dockerfile 0.33% Blade 0.34% JavaScript 12.81% SCSS 1.02%
laravel vuejs vuex vue-router spa single-page-app sample-project

running-time's Introduction

actions workflow

Laravel 10 & Vue.js 3 (Options API) + Vuex Sample Project

Laravel & Vue Sample Project is a tutorial Single Page Application (SPA) for Laravel 6 and Vue.js 2.6 Frontend

Demo

Use login: [email protected] and password: 123456

Installation

git clone https://github.com/vedmant/running-time.git # To clone repo
cd running-time
composer install # Install php dependencies

# Prepare enviroment variables
cp .env.example .env # Copy configuration file
php artisan key:generate # Generate unique key

# Prepare database
touch database/database.sqlite # Create sqlite database
php artisan migrate --seed # Create DB Schema and seed sample data
php artisan passport:install # Install Passport

# Compile assets
yarn # Install Javascript dependencies
yarn prod # Compile assets

# Start server
php artisan serve # Start server

Open http://localhost:8000 to view site

If you don't have installed yarn, run npm install -g yarn

Main features

  • Fully separate Backend and Frontend
  • Authentication based on Laravel Passport
  • List pages with filters and CRUD editing
  • Backend validation
  • Admin panel
  • Simple widgets
  • Simple reports
  • Full Phpunit test coverage
  • E2E tests with Cypress
  • Continuous integration with GitHub Actions
  • Development configuration with Docker

Includes

Other Features

  • Front page
  • Authentication (registration, login, logout, throttle)
  • Users roles: administrator (all access), manager (manage records)
  • User dashborad with widgets and charts
  • Entries list with filter by date (list, show, edit, delete, create)
  • Report page with chart
  • User profile page
  • Admin dashboard with widgets
  • Users admin (list, show, edit, delete, create)
  • Entries admin (list, show, edit, delete, create)
  • Global loader overlay for all requests
  • Eslint code standard check
  • Lodash-es to allow tree shaking for bundle size optimization
  • Support IE11 with Polyfills

Development

To run convenient development server with hot reloading:

php artisan serve # Will serve backend on localhost:8000
yarn hot # Will serve frontend on loaclhost:8080 and proxy api requests to localhost:8000

And open http://localhost:8080

Alternatively you can use watch method:

yarn watch

And open http://localhost:8000

To compile assets for production run:

yarn prod

# Or to display bundle analyzer run:
yarn production -- --env.analyzer true 

Development with Docker

If you want to use more features like Redis queues, MariaDB database, sending and viewing sent emails you can use Docker setup on this project.

For you you will need Docker installed on your host https://docs.docker.com/install/

To build the image for Docker, run:

docker-compose build

It will build all images and run all needed containers.

Then use ENV variables, prepared specificly for Docker:

cp .env.docker.example .env
docker-compose run php php artisan key:generate

Migrate and seed database, and install Passport:

 docker-compose run php php artisan migrate --seed
 docker-compose run php php artisan passport:install

To run the project in Docker just run:

docker-compose up

And open http://localhost:8080

To run all the Artisan or Test commands you can use docker-compose run php before the command to run it in the container. If you want to run command in currently running container, use docker-compose exec php.

Tests

To run all PHPUnit tests:

./vendor/bin/phpunit 
# Or
yarn test

To run Cypress E2E tests:

php artisan serve
yarn e2e-run
# Or you can open GUI with
yarn e2e

Demo Credentials

For testing application the database is seeded with sample users:

TODO

  • Upgrade Bootstrap to v4
  • Setup Travis to run Cypress tests
  • Add more E2E cypress tests

License

And of course:

MIT

running-time's People

Contributors

vedmant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

running-time's Issues

How to use FormData() for uploading a file?

How to use FormData() for uploading a file?

  <div class="form-group">
      <div class="col-md-8 col-md-offset-4">
        <button type="submit" class="btn btn-primary">Submit</button>
      </div>
    </div>
 return new Promise((resolve, reject) => {
      axios.post(Config.apiPath + 'post', form,{headers: { 'Content-Type': 'multipart/form-data'}})
        .then(
          response => {
            commit('STORE_POST_OK', response.data.post)
            resolve()
          })
        .catch(error => {
          commit('STORE_POST_FAIL')
          reject(error.response.data)
        })

How I use FormData()?

let formData = new FormData();
 formData.append('file', this.form.file);

Vue Axios

Heya!

Know you already plan to add axios, just wondering if you have plans to add it anytime soon? :)

Have looked at doing it myself but can't seem to work it out at the moment.
Love the project though!

Thanks :)

Biggest issue

Hello @vedmant,

You saved me hours of work. Thank you very much for such scaffolding!

<3 from Istanbul.

Don't use it for TopTal test

Hey guys! If you're thinking about using this repo for your TopTal screening test don't do that. Those guys are aware of this code and they will ban you as they did today with me.

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.