From 1e355eca92f91636b3a660c1bbe526e0a029b3e9 Mon Sep 17 00:00:00 2001 From: eliasmpw Date: Thu, 10 Aug 2023 08:41:26 +0200 Subject: [PATCH] chore: replace algolia with meilisearch, remove ssr so project can be deployed on firebase again (#372) * feat: add meilisearch indexer script * fix: remove file that was breaking the indexer, fix styling on mobile version of content list * chore: create search input replacement for home page * chore: use domain class * chore: remove algolia and add modal version of the search component * chore: update lock file * fix: handle case where env variables are not set, add key down events * chore: remove sitemap server endpoint and use a package library instead * fix: close search modal on selecting option --- .env.example | 8 +- README.md | 2 +- components/GettingStarted/WhatsNext.vue | 2 +- components/Header.vue | 9 +- components/Home/FeaturedSection.vue | 2 +- components/Home/Hero.vue | 4 +- components/Home/HighlightedArticles.vue | 16 - components/Home/LearnAboutArchway.vue | 2 +- components/Home/PopularArticles.vue | 19 - components/Home/RecentArticles.vue | 19 - components/Home/Sections.vue | 6 +- components/Sections/Categories.vue | 2 +- components/Sections/MostPopularArticles.vue | 7 - components/Test.vue | 89 + components/Ui/Algolia/AlgoliaCustomTheme.css | 986 -------- components/Ui/Algolia/AutocompleteInput.vue | 156 -- components/Ui/Algolia/AutocompleteSearch.vue | 40 - components/Ui/Buttons/IconButton.vue | 2 +- .../Ui/Meilisearch/ContentSearchButton.vue | 28 + .../Ui/Meilisearch/ContentSearchInput.vue | 73 + .../Ui/Meilisearch/ContentSearchModal.vue | 132 + components/Ui/Meilisearch/PageInfo.vue | 35 + components/Ui/Meilisearch/SearchKeysInfo.vue | 12 + components/Ui/index.ts | 7 +- composables/index.ts | 2 + composables/useKeyDownEvent.ts | 9 + composables/useModals.ts | 15 + content/1.overview/1.about.md | 2 +- content/1.overview/2.rewards.md | 2 +- content/1.overview/3.join-the-community.md | 2 +- content/1.overview/4.cosmos_ibc_cosmwasm.md | 2 +- content/1.overview/5.faq.md | 2 +- content/1.overview/6.glossary.md | 2 +- content/1.overview/7.brand-kit.md | 2 +- content/1.overview/8.security.md | 2 +- content/1.overview/9.disclaimer.md | 2 +- .../1.getting-started/1.install.md | 2 +- .../1.getting-started/2.ide-setup.md | 2 +- .../2.developers/1.getting-started/3.setup.md | 2 +- .../4.understanding-gas-fees.md | 2 +- .../2.developer-tools/1.introduction.md | 2 +- .../2.developer-tools/2.developer-cli.md | 2 +- .../2.developer-tools/3.daemon.md | 2 +- .../4.arch3js/1.introduction.md | 2 +- .../2.transaction-query-execution.md | 2 +- .../3.tutorials/1.ibc-transaction.md | 2 +- .../2.store-instantiate-contract.md | 2 +- .../3.tutorials/3.keplr-integration.md | 2 +- .../4.arch3js/3.tutorials/4.websockets.md | 2 +- .../2.developer-tools/5.swagger.md | 2 +- .../2.developers/2.developer-tools/6.FAQs.md | 2 +- .../2.developer-tools/7.troubleshooting.md | 2 +- .../2.rewards/2.managing-rewards.md | 2 +- .../2.rewards/3.rewards-reference.md | 2 +- .../2.developers/2.rewards/4.consensus-fee.md | 2 +- .../3.guides/1.guides-overview.md | 2 +- content/2.developers/3.guides/2.faucet.md | 2 +- .../3.guides/3.my-first-dapp/1.start.md | 2 +- .../3.guides/3.my-first-dapp/2.wasm.md | 2 +- .../3.guides/3.my-first-dapp/3.deploy.md | 2 +- .../3.guides/3.my-first-dapp/4.interact.md | 2 +- .../3.guides/3.my-first-dapp/5.dapp.md | 2 +- .../3.guides/4.nft-project/1.start.md | 2 +- .../3.guides/4.nft-project/2.deploy.md | 2 +- .../3.guides/4.nft-project/3.interact.md | 2 +- .../3.guides/4.nft-project/4.dapp.md | 2 +- .../3.guides/5.fee-grant/1.introduction.md | 2 +- .../3.guides/5.fee-grant/2.grant-allowance.md | 2 +- .../3.guides/5.fee-grant/3.utilize-grant.md | 2 +- .../1.introduction.md | 2 +- .../2.getting-started/1.introduction.md | 2 +- .../2.setting-up-environment.md | 2 +- .../2.getting-started/3.compile-contract.md | 2 +- .../2.getting-started/4.unit-tests.md | 2 +- .../5.interact-with-contract.md | 2 +- .../6.integration-overview.md | 2 +- .../2.getting-started/7.next-steps.md | 2 +- .../3.architecture/1.multi-chain-contracts.md | 2 +- .../3.architecture/2.actor-model-intro.md | 2 +- .../3.architecture/3.names-and-addresses.md | 2 +- .../3.architecture/4.querying.md | 2 +- .../3.architecture/5.serialization.md | 2 +- .../3.architecture/6.contract-composition.md | 2 +- .../7.comparison-with-ethereum.md | 2 +- .../4.smart-contracts/1.contract-semantics.md | 2 +- .../4.smart-contracts/10.migration.md | 2 +- .../4.smart-contracts/11.migrate-dapp.md | 2 +- .../4.smart-contracts/12.testing.md | 2 +- .../4.smart-contracts/13.sudo-execution.md | 2 +- .../4.smart-contracts/14.cosmwasm-ibc.md | 2 +- .../4.smart-contracts/2.message/1.message.md | 2 +- .../2.message/2.submessages.md | 2 +- .../3.state/1.simple-state.md | 2 +- .../3.state/2.complex-state.md | 2 +- .../4.smart-contracts/4.result-and-option.md | 2 +- .../4.smart-contracts/5.entry-points.md | 2 +- .../4.smart-contracts/6.query.md | 2 +- .../4.smart-contracts/7.events.md | 2 +- .../4.smart-contracts/8.math.md | 2 +- .../4.smart-contracts/9.verify.md | 2 +- .../6.tutorials/1.simple-option/1.testing.md | 2 +- .../2.storage/1.key-value-store.md | 2 +- .../6.tutorials/2.storage/2.indexes.md | 2 +- .../6.tutorials/2.storage/3.state-modeling.md | 2 +- content/2.developers/5.debug.md | 2 +- .../2.developers/6.managing-dependencies.md | 2 +- content/2.developers/7.troubleshoot.md | 2 +- .../3.community/1.wallet-setup/1.overview.md | 4 +- .../1.wallet-setup/2.keplr/1.keplr-setup.md | 2 +- .../2.keplr/2.import-trust-wallet.md | 2 +- .../1.wallet-setup/3.cosmostation-setup.md | 2 +- .../1.wallet-setup/4.leap-setup.md | 2 +- .../1.wallet-setup/5.ledger-setup.md | 2 +- .../3.community/1.wallet-setup/6.dev-setup.md | 2 +- content/3.community/2.staking/1.overview.md | 2 +- .../2.staking/2.archway-connect-staking.md | 2 +- .../2.staking/3.cosmostation-staking.md | 2 +- .../3.community/2.staking/4.leap-staking.md | 2 +- .../3.community/2.staking/5.cli-staking.md | 4 +- .../3.managing-tokens/1.send-tokens.md | 2 +- .../3.managing-tokens/2.receive-tokens.md | 2 +- .../3.managing-tokens/3.bridge-tokens.md | 2 +- .../3.community/4.governance/1.governance.md | 2 +- .../4.governance/2.vote/1-overview.md | 2 +- .../4.governance/2.vote/2.vote-connect.md | 2 +- .../2.vote/3.vote-cosmostation.md | 2 +- .../4.governance/2.vote/4.vote-leap.md | 2 +- .../4.governance/2.vote/5.vote-archwayd.md | 2 +- .../5.interact-with-dapp-using-keplr.md | 2 +- .../6.navigating-an-archway-block-explorer.md | 2 +- content/3.community/7.archway-connect.md | 2 +- content/3.community/8.airdrop-snapshots.md | 2 +- content/3.community/9.contribute.md | 2 +- .../1.running-a-node/1.prerequisites.md | 2 +- .../1.running-a-node/2.install.md | 2 +- .../1.running-a-node/3.initialization.md | 2 +- .../4.validators/1.running-a-node/4.keys.md | 2 +- .../1.running-a-node/5.configure.md | 2 +- .../5.join-a-network/1.overview.md | 2 +- .../5.join-a-network/2.sync-from-genesis.md | 2 +- .../3.sync-with-state-sync.md | 2 +- .../5.join-a-network/4.sync-from-snapshot.md | 2 +- .../1.running-a-node/6.cosmovisor.md | 2 +- .../2.becoming-a-validator/1.overview.md | 2 +- .../2.becoming-a-validator/2.requirements.md | 2 +- .../3.running-a-validator-node.md | 2 +- .../4.monitoring-validators.md | 2 +- .../5.running-a-local-testnet.md | 16 +- .../2.becoming-a-validator/6.migration.md | 2 +- .../2.becoming-a-validator/7.chain-upgrade.md | 2 +- .../8.upgrades-history.md | 2 +- .../9.troubleshooting.md | 2 +- .../3.running-a-relayer/1.introduction.md | 2 +- .../2.running-a-relayer.md | 2 +- content/5.resources/1.networks.md | 2 +- content/5.resources/2.ibc-channels.md | 2 +- content/5.resources/3.blockexplorers.md | 2 +- data/index.ts | 4 +- data/useAlgoliaSearch.ts | 37 - data/useArticles.ts | 28 + data/useContentSearch.ts | 42 + data/useHighlightedArticles.ts | 57 - domain/AlgoliaSearch.ts | 54 - domain/ContentMetadata.ts | 21 + domain/MockAlgoliaSearch.ts | 288 --- domain/index.ts | 2 +- nuxt.config.ts | 35 +- package-lock.json | 2209 +++++++---------- package.json | 11 +- pages/[...slug].vue | 13 - pages/index.vue | 1 - ...lgoliaIndexer.ts => meilisearchIndexer.ts} | 38 +- server/api/algolia/increaseViews.post.ts | 43 - server/routes/sitemap.xml.ts | 17 - tailwind.config.js | 1 - types/index.d.ts | 16 - 176 files changed, 1541 insertions(+), 3338 deletions(-) delete mode 100644 components/Home/HighlightedArticles.vue delete mode 100644 components/Home/PopularArticles.vue delete mode 100644 components/Home/RecentArticles.vue create mode 100644 components/Test.vue delete mode 100644 components/Ui/Algolia/AlgoliaCustomTheme.css delete mode 100644 components/Ui/Algolia/AutocompleteInput.vue delete mode 100644 components/Ui/Algolia/AutocompleteSearch.vue create mode 100644 components/Ui/Meilisearch/ContentSearchButton.vue create mode 100644 components/Ui/Meilisearch/ContentSearchInput.vue create mode 100644 components/Ui/Meilisearch/ContentSearchModal.vue create mode 100644 components/Ui/Meilisearch/PageInfo.vue create mode 100644 components/Ui/Meilisearch/SearchKeysInfo.vue create mode 100644 composables/useKeyDownEvent.ts create mode 100644 composables/useModals.ts delete mode 100644 data/useAlgoliaSearch.ts create mode 100644 data/useArticles.ts create mode 100644 data/useContentSearch.ts delete mode 100644 data/useHighlightedArticles.ts delete mode 100644 domain/AlgoliaSearch.ts create mode 100644 domain/ContentMetadata.ts delete mode 100644 domain/MockAlgoliaSearch.ts rename scripts/{algoliaIndexer.ts => meilisearchIndexer.ts} (70%) delete mode 100644 server/api/algolia/increaseViews.post.ts delete mode 100644 server/routes/sitemap.xml.ts diff --git a/.env.example b/.env.example index 483ac8a8f..5d03fd3f3 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ -ALGOLIA_SEARCH_API_KEY= -ALGOLIA_WRITE_API_KEY= -ALGOLIA_APPLICATION_ID= -ALGOLIA_INDEX= +MEILISEARCH_SEARCH_API_KEY= +MEILISEARCH_WRITE_API_KEY= +MEILISEARCH_INDEX= +MEILISEARCH_HOST= ENV=staging | production diff --git a/README.md b/README.md index 49ef0e699..44e37c568 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ npm run dev ### Using Docker -You can also spin up the development environment using Docker. First, you have to add the Algolia secrets to the `.env` file. You can use the example file for that: +You can also spin up the development environment using Docker. First, you have to add the Meilisearch secrets to the `.env` file. You can use the example file for that: ```bash cp .env.example .env diff --git a/components/GettingStarted/WhatsNext.vue b/components/GettingStarted/WhatsNext.vue index a2d14395d..6761fdbe1 100644 --- a/components/GettingStarted/WhatsNext.vue +++ b/components/GettingStarted/WhatsNext.vue @@ -33,7 +33,7 @@
diff --git a/components/Header.vue b/components/Header.vue index 94bbef7a2..0e62f6622 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -1,13 +1,12 @@ @@ -34,7 +33,7 @@
diff --git a/components/Home/FeaturedSection.vue b/components/Home/FeaturedSection.vue index a0ff3c8a7..a21f3f953 100644 --- a/components/Home/FeaturedSection.vue +++ b/components/Home/FeaturedSection.vue @@ -10,7 +10,7 @@