Git Product home page Git Product logo

larafolio's Introduction


Turn a Laravel app into a portfolio site in minutes


Latest Stable Version Licence Build Status SensioLabsInsight Quality Score StyleCI

This project is still under construction. Come back soon!

Contents

API

Larafolio\Models\Project.php

static allVisible($group = true, $order = true)
static allHidden($group = true, $order = true)
static allGrouped($order = true)
static allOrdered()
static hasBlockNamed($blockName)
static hasImageNamed($imageName)
static hasLinkNamed($linkName)
blocks()
links()
images()
hasBlocks()
block($name)
blockText($name, $formatted = true)
getProjectBlock()
getProjectBlockText($formatted = true)
hasImages()
image($name)
imageUrl($name, $size = 'medium')
imageCaption($name)
getProjectImage()
getProjectImageUrl($size = 'small')
hasLinks()
link($name)
linkUrl($name)

Larafolio\Models\Image

thumbnail()
small()
medium()
full()
imageRoute($templateName)
fileName()

Developing

Getting Started

Clone this repo:
git clone https://github.com/zachleigh/larafolio.git
Install php dependencies:
composer install
Install javascript dependencies:
yarn

Or, if you like pain and suffering:

npm install
Set up database connections

Currently, database credentials are in two places (yeah, this sucks...):

  • /vendor/laravel/laravel/.env.testing
  • codeception.yml

Before submitting a pull request, please change codeception.yml back to its original values:

dsn: 'mysql:host=127.0.0.1;dbname=larafolio'
user: 'root'
password: 'password'
Artisan

There is an artisan file in the Larafolio directory that points to the laravel instance in vendor. This gives you access to all of the artisan commands you would normally use.

Publish the resources from the service provider:
php artisan vendor:publish --provider="Larafolio\LarafolioServiceProvider" --force
Run migrations
php artisan migrate

Workflow

Serve the project:
php artisan serve
Login and access project

Login logic is contained in the /login route in the underlying Laravel instance. To login and access the project, simply hit the /login route. A user will be logged in and you will be redirected to /manager. Hitting the login route also reruns the migrations and seeds it.

Build resources:
gulp

CSS and JS will be built and moved into the vendor laravel instance automatically.

Watch for changes and build automatically:
gulp watch
```

###### Create test data
```
php artisan migrate:refresh --seed
```
Or simply hit the /login route.

#### Testing
This project contains both phpunit tests and Codeception tests.    

Run all tests:
```
composer test
```

Run phpunit tests:
```
phpunit
```

Run Codeception tests:
```
codecept run acceptance
```

larafolio's People

Contributors

scrutinizer-auto-fixer avatar zachleigh avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

larafolio's Issues

Improve accessibility

Recent additions have made usability/accessibility pretty terrible. Things to do:

  • All form fields should have a label. Text block text field could be exception.
  • All link items shown on main project page should be labeled.
  • Consider labeling items in live preview.

Add config item for preview class

The preview section of the edit form would be much more useful if it was wrapped in the same class as it is in the live app. Allow for this via a config item.

Move site-wide section style to .section namespace

Will lead to more consistent styling and easier maintenance.

Do the same for general layout items. Currently, a lot of it is in .project, but that stops making sense if the page is not a project page. Create a .page namespace.

Add basic mobile acceptance tests

Need to cover the following:

  • Menu
  • Can click 'Manage' from dashboard
  • Can toggle visibility from dashboard
  • Can toggle visibility from project screen
  • Can remove project
  • Can add images
  • Can update images
  • Can remove images
  • Can add project
  • Can edit project
  • Can change text block order
  • Can remove text blocks
  • Can change link order
  • Can remove links

Links arent ordered in Project statics

Links need to be ordered by order property. In orderAndGroupQuery(), add this at top of method:

        $query->with(['links' => function ($query) {
            $query->orderBy('order');
        }]);

Cache busting isnt working

Have to clear the browser cache to see changes in css/js after updating. Maybe elixir can't find the rev-manifest file in public/vendor?

Add support for pages

Pages like About should be able to be kept in database as well. Could essentially be the same as project, just with no links and separate menu dropdown.

Improve api more

  • Add methods to get all projects with named elements. For example all projects with links named 'about':
        Link::with('project')
            ->where('name', 'about')
            ->get()
            ->map(function ($link) {
                return $link->project;
            });

Soft deleting project makes project name unusable in future

Since the name needs to be unique, soft deleted project names can not be re-used. Possible solutions;:

  • Don't make project names unique (don't like this...)
  • Hard delete projects (scary..)
  • Have page where soft deleted projects can be managed
  • Have commands to deal with soft deleted projects

The page seems like the best option to me, and really shouldn't be too much work. Maybe in a Settings page or series of pages. You could also make soft deleting an option.

Live preview height does not match edit section height

A few problems:

  • New edit section spacing not fully accounted for: increase display area top and form-section margin-bottom by same amount.
  • Bottom border of text block edit form needs to stick to the bottom, maybe make it a border-top instead.
  • Extract css/js constants to variables if not already done.

Flash messages all same instance

If two flash messages hit the system at the same time, they are the same instance. The timer to hide the flash message is set with the first message so the second message is shown for a shorter amount of time. Should either:

  • Make it so each flash message is a separate instance (ideal)
  • Reset the timer when a new flash message is created

Make command to seed database in portfolio with Larafolio data/images

Maybe just a command to move the Larafolio database seeders and factories to the local app?

Issues:

  • Need to get rid of namespaces when moving seeders over
  • Eliminate use statements for DB and Storage
  • Change image paths. Should be __DIR__.'/../../vendor/zachleigh/larafolio/tests/_data/images'

Check status of links

Use https://github.com/spatie/http-status-check to check status of links. Have a status indicator on the project manager page with colored dots: green for 200, orange for 300, red for 400/500. Output error message for all but 200 range. Run in background and update via ajax. Have either grey indicator or spinner in place of status indicator if process hasn't completed yet.

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.