https://github.com/typesense/showcase-guitar-chords-search-angular
A demo that shows how to implement Typesense in an Angular app
https://github.com/typesense/showcase-guitar-chords-search-angular
angular angular-instantsearch instantsearch typesense typesense-instantsearch-adapter typesense-showcase
Last synced: about 1 month ago
JSON representation
A demo that shows how to implement Typesense in an Angular app
- Host: GitHub
- URL: https://github.com/typesense/showcase-guitar-chords-search-angular
- Owner: typesense
- License: apache-2.0
- Created: 2024-01-15T22:57:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-28T20:40:23.000Z (12 months ago)
- Last Synced: 2025-04-17T07:17:31.582Z (about 1 month ago)
- Topics: angular, angular-instantsearch, instantsearch, typesense, typesense-instantsearch-adapter, typesense-showcase
- Language: TypeScript
- Homepage: https://guitar-chords-search-angular.typesense.org
- Size: 572 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🎸 Instant Guitar Chord Positions Search, powered by Typesense - Angular
Other versions
NuxtJS |
NextJS |
Angular 15 |
Vanilla JS |
Astro |
SolidJS |
Remix |
Sveltekit |
Qwik |
React Native## Tech Stack
- Typesense
- Angular 15
- Typescript
- CypressAll make for a blazingly fast search experience 🔥🔥🔥
The guitar chord dataset & chord svg generation is from tombatossals which contains 2141 chord shapes of 552 chords.
## Project Structure
```bash
/
├── scripts/
│ ├── data/
│ │ ├── guitar.json
│ │ └── schema.json
│ └── indexTypesense.ts # script that index data from guitar.json into typesense server
├── src/
│ └── app/
│ ├── UI components...
│ └── app.component.ts # guitar chords search
└── writeEnvVariables.ts # util script to write env variables at build time
```## Development
To run this project locally, make sure you have docker and nodejs.
Installation
```shell
git clone https://github.com/typesense/showcase-guitar-chords-search-angular.gitcd showcase-guitar-chords-search-angular
npm i
```Start typesense server
```shell
npm run start:typesense # or: docker compose up
```Index data into typesense
```shell
npm run index:typesense
```Generate angular env variables
```shell
ng generate environments
```Then add this to your `src/environments/environment.development.ts`
```typescript
// change them if you want to use Typesense cloud
export const environment = {
PUBLIC_TYPESENSE_SEARCH_ONLY_API_KEY: null,
PUBLIC_TYPESENSE_HOST: null,
PUBLIC_TYPESENSE_PORT: "443",
PUBLIC_TYPESENSE_PROTOCOL: "https",
};
```Start the dev web app
```shell
ng serve
```Open http://localhost:4200/ to see the app ✌️
## Deployment
Set env variables to point the app to the Typesense Cluster
```env
PUBLIC_TYPESENSE_SEARCH_ONLY_API_KEY=xxx
PUBLIC_TYPESENSE_HOST=xxx.typesense.net
PUBLIC_TYPESENSE_PORT=443
PUBLIC_TYPESENSE_PROTOCOL=https
```The file `writeEnvVariables.ts` will automatically load them into `src/environments` for the angular app.