Skip to content

provokant/corporadb-laravel

Repository files navigation

CorporaDB

Database for collecting and refining corpus data. SQL database with web interface for users and API for direct SQL requests.

Screenshot of CorporaDB search screen

Installation

git clone https://github.com/nextlevelshit/corpora-db.git
cd corpora-db
yarn # or "npm i"
composer install
mv .env.example .env # configure environment, database credentials etc.
php artisan migrate:install # initiate migrations
php artisan migrate # migrate predefined tables to database
php artisan storage:link # enable public file upload
find /home/corpora/corpora-db/ -type f -exec chmod 644 {} \;  # grant 644 permissions to all files
find /home/corpora/corpora-db/ -type d -exec chmod 755 {} \;  # grant 755 permissions to all folders
chmod -R 775 storage
chmod -R 775 bootstrap/cache
chmod -R u+x node_modules

Composer and PHP have to be installed previously.

Development

0. Seed database

php artisan migrate --seed

# Seeding: StatesTableSeeder
# Seeding: GenresTableSeeder
# Seeding: AuthorsTableSeeder
# Seeding: EntriesTableSeeder

1. Starting local web server

php artisan serve
# Laravel development server started: <http://127.0.0.1:8000>

2. Watch file changes for styles and scripts (SCCS, JS)

Automatically compile, uglify and bundle JS, CSS files and fonts.

npm run watch
# DONE  Compiled successfully in 4779ms
#
#                                                            Asset      Size  Chunks                    Chunk Names
#   fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713    166 kB          [emitted]         
#   fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde    444 kB          [emitted]  [big]  
#   fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9    166 kB          [emitted]         
#  fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad     98 kB          [emitted]         
# fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e   77.2 kB          [emitted]         
#                                                       /js/app.js    857 kB       0  [emitted]  [big]  /js/app
#                                                     /css/app.css    991 kB       0  [emitted]  [big]  /js/app
#                                                mix-manifest.json  66 bytes          [emitted]         
#                                                 js/jquery.min.js   86.7 kB          [emitted]         
#                                             js/foundation.min.js    149 kB          [emitted]         

Production

1. Install migrations

2. Compile scripts and styles

npm run production

# DONE  Compiled successfully in 11152ms
#
#                                                            Asset      Size  Chunks                    Chunk Names
#   fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713    166 kB          [emitted]         
#   fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde    444 kB          [emitted]  [big]  
#   fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9    166 kB          [emitted]         
#  fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad     98 kB          [emitted]         
# fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e   77.2 kB          [emitted]         
#                                                       /js/app.js    176 kB       0  [emitted]         /js/app
#                                                     /css/app.css    108 kB       0  [emitted]         /js/app
#                                                mix-manifest.json  66 bytes          [emitted]         
#                                                 js/jquery.min.js   86.7 kB          [emitted]         
#                                             js/foundation.min.js    149 kB          [emitted]

3. Grant permissions to generated files

After generating CSS, JS and Font files they have to get the right permissions:

find /home/corpora/corpora-db/public -type f -exec chmod 644 {} \;  # grant 644 permissions to all files
find /home/corpora/corpora-db/public -type d -exec chmod 755 {} \;  # grant 755 permissions to all folders

Configurations

cp .env.example .env # copy environment variables for productive usage

After copied .env.example to .env the environment variables are active. This file should not be versioned, because it contains database credentials etc. Inside the prefilled environment variables the database settings are configurated for a Homestead setup. You can also use an ordinary MySQL sever to hold your data.

File Structure

As framework we are using Laravel 5.4 and serving from a self hosted server. For now this software is heavily under construction.

.env ----------------| stores database credentials etc.
app/ ----------------| main application files
  Http/ -------------| processing http requests
    Controllers/ ----| main controllers for application
    Provides/ -------| connecting routes with controllers
config/ -------------| general configurations
database/ -----------| database settings
  factories/ --------| generating automated seeds for database
  migrations/ -------| creating new database tables
  seeds/ ------------| automatically fill database
public/ -------------| distributed folder (DO NOT CHANGE MANUALLY)
resources/ ----------| resources necessary for the front end only
  lang/ -------------| translations for system wide notifications etc.
  views/ ------------| blade (template engine) files
    components/ -----| partial templates for extending inside layout files
routes/ -------------|
  web.php -----------| stores routes for browser requestes

Optional: Enabling Git Hooks

To provide all markdown files also as human readable PDF files use the following git-hook:

rm -rf .git/hooks && ln -s ../.hooks .git/hooks

Authors

Michael Werner Czechowski (Planning, Programming): mail@dailysh.it

Claus-Michael Schlesinger (Planning, Coordinator): claus-michael.schlesinger@ilw.uni-stuttgart.de

License

This software is distributed under GNU GPL.

About

No description or website provided.

Topics

Resources

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE.md
Unknown
LICENSE.pdf

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published