The full Windows dev env is highly recommended for large development tasks. However, If you are not into configuring WSL2 and Docker, and you don't need a development environment that closely resembles the live environment, you may be interested in using Herd to host the site directly on your host system.
Install Herd
Herd is a fast, native Laravel and PHP development environment for Windows. It provides everything that you need to get started with Laravel development. It ships with PHP, nginx, and Node.js.
Download it from here and install:
https://herd.laravel.com/windows
Configure Herd
Once Herd is installed open the settings and
- Under the General tab, add a Herd path that should be used to serve sites from.
For example:C:\Users\USER\Sites
. Ensure this directory exists. - Under the PHP tab, ensure that PHP v8.3 is installed
- Under the Node tab, ensure that Node v22 is installed
Clone Forge
Pull down a clone of the Forge source locally within your Herd path. You can use your favourite Git client, or a Powershell terminal with the following commands*:
cd C:\Users\USER\Sites
git clone https://github.com/sp-tarkov/forge.git forge
cd forge
git checkout develop
git lfs pull
*Obviously, git is required for running these git commands. If needed, download and install it and restart Powershell.
Prepare Environment
In Powershell:
cd C:\Users\USER\Sites
# Install Composer dependencies
composer install
# Install Node dependencies
npm install
# Generate an application key
php artisan key:generate
# Create an empty SQLite data file
ni database\database.sqlite
Next open up the Forge project in your favourite IDE (we recommend PhpStorm). Open the .env.light
file located in the root of the project. You need to save this file as .env
. Once that's copied, locate the DB_DATABASE
variable and ensure that it is set to the full, absolute path to the data file that we generated in the previous step.
Create & Populate Database Tables
Run the following command to create each of the database tables and seed them with fake testing data.
php artisan migrate:fresh --seed
Vite Development Server
There is a front-end development server that manages hot-injecting files as they're updated so that you rarely have to refresh the page after a file is updated to see your changes. Start it with the following command:
npm run dev
Finished!
You should now be able to access the Forge:
http://forge.test
However...
There are notable differences when using this environment when compared to the full environment. It's important to understand these differences. The production server operates using the same stack as the full environment, while this light environment is configured to only use as many built-in drivers as possible to ensure that a developer can get up and running with as little set-up as possible.
- The full environment uses Laravel Octane, which boots the application once, keeping it in memory, and then feeds it requests at much faster rate. This is great, but strays from a typical PHP life-cycle where the application is built and then subsequently torn down for each request. There are a few caveats regarding dependency injection and static data that you should read over.
- The
artisan import-hub
command uses temporary SQL tables and will not work without the MySQL driver. - The full environment uses a Redis based queue-worker system called Laravel Horizon, while this light environment will ignore the queue and execute the job immediately within the current request.
- Sessions and caches are stored in Redis on the full environment and in files on the light environment.
- On the full environment, Laravel Scout is configured to use Meilisearch, a fast and relevant search engine. The light environment uses a 'collection' driver that does it best to emulate a search engine. The results between the two will be different.