From 71ce6ee81b6b2a3adf34b9d9ce496fa44911e8fc Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Fri, 20 May 2022 16:44:43 +0200 Subject: [PATCH] add new readme file --- Readme.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 4342b1f..a47b1eb 100644 --- a/Readme.md +++ b/Readme.md @@ -1,2 +1,34 @@ # Website -In this repository is the sourcecode of my website. The page is build using static HTML files with dynamic WebComponents, to add content to the page which is the same on every page, like the header with the navigation menue or the footer. For the stylesheet I used SCSS in the past, but switched to style, because of braking changed in October 2022. The Website is build by a CI job on the Server and then deployed as Docker Container. As Webserver the Container uses nginx with PHP8 for the API. All staic files like Archives to download are located on a S3 Server. \ No newline at end of file +This is the repo containing my personal website. It is based on simple HTML pages, with custom HTML componetes, for things like header and footer. The components are written in pure CS and compiled with webpackt to one big file. In this step also the dependencies are getting injected. Stylesheets are written in stylus and then compiled to CSS in the build process. For the backend there is a GraphQL endpoint at `/API/graphql.php` which holds most of the resources, for files (ebay images and S3) there are seperate endpoints in the API directory. Comments and the blog ist stored in a MySQL Database. + +## Dev-Setup +### Requirements +* NodeJS +* Yarn +* PHP 8 with the following extensions: + * mysqli + * mbstring + * curl + * simplexml +* Composer + +### Setup +1. Install the node dependencies: `yarn install` +2. Install the PHP depdendencies: `composer install` +3. Start the dev environment: `yarn watch` +This will start the compile service for the JavaScript and the stylus files and also start a PHP dev server on port 1234 + +## Production-Setup +For production there is a docker images with the following name available: `gitlab.jonasled.de/jonasled/website:latest`. The configuration is stored in the config PHP, a example file is available in this repo in the `/public/API/lib` folder. Later this file has to be mounted at `/var/www/html/API/lib/config.php` A example compose could look like this: +```yaml +version: '3.2' + +services: + website: + image: gitlab.jonasled.de/jonasled/website:latest + restart: always + volumes: + ./config.php:/var/www/html/API/lib/config.php + ports: + - "80:80" +``` \ No newline at end of file