doc(feat): add install script instructions to README

This commit is contained in:
Victor Westerlund 2025-08-07 12:59:28 +02:00
parent 97eb39a7c0
commit 6de9e070c2

View file

@ -1,67 +1,27 @@
# vlw.se # vlw.se
This is the source code behind [vlw.se](https://vlw.se) which is my personal website that I have written and designed from the ground up. The website is built on top of my own [web framework](https://vegvisir.vlw.se) and its API is also built on top of my own [API framework](https://reflect.vlw.se). This is the source code behind [vlw.se](https://vlw.se) which is my personal website that I have written and designed from the ground up. The website is built on top of my own [Vegvisir web framework](https://vegvisir.vlw.se) and its optional REST API is built on top of my [Reflect API framework](https://reflect.vlw.se).
# Installation # Installation
Here's how you get my website up and running on your own machine. Note, I have only tested this on Linux and the install script we will run later is written in bash. Here's how you get my website up and running on your own machine. Note, I have only tested this on Linux and the install script we will run requires Bash with `coreutils` installed.
**Make sure you have both of these package managers installed before proceeding:** ## Prerequisites
- [Composer](https://getcomposer.org/) - A web server
- [NPM](https://www.npmjs.com/) - A MariaDB/MySQL server
- PHP 8.4 or newer with the following extensions enabled:
- - `php8.4-mysql`
- - `php8.4-mbstring`
- The composer package manager
- Bash with `coreutils` installed (for the install script)
## 1. Clone this repo ## 1. Clone this repo
Clone/download this repo to your machine. Preferably to a non-public directory - the frameworks will handle that. Clone this repository with its submodules. Preferably to a non-public directory - the frameworks will handle that.
``` ```
git clone https://codeberg.org/vlw/vlw.se --depth 1 git clone https://codeberg.org/vlw/vlw.se --recurse-submodules --depth 1
``` ```
## 2. Install [Vegvisir](https://vegvisir.vlw.se) and [Reflect](https://reflect.vlw.se) ## 2. Run the install script
Follow the installation instructions for my web, and API framework. This site uses the default configuration for both frameworks so the only thing you need to do after you've installed both is to point the `root_path` and `endpoints` directory respectively to the directory where you cloned this repo. Run the `install.sh` script from the root directory of this repository.
- [Vegvisir installation](https://vegvisir.vlw.se)
- [Reflect installation](https://reflect.vlw.se)
*Example:*
```sh
# Vegvisir
root_path = "/var/www/vlw.se"
# Reflect
endpoints = "/var/www/vlw.se"
``` ```
## 3. Run the install script
Run the `install.sh` script from the root of the repo directory. [Make sure you have the required package managers installed](#installation).
**Example:**
```sh
# vlw@example:$
cd /var/www/vlw.se
# vlw@example:/var/www/vlw.se$
./install.sh ./install.sh
``` ```
This script will install and configure Vegvisir, Reflect, and the website through a few propmpted steps.
## 4. Import the database templates
There's are two SQL files in [`/src/Database/Seeds/`](https://codeberg.org/vlw/vlw.se/src/branch/master/src/Database/Seeds) that you can use to initialize the two databases required for this website.
- `vlw` - This database has the website data and should be added to the `db` variable under `server_database` in `/.env.ini`
- `vlw_reflect` - This is the Reflect database that has all the endpoints pre-configured. You'll have to add your own ACL rules.
## 5. Set environment variables
Make a copy of the `.env.example.ini` file called `.env.ini` from the root directory of the repo. There are a few parameters you can change here but the required ones are the following:
```ini
[client_api]
base_url = ""
api_key = ""
[server_database]
host = ""
user = ""
pass = ""
db = ""
```
Please refer to the comments in the ini file for more information about each field.
## Done!
That should be it. Navigate to your configured Vegvisir public host!