Skip to content

Windows

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.

Dependencies

Make sure to enable and install WSL, and to upgrade it to WSL2 as described in the guidelines. WSL allows you to run Linux binary executables natively on Windows 10.

To check the WSL mode, open Windows Powershell and run:

bash
wsl.exe -l -v
wsl.exe -l -v

To upgrade your existing Linux distro to v2, run:

bash
wsl.exe --set-version (distro name) 2
wsl.exe --set-version (distro name) 2

TIP

After installing and enabling WSL2, you should ensure that Docker Desktop is configured to use the WSL2 backend.

Setup:

  • Start Docker.
  • Open Ubuntu shell and clone the repo using the below command to your home directory. We recommend running the project from your Linux directory and not from your local windows file system, for faster compilation and execution.
bash
cd /home/
git clone https://github.com/NFDI4Chem/nmrxiv.git
cd /home/
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
  • Make sure you have node version > 16 installed in your WSL. 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 can access the application.

Run code . to open the code base to your VSCode editor. Thanks to Vite that any changes you make to the javascript file would be reflected in your browser immediately without requiring any refresh.

Recommendation

Follow our code contribution guidelines to make a pull request.

Info

Click to learn more about Laravel and installation guides.