DEV Community

Cover image for Stoa - forum app that use redis as a primary database
Paweł Ciosek
Paweł Ciosek

Posted on

Stoa - forum app that use redis as a primary database

Overview of My Submission

Stoa is a small forum app. The inspiration is a need of minimalistic internal forum for organizations. Designed to look like a typical social media app.

The main purpose of the project is to test redis as main database. I am using redisJSON to store documents and RediSearch to perform searches.

Stack:

  • Typescript
  • Next.js
  • tailwindcss
  • Redis stack

Some thoughts from mine experience:

Advantages:

  • Easy to understand
  • Fast integration thanks to redis-om-node library. In dozen minutes, we are ready to start manipulating with documents.
  • We can storage several types of data, not only json.
  • RedisInsight app is really helpful during development process. Cool!

Disadvantages:

  • It's tricky when we want to build related data structure. We need to handle it by extending an entity class.
  • We have to create index on a collection, before starting to search anything. It's tricky for the first time.

Submission Category:

MEAN/MERN Mavericks

Language Used

JS/TS/Node.js

Link to Code

GitHub logo pavelee / stoa-redis-stack

Share your ideas among community

Stoa

Stoa is a small forum app. The inspiration is a need of minimalistic internal forum for organizations. Designed to look like a typical social media app.

The main purpose of the project is to test redis as main database. I am using redisJSON to store documents and RediSearch to perform searches.

Stack:

  • Typescript
  • Next.js
  • tailwindcss
  • Redis stack

How it works

How the data is stored:

Data is stored as documents using redisJSON

How the data is accessed:

Data is accesed through redis-om-node

How to run it locally?

You can run it loccaly using docker.

Prerequisites

  • Docker

Local installation

Run containers

docker-compose up -d

Acess app in the borwser

http://localhost:3000

More Information about Redis Stack

Here some resources to help you quickly get started using Redis Stack. If you still have questions, feel free to ask them in the Redis Discord or on Twitter.

Getting Started

  1. Sign up for…

Additional Resources / Info

test

Top comments (3)

Collapse
 
onethingwell profile image
Nick | OneThingWell.dev

Nice.

I never tried Redis OM. How does it handle and store relations - it just encodes them in the keys or?

Collapse
 
pavelee profile image
Paweł Ciosek

Thanks!

It doesn't handle relations. You can embed a document or keep foreign key as a string.

eg. in the app, we fetch author of post by getter:

   async getAuthor() {
        let client = await getRedisClient();
        let repo = client.fetchRepository(userSchema);
        let user = await repo.fetch(this.author);
        return user;
    }
Enter fullscreen mode Exit fullscreen mode

So later in code we can do:

topic.getAuthor().name
Enter fullscreen mode Exit fullscreen mode
Collapse
 
onethingwell profile image
Nick | OneThingWell.dev

I see... I noticed annotations for relations in an example Java code, but I guess that's limited to Java/Spring Redis OM flavor...