The PHP2 assignment of InHolland.
This part helps you get started with the PHP2 assignment. Please follow it carefully, and don't hesitate to reach out if you have any questions.
To get started I expect you to have the following things installed:
- Node JS (14 or later) Download Node
- Docker engine v1.13 or higher. Your OS provided package might be a little old, if you encounter problems, do upgrade. See https://docs.docker.com/engine/installation
- Docker compose v1.12 or higher. See docs.docker.com/compose/install
For your first run you will need to install some dependencies, this should be pretty straight forward.
Open your terminal and go to this directory, then type the following:
npm install
# Or...
yarn
Installing these packages might take a while, so please wait till this finishes.
Open your terminal and go to this directory, then type the following:
docker-compose up -d
You can run the project using the following commands:
# Start the development ENV for TS and SCSS
npm run dev
# Or...
yarn dev
This will watch for changes to the typescript and SCSS files, and automatically compile them.
# Start the Web server (Starts the docker containers)
docker-compose up -d
You can access your application via localhost
, if you're running the containers directly.
Service | Address outside containers |
---|---|
Webserver | localhost:3000 |
You'll need to configure your application to use any services you enabled:
Service | Hostname | Port number |
---|---|---|
php-fpm | php-fpm | 9000 |
For more information about the docker environment see DOCKER.md
This is the codebase for the PHP2 assignment, this section contains more information in regards to the codebase.
For this assignment I used several techniques, the main ones are listed here:
- TypeScript
- SCSS
- PHP 8
php2-assignment/
├── .vscode # Files related to the behavior of VSCode
├── webpack.config.js # The build config for the project
├── phpdocker # Docker container configs
├── src # Front-end code that needs to get compiled by webpack
├── scss # The SCSS code of the application
└── ts # The TypeScript code of the application
├── controller # The controller layer of the MVC pattern
├── db # The database layer, responsible for interacting with the DB
├── model # The model layer of the MVC pattern
├── public # Files inside this folder get served to the browser
├── index.php # The main file of the application
├── api # API endpoints for the application
└── assets # Static resources such as JS, CSS and images
└── views # The View layer of the MVC pattern.
└── components # Components for the views