Giter Club home page Giter Club logo

redis-realtime's Introduction

Redis Realtime

Build realtime services on top of redis

A live demo of redis realtime is available here

What is Redis Realtime?

For now redis-realtime is a set of packages for react and node js that can be used to build scalable realtime services on top of redis.

Architecture

Packages

redis-realtime-react

This is a react package that help you to easily connect with the redis with the help redis-realtime-node package and update the database. More information on the package is available on its readme.

redis-realtime-nodejs

This is the nodejs sdk that will be used my redis-realtime-react to communicate redis. More information on the package is available on its readme.

Running Locally

This project is a monorepo with the packages and a example and it uses npm workspaces to manage them locally.

Prerequisites

  • Requires npm v7 or above.
  • Ideal nodejs version v14.8
  • Redis running with RedisJson Module. You can use this docker-compose.yml

Run examples locally

Install the dependencies

npm install

Now you have to build the packages.

npm --prefix packages/redis-realtime-node run build
npm --prefix packages/redis-realtime-react run build

Start the backend server

cd example/realtime-be && npm start

Start the frontend

cd example/realtime-fe && npm run dev

Detailed Architecture

Redis realtime packages detailed architecture.

Detailed Architecture

redis-realtime's People

Contributors

shamin avatar

Stargazers

Pablo Fernandez avatar Roman avatar Dayan Graham avatar William de Souza avatar Label avatar Jason Glass avatar  avatar Alex Mathew avatar

Watchers

James Cloos avatar  avatar

redis-realtime's Issues

error: [plugin: vite:dep-scan] Failed to resolve entry for package "@space-kit/redis-realtime-react"

I can't run the command
npm run dev

> vite

 > node_modules/vite/dist/node/chunks/dep-66eb515d.js:32070:14: error: [vite:dep-scan] Failed to resolve entry for package "@space-kit/redis-realtime-react". The package may have incorrect main/module/exports specified in its package.json.
    32070 │         throw new Error(`Failed to resolve entry for package "${id}". ` +
          ╵               ^
    at resolvePackageEntry (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:32070:15)
    at tryNodeResolve (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:31907:11)
    at Context.resolveId (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:31790:28)
    at Object.resolveId (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:43659:55)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async resolve (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:43862:26)
    at async /home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:43966:34
    at async callback (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/esbuild/lib/main.js:724:28)
    at async handleRequest (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/esbuild/lib/main.js:595:30)

   node_modules/vite/dist/node/chunks/dep-66eb515d.js:43956:18: note: This error came from the "onResolve" callback registered here
    43956 │             build.onResolve({
          ╵                   ~~~~~~~~~
    at setup (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:43956:19)
    at handlePlugins (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/esbuild/lib/main.js:686:7)
    at Object.buildOrServe (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/esbuild/lib/main.js:903:44)
    at /home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/esbuild/lib/main.js:1444:17
    at new Promise (<anonymous>)
    at Object.build (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/esbuild/lib/main.js:1443:14)
    at Object.build (/home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/esbuild/lib/main.js:1334:51)
    at /home/xdien/workspace/redis-realtime/examples/realtime-fe/node_modules/vite/dist/node/chunks/dep-66eb515d.js:43816:54
    at Array.map (<anonymous>)

   src/main.tsx:4:33: note: The plugin "vite:dep-scan" was triggered by this import
        4 │ import { RealtimeProvider } from '@space-kit/redis-realtime-react'
          ╵                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Steps:

git clone https://github.com/shamin/redis-realtime
cd redis-realtime/exmaples/realtime-fe/
npm install
npm run dev 

Incompatibilty with Node v16

My Environment:

NPM

[email protected] /usr/local/lib/node_modules/npm

NodeJS

node
Welcome to Node.js v16.0.0.
Type ".help" for more information.
> 

Tried running:

npm start              

> [email protected] start
> nodemon src/index.ts

[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts,json
[nodemon] starting `ts-node src/index.ts`

/Users/ajeetraina/projects/redis-realtime/node_modules/ts-node/src/index.ts:513
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/index.ts:4:27 - error TS2307: Cannot find module '@space-kit/redis-realtime-node' or its corresponding type declarations.

4 import redisRealtime from '@space-kit/redis-realtime-node'
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    at createTSError (/Users/ajeetraina/projects/redis-realtime/node_modules/ts-node/src/index.ts:513:12)
    at reportTSError (/Users/ajeetraina/projects/redis-realtime/node_modules/ts-node/src/index.ts:517:19)
    at getOutput (/Users/ajeetraina/projects/redis-realtime/node_modules/ts-node/src/index.ts:752:36)
    at Object.compile (/Users/ajeetraina/projects/redis-realtime/node_modules/ts-node/src/index.ts:968:32)
    at Module.m._compile (/Users/ajeetraina/projects/redis-realtime/node_modules/ts-node/src/index.ts:1056:42)
    at Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/ajeetraina/projects/redis-realtime/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Function.Module._load (node:internal/modules/cjs/loader:828:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
[nodemon] app crashed - waiting for file changes before starting...
^C
ajeetraina@Ajeets-MacBook-Pro realtime-be % ls

Does it mean I strictly need to use Node v14?

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.