Skip to content

Commit aa003db

Browse files
author
utkace
committed
sample: add sample app
1 parent ee05436 commit aa003db

File tree

15 files changed

+13076
-0
lines changed

15 files changed

+13076
-0
lines changed

example/sample-app/.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# http://editorconfig.org
2+
# same as vue.js
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 2
9+
indent_style = space
10+
insert_final_newline = true
11+
max_line_length = 80
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
max_line_length = 0
16+
trim_trailing_whitespace = false
17+
18+
[COMMIT_EDITMSG]
19+
max_line_length = 0

example/sample-app/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
# local env files
6+
.env
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
# Editor directories and files
16+
.idea
17+
.vscode
18+
*.suo
19+
*.ntvs*
20+
*.njsproj
21+
*.sln
22+
*.sw?

example/sample-app/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Installation
4+
5+
Run the following commands from your shell.
6+
7+
### Getting the SDK ready
8+
9+
We will first go to the root,
10+
11+
```js
12+
cd ../../
13+
```
14+
15+
Install the node modules,
16+
```js
17+
npm install
18+
```
19+
20+
Create the dist:
21+
22+
```js
23+
npm run build
24+
```
25+
26+
Now link it with, npm link
27+
28+
```js
29+
npm link
30+
```
31+
This will create a global repository link for imagekit-vue
32+
33+
### Installing the sample-app
34+
35+
Now, Go to `sample-app` by,
36+
```js
37+
cd example/sample-app
38+
```
39+
40+
then,
41+
```
42+
npm install
43+
```
44+
45+
Now run,
46+
```
47+
npm link imagekit-vue
48+
```
49+
This should create a copy of `imagekit-vue` library in `node_modules` of `sample-app`
50+
51+
## Setting the environment variable
52+
Create a .env file by renaming the sample.env in examples/sample-app
53+
54+
Fill is the required parameters according to your imagekit account.
55+
56+
## Starting the app
57+
Finally run the app,
58+
```
59+
npm run serve
60+
```
61+
62+
63+
To run the upload component you also will have set up a server
64+
65+
## Setting up the server
66+
There is a sample server present in the sample app directory in server directory. To run this server, go to server directory,
67+
68+
```cd server```, then run
69+
70+
```js
71+
npm install
72+
73+
npm run server
74+
```
75+
It takes the `private key` from .env file, so create a .env file by renaming the sample.env in `examples/sample-app/server`

example/sample-app/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

0 commit comments

Comments
 (0)