Coder Social home page Coder Social logo

sihhan / canvas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from austintoddj/canvas

0.0 0.0 0.0 141.82 MB

A Laravel publishing platform

Home Page: http://trycanvas.app

License: MIT License

PHP 49.34% Vue 41.67% JavaScript 3.89% Dockerfile 0.03% SCSS 2.95% Blade 2.13%

canvas's Introduction

Canvas homepage

Build Status Total Downloads Latest Stable Version License

Introduction

Canvas is a fully open source package to extend your existing Laravel application and get you up-and-running with a blog in just a few minutes. In addition to a distraction-free writing experience, you can view monthly trends on your content, get insights into reader traffic and more!

Table of Contents

System Requirements

Installation

You may use composer to install Canvas into your Laravel project:

composer require austintoddj/canvas

Publish the assets and primary configuration file using the canvas:install Artisan command:

php artisan canvas:install

Create a symbolic link to ensure file uploads are publicly accessible from the web using the storage:link Artisan command:

php artisan storage:link

Configuration

After publishing Canvas's assets, a primary configuration file will be located at config/canvas.php. This file allows you to customize various aspects of how your application uses the package.

Canvas exposes its UI at /canvas by default. This can be changed by updating either the path or domain option:

/*
|--------------------------------------------------------------------------
| Base Domain
|--------------------------------------------------------------------------
|
| This is the subdomain where Canvas will be accessible from. If the
| domain is set to null, Canvas will reside under the defined base
| path below. Otherwise, this will be used as the subdomain.
|
*/

'domain' => env('CANVAS_DOMAIN', null),

/*
|--------------------------------------------------------------------------
| Base Path
|--------------------------------------------------------------------------
|
| This is the URI where Canvas will be accessible from. If the path
| is set to null, Canvas will reside under the same path name as 
| the application. Otherwise, this is used as the base path.
|
*/

'path' => env('CANVAS_PATH_NAME', 'canvas'),

Sometimes, you may want to apply custom roles or permissions when accessing Canvas. You can create and attach any additional middleware here:

/*
|--------------------------------------------------------------------------
| Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be attached to every route in Canvas, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with the list.
|
*/

'middleware' => [
    'web',
],

Canvas uses the storage disk for media uploads. You may configure the different filesystem options here:

/*
|--------------------------------------------------------------------------
| Storage
|--------------------------------------------------------------------------
|
| This is the storage disk Canvas will use to put file uploads. You may
| use any of the disks defined in the config/filesystems.php file and
| you may also change the maximum upload size from its 3MB default.
|
*/

'storage_disk' => env('CANVAS_STORAGE_DISK', 'local'),

'storage_path' => env('CANVAS_STORAGE_PATH', 'public/canvas'),

'upload_filesize' => env('CANVAS_UPLOAD_FILESIZE', 3145728),

Roles & Permissions

Canvas has 3 pre-defined roles:

  • Contributor (Somebody who can write and manage their own posts but cannot publish them)
  • Editor (Somebody who can publish and manage posts including the posts of other users)
  • Admin (Somebody who can do everything and see everything)

When you install a fresh version of Canvas, you'll have a default admin user set up automatically. From there, you can perform any basic CRUD actions on users, as well as assign their various roles.

Features

Note: The following features are completely optional, you are not required to use them.

Frontend

Want a beautiful, Medium.com-inspired frontend? Use the canvas:ui Artisan command to install the scaffolding:

php artisan canvas:ui

After generating the frontend scaffolding, your package.json file will include the necessary dependencies to install and compile:

# Using NPM
npm install
npm run dev

# Using Yarn
yarn
yarn dev

That's it! You can navigate to /canvas-ui and check it out for yourself. You're free to modify any aspect of it that you'd like.

Unsplash Integration

Want access to the entire Unsplash library? Set up a new application at https://unsplash.com/oauth/applications, grab your access key, and update config/canvas.php:

/*
|--------------------------------------------------------------------------
| Unsplash Integration
|--------------------------------------------------------------------------
|
| Visit https://unsplash.com/oauth/applications to create a new Unsplash
| app. Use the confidential Access Key given to you to integrate with
| the API. Note that demo apps are limited to 50 requests per hour.
|
*/

'unsplash' => [
    'access_key' => env('CANVAS_UNSPLASH_ACCESS_KEY'),
]

Weekly Digest

Want a weekly summary? Canvas allows users to receive a weekly summary of their authored content. Once your application is configured for sending mail, update config/canvas.php:

/*
|--------------------------------------------------------------------------
| E-Mail Notifications
|--------------------------------------------------------------------------
|
| This option controls e-mail notifications that will be sent via the
| default application mail driver. A default option is provided to
| support the notification system as an opt-in feature.
|
|
*/

'mail' => [
    'enabled' => env('CANVAS_MAIL_ENABLED', false),
]

Since the weekly digest runs on Laravel's Scheduler, you'll need to add the following cron entry to your server:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Updates

Canvas follows Semantic Versioning and increments versions as MAJOR.MINOR.PATCH numbers.

  • Major versions will contain breaking changes, so follow the upgrade guide for a step-by-step breakdown
  • Minor and patch versions should never contain breaking changes, so you can safely update the package by following the steps below:

You may update your Canvas installation using composer:

composer update

Run any new migrations using the canvas:migrate Artisan command:

php artisan canvas:migrate

Re-publish the assets using the canvas:publish Artisan command:

php artisan canvas:publish

To keep the assets up-to-date and avoid issues in future updates, you may add the canvas:publish command to the post-update-cmd scripts in your application's composer.json file:

{
    "scripts": {
        "post-update-cmd": [
            "@php artisan canvas:publish --ansi"
        ]
    }
}

Contributing

Thank you for considering contributing to Canvas!

You can open a completely prebuilt, ready-to-code development environment using Gitpod.

Open in Gitpod

Alternatively, you can use the contribution guide to assist you in manually setting up an environment on your own machine.

One of the ongoing goals for Canvas is to make it as accessible as possible. If you come across any translation mistakes or issues and want to make a contribution, please create a pull request. If you don't see your native language included in the resources/lang directory, feel free to add it.

Testing

Run the tests with:

composer test

License

Canvas is open-sourced software licensed under the MIT license.

Credits

canvas's People

Contributors

austintoddj avatar talvbansal avatar reliq avatar nticaric avatar fergthh avatar foxted avatar albertoelias123 avatar naoray avatar rdelorier avatar laravel-shift avatar naneri avatar patrickadvance avatar mikemand avatar lszanto avatar darival avatar hpez avatar nickbasile avatar yo1l avatar padarom avatar erikgall avatar imusicjj avatar thewwwizard avatar robertgarrigos avatar jlaswell avatar hayrican avatar trasigor avatar graigdev avatar itsmysterybox avatar parsingeye avatar jagdanju 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.