Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #10

Merged
merged 24 commits into from
Dec 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update getting_started.md with some extra info
byjg committed Dec 9, 2023
commit 74723dd1e054cf838ea65b259649feea10c205ae
39 changes: 39 additions & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Getting Started

## Requirements

Docker engine, PHP and an IDE.

You'll need PHP 8.1 or higher installed in your machine. Preferrable the same version as you want to work with your project.

Required PHP extensions:
- ctype
- curl
- dom
- filter
- hash
- json
- libxml
- mbstring
- openssl
- pcre
- pdo
- pdo_mysql
- phar
- simplexml
- tokenizer
- xml
- xmlwriter

## Installation

```bash
@@ -32,6 +57,14 @@ Timezone [UTC]:
Press <ENTER> to continue
```

Tip: The docker composer will create MySQL container named as `mysql-container` ([ref](https://github.com/byjg/php-rest-template/blob/master/docker-compose-dev.yml#L20)).
If you want to be able to access your MySQL container from your machine you need to add the following entry in your `/etc/hosts` file:

```
127.0.0.1 mysql-container
```


## Running the Project

```bash
@@ -44,6 +77,10 @@ docker-compose -f docker-compose-dev.yml up -d
```bash
# Important this will destroy ALL DB data and create a fresh new database based on the migration
APP_ENV=dev composer run migrate -- reset --yes

# *IF* your local PHP is not properly setup you can run this instead:
# export CONTAINER_NAME=# it is the second part of the composer name. e.g. me/myrest, it should be "myrest"
# docker exec -it $CONTAINER_NAME composer run migrate -- reset --yes
```

The result should be:
@@ -71,6 +108,8 @@ The result:

```bash
APP_ENV=dev composer run test # Alternatively you can run `./vendor/bin/phpunit`

# OR: docker exec -it $CONTAINER_NAME composer run test
```

## Accessing the Swagger Documentation