sb2g14 / soton_3D_print

3 stars 0 forks source link

3dprint.clients.soton.ac.uk web site

License GitHub contributers GitHub issues

Installation instruction

Register on the website

  1. Ask the team member to add you to the database.
  2. Register on the website

GitHub

  1. Join GitHub repository (please ask a member of the team to send you an invitation).
  2. Run git clone https://github.com/sb2g14/soton_3D_print

Stack installation

  1. You need to install one of the following stacks:

    WAMP (Windows) -> Windows, Apache, MySQL, PHP

    LAMP (Linux) -> Linux, Apache, MySQL, PHP. (You can find it here: https://tecadmin.net/install-laravel-framework-on-ubuntu/)

    MAMP (Mac OS) -> Mac OS, Apache, MySQL, PHP. (You can find it here: https://www.mamp.info/en/)

    We're currently running ## Apache 2.0, ## PhP 7.1, ## MySql 5.6 and ## Laravel 5.5 so we recommend you to stick to this versions.

MySql setup

  1. Setup the database. Ask a member of the team (Svitlana or Andrew) for the latest dump file containing the database.
  2. Enter MySql: mysql -u username -p;
  3. Create the database: CREATE DATABASE 3dprint_workshop; exit;
  4. Write tables from your dump file: mysql -u username -p 3dprint_workshop < dumpfilename.sql

Running Laravel

  1. Go to the soton_3D_print directory and open .env.example file, write the relevant mysql and mail server information and rename it to .env. Now run following in your terminal:
  2. composer update
  3. php artisan key:generate
  4. php artisan serve
  5. If everything is successful the link to your local host will appear in the terminal window. Normally it's http://127.0.0.1:8000 If you experience any issues please contact us.

Known issues:

Linux error: unable to locate ext-bcmath. Just type this sudo apt install php7.1-bcmath in your terminal. Remember to use the correct version of your php. If you are unsure chek it with php -v.

We recommend you to use JetBrains intelligent IDEs

You need to visit https://www.jetbrains.com/ apply for a student license and then install PhPStorm and DataGrip IDEs to work with PHP and SQL languages.

Running the project

  1. Go to the soton_3D_print php artisan serve copy the link which appeared in the browser.

  2. If you experience any issues try:

    composer update

    composer dumpautoload

    If you still have errors your database might be outdated. Go to 4 and 7 of this installation manual.

Installing NPM

sudo apt install npm

npm install less

sudo apt install node-less

you can now compile less to css using

lessc resources/assets/less/app.less > public/css/app.css

Deploy the project on the RaspberyPi server

The full instruction can be found on the next link, however, several first steps has been done before https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e

So next we present a short instuction what should be done to update the project on server from the github repository

  1. Merge branches master and develop
  2. ssh server@3dprint.clients.soton.ac.uk
  3. cd /var/soton_3D_print/
  4. sudo git pull
  5. sudo composer update
  6. sudo composer dumpautoload -o
  7. sudo php artisan config:cache
  8. sudo php artisan route:cache
  9. cd ..
  10. sudo chmod +x sync.sh
  11. sudo ./sync.sh
  12. Check https://3dprint.clients.soton.ac.uk/ if everything works.

Database updates

Linux/MacOS

See it live:

http://3dprint.clients.soton.ac.uk/printers/index

Get Help on Libraries used:

Style Guidelines we try to follow:

TODO:

License

The MIT license.