Skip to content

Latest commit

 

History

History
213 lines (180 loc) · 7.1 KB

README.md

File metadata and controls

213 lines (180 loc) · 7.1 KB

Introducing Ideao - A web portal of exploring ideas

Ideao is a web platform of exploring, sharing the creativeness in the form of idea. It allows to search the idea which helps you to make awesome things.

Overview video

Watch the video

How it works

At first, Ideao communicated with the api for retrieving the idea and user data, posting them to the backend server, Searching idea and delete the idea according to the user.

How the data is stored:

The ideao's data is stored in JSON format based upon RediJSON. The overall mapping of data is configured by Redis Om Node js package.

At first connection need to be established in redis cloud by:

import { Client } from "redis-om";
const client = new Client();
const con = await client.open(process.env.REDIS_URL);
if(con){
  console.log("Redis connected");
}
export default client

client is the instance of Redis Client used for connection. REDIS_URL is the connection endpoint url provided by redis.

Important Links

Schema of Idea

const ideaSchema = new Schema(
  Idea,
  {
    idea_title: {
      type: "text",
    },
    idea_des: {
      type: "text",
    },
    idea_doc: {
      type: "text",
    },
    user_id: {
      type: "string",
    },
    idea_userImg: {
      type: "string",
    },
    idea_postedBy: {
      type: "string",
    },
    idea_tag: { type: "string[]" },
  },
  {
    dataStructure: "JSON",
  }
);

Schema of user

const userSchema = new Schema(
  User,
  {
    user_gid: {
      type: "string",
    },
    user_name: {
      type: "string",
    },
    user_email: {
      type: "string",
    },
    user_doc: {
      type: "string",
    },
    user_pic: {
      type: "string",
    },
  },
  {
    dataStructure: "JSON",
  }
);

All of functionality of api which makes Ideao are as follow:

How the data is accessed:

All the Json data is managed by Redis om. Frontend makes request through different /api routes to accessed the data like:

//Routes
app.use("/api/idea", Idea);
app.use("/api/user", User);
app.use("/api/stat", Stat);

Some example of requesting api are:

//Geting all Idea
const res = await axios.get(`${url}/api/idea`);
//Posting the idea
const res = await axios.post(
      `${url}/api/idea`,
      {
        idea_title: idea_title,
        idea_des: idea_des,
        idea_doc: moment().format("ll"),
        user_id: user[0]?.user_gid,
        idea_userImg: user[0]?.user_pic,
        idea_postedBy: user[0]?.user_name,
        idea_tag: finalTag,
      },
      {
        headers: {
          "Content-Type": "application/json",
        },
      }
    );

Package like:

  • axios (used for creating Http request)
  • moment (used date and time)

Note: url is the backend server url where backend is hosted

Prerequisites

  • Node - v16.13.0
  • npm - v8.4.1
  • yarn -v1.22.18

Local installation

# Move to local branch
git checkout local

Go to /server folder (cd ./server) and then:

# copy file and set proper data inside
cp .env.example .env

# install dependencies
yarn install

# Run server
yarn server

Go to /client folder (cd ./client) and then:

# copy file and set proper data inside
cp .env.example .env

# install dependencies
yarn install

# run development mode
yarn dev

Locally,Ideao runs in:

  • Server localhost:3001
  • Frontend 127.0.0.1:5173

Deployment

This web app is deployed at:

  • Netlify (Frontend)
  • Heroku (For backend)

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 a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
  2. Based on the language/framework you want to use, you will find the following client libraries:

The above videos and guides should be enough to get you started in your desired language/framework. From there you can expand and develop your app. Use the resources below to help guide you further:

  1. Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
  2. Redis Stack getting started page - Lists all the Redis Stack features. From there you can find relevant docs and tutorials for all the capabilities of Redis Stack.
  3. Redis Rediscover - Provides use-cases for Redis as well as real-world examples and educational material
  4. RedisInsight - Desktop GUI tool - Use this to connect to Redis to visually see the data. It also has a CLI inside it that lets you send Redis CLI commands. It also has a profiler so you can see commands that are run on your Redis instance in real-time
  5. Youtube Videos