Skip to content

Commit 6a59724

Browse files
committed
Start: Initialize
1 parent 225987a commit 6a59724

37 files changed

+8621
-1
lines changed

.DS_Store

6 KB
Binary file not shown.

DEVELOPING.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Developer's Guide
2+
3+
We use Visual Studio Code for developing LoopBack and recommend the same to our
4+
users.
5+
6+
## VSCode setup
7+
8+
Install the following extensions:
9+
10+
- [eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
11+
- [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
12+
13+
## Development workflow
14+
15+
### Visual Studio Code
16+
17+
1. Start the build task (Cmd+Shift+B) to run TypeScript compiler in the
18+
background, watching and recompiling files as you change them. Compilation
19+
errors will be shown in the VSCode's "PROBLEMS" window.
20+
21+
2. Execute "Run Rest Task" from the Command Palette (Cmd+Shift+P) to re-run the
22+
test suite and lint the code for both programming and style errors. Linting
23+
errors will be shown in VSCode's "PROBLEMS" window. Failed tests are printed
24+
to terminal output only.
25+
26+
### Other editors/IDEs
27+
28+
1. Open a new terminal window/tab and start the continuous build process via
29+
`npm run build:watch`. It will run TypeScript compiler in watch mode,
30+
recompiling files as you change them. Any compilation errors will be printed
31+
to the terminal.
32+
33+
2. In your main terminal window/tab, run `npm run test:dev` to re-run the test
34+
suite and lint the code for both programming and style errors. You should run
35+
this command manually whenever you have new changes to test. Test failures
36+
and linter errors will be printed to the terminal.

Dockerfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Check out https://hub.docker.com/_/node to select a new base image
2+
FROM node:18-slim
3+
4+
# Set to a non-root built-in user `node`
5+
USER node
6+
7+
# Create app directory (with user `node`)
8+
RUN mkdir -p /home/node/app
9+
10+
WORKDIR /home/node/app
11+
12+
# Install app dependencies
13+
# A wildcard is used to ensure both package.json AND package-lock.json are copied
14+
# where available (npm@5+)
15+
COPY --chown=node package*.json ./
16+
17+
RUN npm install
18+
19+
# Bundle app source code
20+
COPY --chown=node . .
21+
22+
RUN npm run build
23+
24+
# Bind to all network interfaces so that it can be mapped to the host OS
25+
ENV HOST=0.0.0.0 PORT=3000
26+
27+
EXPOSE ${PORT}
28+
CMD [ "node", "." ]

README.md

+75-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,75 @@
1-
# friends
1+
# friend
2+
3+
This application is generated using [LoopBack 4 CLI](https://loopback.io/doc/en/lb4/Command-line-interface.html) with the
4+
[initial project layout](https://loopback.io/doc/en/lb4/Loopback-application-layout.html).
5+
6+
## Install dependencies
7+
8+
By default, dependencies were installed when this application was generated.
9+
Whenever dependencies in `package.json` are changed, run the following command:
10+
11+
```sh
12+
npm install
13+
```
14+
15+
To only install resolved dependencies in `package-lock.json`:
16+
17+
```sh
18+
npm ci
19+
```
20+
21+
## Run the application
22+
23+
```sh
24+
npm start
25+
```
26+
27+
You can also run `node .` to skip the build step.
28+
29+
Open http://127.0.0.1:3000 in your browser.
30+
31+
## Rebuild the project
32+
33+
To incrementally build the project:
34+
35+
```sh
36+
npm run build
37+
```
38+
39+
To force a full build by cleaning up cached artifacts:
40+
41+
```sh
42+
npm run rebuild
43+
```
44+
45+
## Fix code style and formatting issues
46+
47+
```sh
48+
npm run lint
49+
```
50+
51+
To automatically fix such issues:
52+
53+
```sh
54+
npm run lint:fix
55+
```
56+
57+
## Other useful commands
58+
59+
- `npm run migrate`: Migrate database schemas for models
60+
- `npm run openapi-spec`: Generate OpenAPI spec into a file
61+
- `npm run docker:build`: Build a Docker image for this application
62+
- `npm run docker:run`: Run this application inside a Docker container
63+
64+
## Tests
65+
66+
```sh
67+
npm test
68+
```
69+
70+
## What's next
71+
72+
Please check out [LoopBack 4 documentation](https://loopback.io/doc/en/lb4/) to
73+
understand how you can continue to add features to this application.
74+
75+
[![LoopBack](https://github.com/loopbackio/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)[email protected])](http://loopback.io/)

data/db.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"ids": {
3+
"Address": 3,
4+
"Friend": 2
5+
},
6+
"models": {
7+
"Address": {
8+
"1": "{\"city\":\"Venlo\",\"postcode\":\"5912 BG\",\"street\":\"Tegelseweg\",\"number\":\"255\",\"id\":1}",
9+
"2": "{\"city\":\"Amazing City\",\"postcode\":\"AmC43\",\"street\":\"Amazing Street\",\"number\":\"88\",\"friendId\":0,\"id\":2}"
10+
},
11+
"Friend": {
12+
"1": "{\"firstname\":\"Amazing\",\"lastname\":\"Persona\",\"id\":1}"
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)