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
- git.
- Docker Desktop.
- Ubuntu app (Recommended).
- Composer, which can be installed following the Windows installer guidelines.
- Windows Subsystem for Linux 2 (WSL2).
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:
wsl.exe -l -vTo upgrade your existing Linux distro to v2, run:
wsl.exe --set-version (distro name) 2TIP
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.
cd /home/
git clone https://github.com/NFDI4Chem/nmrxiv.git- Go to the project directory:
cd nmrxiv- Navigate to the development branch:
git checkout development- Create an
.envfile, and copy the existing.env.exampleinto it:
cp .env.example .env- Update the dependencies from the
composer.jsonfile:
composer update- Install the dependencies from the
composer.lockfile:
composer install- Start Sail to build application containers on your machine:
./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.
./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.
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.
./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
.envfile.- Open the Minio instance running in your http://localhost:8900
- Login with user -
sailand password -password - Go to Access Keys and create a new access key.
- Create the two buckets with Read Write Access as
nmrxivandnmrxiv-public - Update Filesystem driver and the AWS Keys as below in the
.envfile. Make sure you point yourAWS_URLto 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.
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-publicOnce 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.