add new readme file

This commit is contained in:
Jonas Leder 2022-05-20 16:44:43 +02:00
parent 5df5d7412e
commit 71ce6ee81b
No known key found for this signature in database
GPG Key ID: CC3C488E27DFF5CA
1 changed files with 33 additions and 1 deletions

View File

@ -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.
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"
```