Giter Site home page Giter Site logo

meilisearch / demo-movies Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 16.0 1.73 MB

Next.js app to find streaming platform to watch movies

Home Page: https://where2watch.meilisearch.com/

License: MIT License

JavaScript 85.20% CSS 4.07% HTML 0.41% TypeScript 10.32%
meilisearch nextjs nextjs-example react search-engine

demo-movies's Introduction

MeiliSearch logo

Where to Watch

License


Where to Watch

Table of Contents:


Setup

Install dependencies

yarn

Run Meilisearch

You can run a Meilisearch instance locally with the following command:

docker run -it --rm \
    -p 7700:7700 \
    getmeili/meilisearch:v1.7 \
    meilisearch --env="development"

Import movies

Run the following script in order to create the different indexes and upload the movies documents:

You need to run at least once this command to create the correct indexing settings: yarn setup:settings

Then run the setup to index the data: yarn setup

Run

yarn dev

Go to http://localhost:3000/ and enjoy ! ๐ŸŽ‰

Build

Generate build

You can generate a build of this project with the following command:

yarn build

Run your build

The above commands will generate an optimized version of the app, inside the .next folder.

You can then serve it with:

yarn start

Or serve it with any web server of your choice.

Example:

serve .next

Environment variables

To connect to your own Meilisearch instance, two environment variables should be provided:

  • MEILISEARCH_HOST: the URL of your Meilisearch instance
  • MEILISEARCH_API_KEY: an API key with at least search rights

An example can be found in the .env.example file. You can either rename this file into .env, or create a new file.

Compatibility with Meilisearch

This demo only guarantees the compatibility with the version v1.6 of Meilisearch.

Storybook

Storybook is a development environment for UI components. It allows you to browse a component library, view the different states of each component, and interactively test components.

yarn storybook

Testing

Tests are implemented using Cypress. To run the tests, first launch a Meilisearch instance, then run:

yarn test

Environment variables

Environment variables are configured in cypress.config.js:

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  // ...
  env: {
      MEILISEARCH_HOST: 'http://0.0.0.0:7700',
      MEILISEARCH_API_KEY: 'masterKey',
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.