No description
Find a file
Michel bfeb2a6e2a
All checks were successful
/ build (push) Successful in 36s
Merge remote-tracking branch 'origin/master'
2024-11-12 20:36:10 +01:00
.forgejo/workflows Adds missing bash to sudo 2024-11-07 18:38:11 +01:00
config Adds loggin 2024-11-07 22:05:24 +01:00
deploy Specify php version for proxy gen 2024-11-07 22:52:08 +01:00
src Merge pull request 'Add_Git_Notification' (#23) from Add_Git_Notification into develop 2024-11-12 19:05:05 +00:00
.gitignore I rightly do not know what this all is 2024-10-30 19:40:26 +01:00
composer.json Adds loggin 2024-11-07 22:05:24 +01:00
composer.lock Adds loggin 2024-11-07 22:05:24 +01:00
package-lock.json Adds share feature 2024-10-31 15:34:57 +01:00
package.json Adds share feature 2024-10-31 15:34:57 +01:00
README.md Adds README 2024-11-12 20:35:09 +01:00
tsconfig.json I rightly do not know what this all is 2024-10-30 19:40:26 +01:00
webpack.config.js Adds proper safety for prod and added option for SSL 2024-11-07 21:38:48 +01:00

Games Shop

This is the repository for the free games shop hosted on shop.iedsoftworks.com.

Developers and local testers

To start a local variant of the site, you need Docker (with docker compose).

1 Cloning the repo

Start with cloning the repository

git clone https://git.php.fail/neintonine/gamesshop.git

and entering the folder for it

cd gamesshop

2 Installing dependencies

Then you need to install/build the NPM and composer portion. There are two ways of doing it.

2.1 Local NPM & Composer

If you have NodeJS and PHP8.3 with composer installed, you can simply run:

npm install && npm run build && composer install

2.2 Docker

If you don't have those installed, and are unwilling to install them, you can use docker to install and build the required packages.

JS: docker run --rm --volume "$PWD":/app -w /app node npm install && npm run build

PHP: docker run --rm --volume "$PWD":/app -w /app composer composer install --ignore-platform-req=ext-gd

3 Creating the environment file

To run the site, you need a valid environment file.

3.1 Copy the example

Under the folder 'config', you can find a .env.example-file, which you can use to create your enviroment file. Start of by coping the file, and rename it to .env

cp config/.env.example config/.env

The example already includes settings for the database and logs.

3.2 Adding your Discord-App

One thing, that the example doesn't contain is the discord app. Thats something you need to add. Simply create an app in the Discord Developer Portal and add the required values in the environment file

4 Creating the Database

Now after ensuring you have the dependencies and a valid environment file, we can create the database.

Again, if you have PHP installed you can just do: php ./src/php/bin/doctrine.php orm:schema-tool:create

If you don't want to do this, just let docker to do it:

docker run -v .:/app --rm -it php:8.3-cli php /app/src/php/bin/doctrine.php orm:schema-tool:create

5 Running the containers

Now finally, after creating the database, just go into the deploy folder (cd deploy) and start the compose file.

You may see, that there are two file (docker-compose.yaml and docker-compose-dev.yml). As you may expect the second is for local development so probably the one you should use. The first does effectively the same thing, but for the production environment.

docker compose -f ./docker-compose-dev.yml up

Congratulations! The website should now boot up and after docker is done downloading, you should be able to use http://localhost:8080 to open the page.