Skip to content

Ubuntu

nmrXiv project is built with Laravel web application framework which comes with Sail, a built-in solution for running your Laravel project using Docker. The whole project is a package of below services and features.

Ubuntu 20.04

Dependencies

Setup:

  • Start Docker.
  • Open your chosen directory in the terminal.
  • Clone the project from Github by running:
bash
git clone https://github.com/NFDI4Chem/nmrxiv.git
git clone https://github.com/NFDI4Chem/nmrxiv.git
  • Go to the project directory:
bash
cd nmrxiv
cd nmrxiv
  • Navigate to the development branch:
bash
git checkout development
git checkout development
  • Create an .env file, and copy the existing .env.example into it:
bash
cp .env.example .env
cp .env.example .env
  • Update the dependencies from the composer.json file:
bash
composer update
composer update
  • Install the dependencies from the composer.lock file:
bash
composer install
composer install
  • Start Sail to build application containers on your machine:
bash
./vendor/bin/sail up
./vendor/bin/sail up
  • Run the below command to migrate the database with some dummy values. Don't forget to note down the admin's user id and password provided at the end of migration output.
bash
./vendor/bin/sail artisan migrate:refresh --seed
./vendor/bin/sail artisan migrate:refresh --seed
  • Open another terminal and run the below command to boot up your local static web server.
bash
npm install && npm run dev
npm install && npm run dev
  • For all background jobs to run, nmrXiv is powered with Redis and packaged with Horizon. Run the below command to publish all the jobs and start the worker for the background jobs to execute.
bash
./vendor/bin/sail artisan horizon:publish
./vendor/bin/sail artisan horizon
./vendor/bin/sail artisan horizon:publish
./vendor/bin/sail artisan horizon
  • To configure file object storage, you should have Minio instance already running in your local(for more details check your docker-compose file). For the first time you have to generate the Access Keys, create the buckets and configure that in your .env file.
    • Open the Minio instance running in your http://localhost:8900
    • Login with user - sail and password - password
    • Go to Access Keys and create a new access key.
    • Create the two buckets with Read Write Access as nmrxiv and nmrxiv-public
    • Update Filesystem driver and the AWS Keys as below in the .env file. Make sure you point your AWS_URL to Minio API which is running in port 9000. Please define both the public and private driver. The public bucket is used to store all the files which can be publicly accessible through out the application, such as profile & project images. All the private files uploaded by the user will end up in the private bucket.
bash
FILESYSTEM_DRIVER=minio
FILESYSTEM_DRIVER_PUBLIC=minio_public

AWS_ACCESS_KEY_ID==**********
AWS_SECRET_ACCESS_KEY===**********
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=nmrxiv
AWS_ENDPOINT=http://localhost:9000/
AWS_URL=http://localhost:9000/
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_BUCKET_PUBLIC=nmrxiv-public
FILESYSTEM_DRIVER=minio
FILESYSTEM_DRIVER_PUBLIC=minio_public

AWS_ACCESS_KEY_ID==**********
AWS_SECRET_ACCESS_KEY===**********
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=nmrxiv
AWS_ENDPOINT=http://localhost:9000/
AWS_URL=http://localhost:9000/
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_BUCKET_PUBLIC=nmrxiv-public

Once the application's Docker containers have been started, you can access the application in your web browser at http://localhost. But first, you will be prompted to Generate app key. After pressing the generation button, the following message is shown on the screen: "The solution was executed successfully. Refresh now." After refreshing, you access the application.

Recommendation

Follow our code contribution guidelines to make a pull request.

Info

Click to learn more about Laravel and installation guides.