Skip to content

php-school/phpschool.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Install

You will need composer, node and docker.

npm install
npm run build
cp .env.dist .env
docker-compose build

Run

docker-compose up -d
docker compose exec php composer install

Create DB Scheme

docker compose exec php composer app:db:update

Import DB

docker-compose exec -T db mysql -uroot phpschool -proot < phpschool.sql

Generate Blog

docker compose exec php composer app:gen:blog

Then navigate to http://localhost !

Build CSS & JS

This needs to be done for the main website (non cloud) to run in development mode.

npm run build

Building CSS & JS for cloud dev

The cloud styles and JS are built using vite.js and therefore has a dev/watcher mode with hot/live reloading.

Run:

npm run dev

You will also need to symlink the image directory:

ln -s ../../assets/img/cloud public/img/cloud

For GitHub login

Add 127.0.0.1 www.phpschool.local to /etc/hosts

Create a GitHub oauth App:

Application Name: PHP School Local Homepage: http://www.phpschool.local Authorization Callback URL: http://www.phpschool.local/student-login:

Take the client secret and client ID and place them in your .env file under the keys: GITHUB_CLIENT_ID & GITHUB_CLIENT_SECRET.

View cache keys

docker-compose exec redis redis-cli keys '*'

Clear cache

docker-compose exec php composer app:cc

Deploy

You will need capistrano installed and SSH access to the production server.

cap production deploy

Production deploy requisites

Letsencrypt certs should be setup and located in /etc/letsencrypt

Make sure .env file exists in shared folder. You can use env.dist as an example.