You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-31Lines changed: 34 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,52 +27,58 @@ Documentation is available at: https://docs.dotkernel.org/api-documentation/
27
27
28
28
## Getting Started
29
29
30
-
##Step 1: Clone the project
30
+
###Clone the project
31
31
32
-
Using your terminal, navigate inside the directory you want to download the project files into. Make sure that the directory is empty before proceeding to the download process. Once there, run the following command:
32
+
Using your terminal, navigate inside the directory you want to download the project files into.
33
+
Make sure that the directory is empty before proceeding to the download process.
34
+
Once there, run the following command:
33
35
34
36
```shell
35
37
git clone https://github.com/dotkernel/api.git .
36
38
```
37
39
38
-
##Step 2: Install project's dependencies
40
+
### Install the project dependencies
39
41
40
42
```shell
41
43
composer install
42
44
```
43
45
44
-
##Step 3: Development mode
46
+
###Development mode
45
47
46
-
If you're installing the project for development, make sure you have development mode enabled, by running:
48
+
> **Do not enable development mode in production!**
49
+
50
+
If you're installing the project for development, you should **enable** development mode, by running:
47
51
48
52
```shell
49
53
composer development-enable
50
54
```
51
55
52
-
You can disable development mode by running:
56
+
You can **disable** development mode by running:
53
57
54
58
```shell
55
59
composer development-disable
56
60
```
57
61
58
-
You can check if you have development mode enabled by running:
62
+
You can **check**development status by running:
59
63
60
64
```shell
61
65
composer development-status
62
66
```
63
67
64
-
##Step 4: Prepare config files
68
+
###Prepare config files
65
69
66
70
* duplicate `config/autoload/cors.local.php.dist` as `config/autoload/cors.local.php` <- if your API will be consumed by another application, make sure configure the `allowed_origins`
67
71
* duplicate `config/autoload/local.php.dist` as `config/autoload/local.php`
68
-
* duplicate `config/autoload/mail.local.php.dist` as `config/autoload/mail.local.php` <- if your API will send emails, make sure you fill in SMTP connection params
69
72
***optional**: in order to run/create tests, duplicate `config/autoload/local.test.php.dist` as `config/autoload/local.test.php` <- this creates a new in-memory database that your tests will run on
70
73
71
-
## Step 5: Setup database
74
+
### Setup database
75
+
76
+
Use an existing empty one or create a new **MariaDB**/**MySQL** database.
77
+
78
+
> Recommended collation: `utf8mb4_general_ci`.
72
79
73
-
## Running migrations
80
+
####Running migrations
74
81
75
-
* create a new MySQL database - set collation to `utf8mb4_general_ci`
76
82
* fill out the database connection params in `config/autoload/local.php` under `$databases['default']`
77
83
* run the database migrations by using the following command:
This command will prompt you to confirm that you want to run it:
84
90
85
-
> WARNING! You are about to execute a migration in database "..." that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
91
+
> WARNING! You are about to execute a migration in database "`<database>`" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
86
92
87
93
Hit `Enter` to confirm the operation.
88
94
89
-
## Executing fixtures
95
+
####Executing fixtures
90
96
91
-
**Fixtures are used to seed the database with initial values and should be executed after migrating the database.**
97
+
Fixtures are used to seed the database with initial values and must be executed after migrating the database.
92
98
93
99
To list all the fixtures, run:
94
100
@@ -110,29 +116,26 @@ To execute a specific fixture, run:
More details on how fixtures work can be found here: https://github.com/dotkernel/dot-data-fixtures#creating-fixtures
119
+
More details on how fixtures work can be found in `dotkernel/dot-data-fixtures`[documentation](https://github.com/dotkernel/dot-data-fixtures#creating-fixtures).
120
+
121
+
### Mail configuration
122
+
123
+
If your application will send emails, you must configure an outgoing mail server under `config/autoload/mail.global.php`.
124
+
125
+
### Test the installation
114
126
115
-
## Step 6: Test the installation
127
+
Run the following command in your project's directory to start PHPs built-in server:
116
128
117
129
```shell
118
130
php -S 0.0.0.0:8080 -t public
119
131
```
120
132
121
-
Sending a GET request to the [home page](http://0.0.0.0:8080/) should output the following message:
133
+
> Running command `composer serve` will do the same thing, but the server will time out after a couple of minutes.
122
134
123
-
```text
135
+
Sending a **GET** request to the application's [home page](http://localhost:8080/) should output the following message:
136
+
137
+
```json
124
138
{
125
-
"message": "Dotkernel API version 5"
139
+
"message": "Dotkernel API version 6"
126
140
}
127
141
```
128
-
129
-
## Documentation
130
-
131
-
In order to access Dotkernel API documentation, check the provided [readme file](documentation/README.md).
132
-
133
-
Additionally, each CLI command available has it's own documentation:
0 commit comments