|
1 | | -# ImageKit Angular SDK - Test Application |
| 1 | +# test-app |
2 | 2 |
|
3 | | -This is a test/demo application showcasing the `@imagekit/angular` SDK. |
| 3 | +This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.13. |
4 | 4 |
|
5 | | -## Setup |
| 5 | +## Development server |
6 | 6 |
|
7 | | -1. **Install dependencies:** |
8 | | - ```bash |
9 | | - npm install |
10 | | - ``` |
| 7 | +To start a local development server, run: |
11 | 8 |
|
12 | | -2. **Configure ImageKit (Optional):** |
13 | | - Edit `src/app/app.config.ts` and replace the demo URL with your ImageKit endpoint: |
14 | | - ```typescript |
15 | | - provideImageKit({ |
16 | | - urlEndpoint: 'https://ik.imagekit.io/your_imagekit_id' |
17 | | - }) |
18 | | - ``` |
19 | | - |
20 | | -3. **Run the application:** |
21 | | - ```bash |
22 | | - npm start |
23 | | - ``` |
24 | | - |
25 | | -4. **Open browser:** |
26 | | - Navigate to `http://localhost:4200` |
27 | | - |
28 | | -## What's Included |
29 | | - |
30 | | -- ✅ Basic image rendering with transformations |
31 | | -- ✅ Advanced transformations (resize, quality, format, effects) |
32 | | -- ✅ Responsive images with automatic srcSet |
33 | | -- ✅ Video component with transformations |
34 | | -- ✅ Image gallery example |
35 | | -- ✅ Multiple use cases demonstrated |
| 9 | +```bash |
| 10 | +ng serve |
| 11 | +``` |
36 | 12 |
|
37 | | -## Features Tested |
| 13 | +Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. |
38 | 14 |
|
39 | | -1. **IKImageComponent** - Standalone image component |
40 | | -2. **IKVideoComponent** - Standalone video component |
41 | | -3. **Transformations** - Width, height, crop, quality, format |
42 | | -4. **Responsive** - Automatic srcSet generation |
43 | | -5. **Lazy Loading** - Default lazy loading for images |
44 | | -6. **SSR Support** - Platform-aware rendering |
| 15 | +## Code scaffolding |
45 | 16 |
|
46 | | -## File Structure |
| 17 | +Angular CLI includes powerful code scaffolding tools. To generate a new component, run: |
47 | 18 |
|
| 19 | +```bash |
| 20 | +ng generate component component-name |
48 | 21 | ``` |
49 | | -test-app/ |
50 | | -├── src/ |
51 | | -│ ├── app/ |
52 | | -│ │ ├── app.component.ts # Main component |
53 | | -│ │ ├── app.component.html # Template with examples |
54 | | -│ │ ├── app.component.css # Styles |
55 | | -│ │ └── app.config.ts # ImageKit configuration |
56 | | -│ ├── index.html |
57 | | -│ ├── main.ts |
58 | | -│ └── styles.css |
59 | | -├── angular.json |
60 | | -├── package.json |
61 | | -└── tsconfig.json |
62 | | -``` |
63 | | - |
64 | | -## Customization |
65 | 22 |
|
66 | | -### Change ImageKit Endpoint |
| 23 | +For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: |
67 | 24 |
|
68 | | -Edit `src/app/app.config.ts`: |
69 | | -```typescript |
70 | | -provideImageKit({ |
71 | | - urlEndpoint: 'https://ik.imagekit.io/your_id', |
72 | | - publicKey: 'your_public_key', // for uploads |
73 | | - authenticationEndpoint: 'https://...' // for uploads |
74 | | -}) |
| 25 | +```bash |
| 26 | +ng generate --help |
75 | 27 | ``` |
76 | 28 |
|
77 | | -### Add Your Images |
| 29 | +## Building |
| 30 | + |
| 31 | +To build the project run: |
78 | 32 |
|
79 | | -Replace the image paths in `app.component.html`: |
80 | | -```html |
81 | | -<ik-image |
82 | | - src="/your-image-path.jpg" |
83 | | - [transformation]="[...]" |
84 | | -></ik-image> |
| 33 | +```bash |
| 34 | +ng build |
85 | 35 | ``` |
86 | 36 |
|
87 | | -### Test File Upload |
| 37 | +This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. |
88 | 38 |
|
89 | | -Add an upload component (see EXAMPLES.md in root for upload examples). |
| 39 | +## Running unit tests |
90 | 40 |
|
91 | | -## Commands |
| 41 | +To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: |
92 | 42 |
|
93 | 43 | ```bash |
94 | | -# Install dependencies |
95 | | -npm install |
| 44 | +ng test |
| 45 | +``` |
96 | 46 |
|
97 | | -# Start dev server |
98 | | -npm start |
| 47 | +## Running end-to-end tests |
99 | 48 |
|
100 | | -# Build for production |
101 | | -npm run build |
| 49 | +For end-to-end (e2e) testing, run: |
102 | 50 |
|
103 | | -# Serve production build |
104 | | -npx http-server dist/test-app |
| 51 | +```bash |
| 52 | +ng e2e |
105 | 53 | ``` |
106 | 54 |
|
107 | | -## Notes |
| 55 | +Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. |
108 | 56 |
|
109 | | -- The app uses the ImageKit demo endpoint by default |
110 | | -- TypeScript path mapping points to the built library in `../dist/imagekit-angular` |
| 57 | +## Additional Resources |
111 | 58 |
|
| 59 | +For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. |
0 commit comments