Giter Club home page Giter Club logo

parf-edhellen's Introduction

Parf Edhellen

This is the source code for elfdict.com, a non-profit, free dictionary online for Tolkien's languages. Maintained by Leonard Wickmark. Follow me on twitter at @parmaeldo.

Version 71 (model 4.0 incl. migrations) is in production.

Configuration

Ensure that the following dependencies are installed:

php7.3 php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-mbstring php7.3-mysql php7.3-readline php7.3-xml php7.3-zip

Installation is relatively easy:

  1. Configure the database using the model files. Execute the script files in ascending order, starting with schema.sql
  2. Shut down your web server
  3. Configure your web server to serve the src/public directory.
  4. Make src/storage writeable.
  5. Review the application's .env configuration
  6. Compile stylesheets and JavaScript assets.
  7. Cache sysconfig and routing configuration.
  8. Create a symlink to the storage directory (for avatars)

Always make sure to follow Laravel's guidelines and best practices before moving the app into production.

chmod -R o+w project/storage # step 4
cp .env.example .env         # step 5
vim .env                     # step 5
php artisan key:generate      
npm run production           # step 6
php artisan config:cache     # step 7 
php artisan route:cache      # step 7
php artisan storage:link     # step 8

Want to help out?

If you are interested in helping out, please get in touch with galadhremmin. You can also help us by donating. Please visit elfdict.com for more information.

I'd like to thank JetBrains for supporting ElfDict by giving us their excellent PHPStorm for free.

Documentation

Audit trail

The audit trail consists of activities. Activities are specified as constants within the App\Models\AuditTrail class, and utilised throughout the application. The App\Repositories\AuditTrailRepository contains the necessary functionality for converting activities (which are integers) into human-readable strings.

Note: audit trail model objects with the property is_admin set to 1 (= true) can only be seen by administrators.

Cookies

The following cookie names are used by the application:

Cookie name Description
ed-usermode Administrators can give a cookie with this name the value incognito to hide their activity.

System errors

The schema system_errors contain information about client-side as well as server-side exceptions. Common exceptions (404 Page not found, 401 Unauthorized, etc.) are separated from the rest by the is_common column.

Uncaught client-side exceptions are caught by the onerror event, passed to a web API, and logged. Refer to the API documentation for more information.

Coding style

  • \t must be replaced with four spaces for JavaScript and PHP, else two spaces.

  • PHP is written in camelCase with exception for classes and interfaces, which are capitalized.

  • SQL is written in upper case.

  • Always a single space between statements, brackets and paranthesis.

  • Curly brackets are positioned on a new line for methods, interfaces and classes, else the first bracket is positioned on the same line as the clause. Example:

    class A
    {
        public function sayHello() 
        {
            if (empty($this->_name)) {
                echo 'Hello!';
            } else {
                echo 'Hello, '.$this->_name;
            }
        }
    }
    
  • Conditional operators are restricted to one line, unless the resulting operation is long enough to warrant a split, at which point the first new line is positioned before the question mark, and the second one new line before the colon. Example:

    {
        $fruitName = $fruit instanceof Apple ? 'apple' : 'fruit';
        $customer = $fruit instanceof Apple
            ? FruitVendor::sell($fruit, $appleAdvert, true) 
            : FruitVendor::discard($fruit);
    }
    

The source code is provided as-is. The code does not, in any shape or form, reflect best coding practices; it's a non-profit hobby project of mine.

License

ElfDict (Parf Edhellen; elfdict.com) is licensed in accordance with AGPL.

parf-edhellen's People

Contributors

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