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
+98-21Lines changed: 98 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,27 +40,104 @@ Try it!! We are happy to hear your feedback or any kind of new features.
40
40
-**Integrated Testing Tool** thanks to [Wallaby.js](https://wallabyjs.com/)
41
41
42
42
## Getting Started
43
-
### Prerequisites
44
-
* Install [Node.js](http://nodejs.org)
45
-
* on OSX use [homebrew](http://brew.sh)`brew install node`
46
-
* on Windows use [chocolatey](https://chocolatey.org/)`choco install nodejs`
47
-
* Install yarn globally `npm install yarn -g`
48
-
49
-
### Installing
50
-
*`fork` this repo
51
-
*`clone` your fork
52
-
*`cp .env.example .env` to copy the example .env file and enter your database connection
53
-
* Create a new database. You will find the name in the .env file.
54
-
* Run `npm run setup` or enter the following commands manually:
55
-
*`yarn install` to install all dependencies and typings.
56
-
*`npm run db:migrate` to create the schema.
57
-
*`npm run db:seed` to insert some test data.
58
-
*`npm run serve` to start the application.
59
-
60
-
### Running the app
61
-
After you have installed all dependencies you can run the app.
62
-
Enter `npm run serve` to start a local server using `nodemon`, which will watch for any file changes and will restart the sever according to these changes.
63
-
The server address will be displayed to you as `http://0.0.0.0:3000`.
43
+
### Step 1: Set up the Development Environment
44
+
You need to set up your development environment before you can do anything.
45
+
46
+
Install [Node.js and NPM](https://nodejs.org/en/download/)
47
+
* on OSX use [homebrew](http://brew.sh)`brew install node`
48
+
* on Windows use [chocolatey](https://chocolatey.org/)`choco install nodejs`
49
+
50
+
Install yarn globally
51
+
```
52
+
npm install yarn -g
53
+
```
54
+
55
+
Install a MySQL database.
56
+
57
+
> If you work with a mac, we recommend to use homebrew for the installation.
58
+
59
+
### Step 2: Create new Project
60
+
Fork or download this project. Configure your package.json for your new project.
61
+
62
+
Then copy the `example.env` file and rename it to `.env`. In this file you have to add your database connection information.
63
+
64
+
Create a new database with the name you have in your `.env`-file.
65
+
66
+
Then setup your application environment.
67
+
```
68
+
npm run setup
69
+
```
70
+
71
+
> This installs all dependencies with yarn. After that it migrates the database and seeds some test data into it. So after that your development environment is ready to use.
72
+
73
+
### Step 3: Serve your App
74
+
Go to the project dir and start your app with this npm script.
75
+
```
76
+
npm run serve
77
+
```
78
+
79
+
> This starts a local server using `nodemon`, which will watch for any file changes and will restart the sever according to these changes.
80
+
> The server address will be displayed to you as `http://0.0.0.0:3000`.
81
+
82
+
### Step 4: Create a new Resource
83
+
Go to the project dir and hit this command in your terminal.
84
+
```
85
+
npm run console make:resource
86
+
```
87
+
88
+
Apply the same information like you see in the screenshot below.
89
+
90
+

91
+
92
+
> With that you just have created a complete new endpoint in your api for the resource pets.
93
+
94
+
Normally a pet belogns to a user, so we have to add the relationship between users an pets. Open the created migration file and replace the user property with these lines.
0 commit comments