/vusa.lt

vusa.lt website

Primary LanguagePHP

Šioje repositorijoje galite rasti VU Studentų atstovybės puslapio kodą. Daugiau apie VU SA.

Daugiau skaitykite diskusijoje, čia.

Kaip susikurti lokalią erdvę, parodyta sekcijoje For start of development

Keletas taisyklių:

  • Commit'ai, branch'ai - tik anglų kalba. Visa kita gali būti pasirinkta kalba - lietuvių arba anglų
  • Jeigu yra noro diegti naują funkciją, būtinai turi įvykti diskusija, projektas ar issue, ir sutarta, kad tokia funkcija bus įdiegiama. Kitu atveju - visiškai negarantuoju, kad funkcija, pakeitimas bus įtrauktas į main šaką.

Puslapį palaiko Justinas Kavoliūnas nuo 2018 m. rugsėjo, iki tol - Mindaugas Taločka.

In English

This is the repo for vusa.lt website. Everyone is welcome to help. :) More about VU SA. Also, read more on the vusa.lt repository: here 😄


For start of development

Laravel Sail, i.e. Docker (Recommended!)

The easiest method to develop. You have to be able to run Docker and PHP (temporarily) on your machine.

Steps:

  1. Clone the repository
  2. Install PHP8 (used only for comoposer and sail setup)
  3. Download composer, run composer update
  4. After updating the repository, run ./vendor/bin/sail up -d
  5. Other setup steps:
    1. Copy .env.example and rename it to .env
    2. ./vendor/bin/sail composer update
    3. ./vendor/bin/sail artisan key:generate
    4. ./vendor/bin/sail npm update
    5. ./vendor/bin/sail npm run dev
    6. ./vendor/bin/sail artisan storage:link
    7. Go to http://localhost:8080 and create database manually, with name vusa, collation utf8mb4_lithuanian_ci.
    8. ./vendor/bin/sail artisan migrate:fresh

For optimal installation you'll also need the SQL file of database records. Please contact @justinaskav for this. I haven't had the time for any seeders.

More instructions on Laravel Sail

On linux

There still should be some prerequisites missing, so I'll update this in time.

UPDATE: The repo is on PHP 8.1, so some steps may not work. If you don't want to run docker, then I'll advise to substitute php8.0 with php8.1.

For Windows computers, WSL is a good and quite a simple solution to use in this case. Installation guide

Prerequisites:

  • PHP 8.0 install. Installation guide
  • After PHP install, install PHP modules: sudo apt install php8.0-curl php8.0-zip php8.0-mbstring php8.0-dom php8.0-sqlite3 php8.0-gd
  • Install Composer v2. Installation guide.
  • Install Node.js. On some computers, simple sudo apt install nodejs could work (check version, if below v14 and on Ubuntu, use this guide

Laravel and vusa.lt installation:

  1. Clone the directory with git: git clone https://github.com/vu-sa/vusa.lt.git will work.
  2. Create a copy of the file ./.env.example and name it .env
  3. Run php composer install or composer install, depending if the Composer is global or not
  4. Run php artisan key:generate
  5. Setup a database (recommended: touch database/database.sqlite)
  6. Run npm install && npm run dev
  7. Run php artisan migrate:fresh --seed
  8. Run php artisan storage:link
  9. Modify your hosts file to direct vusa.testas to 127.0.0.1
  10. php artisan serve
  11. Open vusa.testas:8000

For unit (padalinių) site development

  1. Modify your host file to direct if.vusa.testas to 127.0.0.1. Only if domain is supported for unit site development ATM.
  2. Open if.vusa.testas:8000. Make sure that the server (php artisan serve) is on.

Apache2 configuration

Apache2 is the recommended server for development, since it may resemble the production environment more.

How to setup:

  1. Make sure apache2 is installed (sudo apt install apache2)
  2. Create a vusa.conf file with this body.
<VirtualHost *:80>
        ServerName vusa.testas
        ServerAlias www.vusa.testas if.vusa.testas
        ServerAdmin webmaster@localhost
        DocumentRoot [INSERT YOUR DOCUMENT ROOT, something like .../vusa.lt/public]
        UseCanonicalName OFF

        <Directory [INSERT YOUR DOCUMENT ROOT DIRECTORY, something like .../vusa.lt/]>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
  1. Modify hosts file to have a IPv6 loopback:
127.0.0.1 vusa.testas
::1 vusa.testas
127.0.0.1 if.vusa.testas
::1 if.vusa.testas
  1. Give the www-data user your user group permissions, like sudo usermod -a -G justinas www-data (or fix the permissions yourself, however you want).
  2. Give group write permissions to laravel.log sudo chmod g+w storage/logs/laravel.log
  3. Run sudo a2enmod rewrite && sudo service apache2 restart

If any questions arise how to setup for development, please write to it@vusa.lt 😄