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.
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.
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.
- Blog: Click here
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",
}
);
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:
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
- Node - v16.13.0
- npm - v8.4.1
- yarn -v1.22.18
# 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
This web app is deployed at:
- Netlify (Frontend)
- Heroku (For backend)
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.
- Sign up for a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
- Based on the language/framework you want to use, you will find the following client libraries:
- Redis OM .NET (C#)
- Watch this getting started video
- Follow this getting started guide
- Redis OM Node (JS)
- Watch this getting started video
- Follow this getting started guide
- Redis OM Python
- Watch this getting started video
- Follow this getting started guide
- Redis OM Spring (Java)
- Watch this getting started video
- Follow this getting started guide
- Redis OM .NET (C#)
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:
- Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
- 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.
- Redis Rediscover - Provides use-cases for Redis as well as real-world examples and educational material
- 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
- Youtube Videos
- Official Redis Youtube channel
- Redis Stack videos - Help you get started modeling data, using Redis OM, and exploring Redis Stack
- Redis Stack Real-Time Stock App from Ahmad Bazzi
- Build a Fullstack Next.js app with Fireship.io
- Microservices with Redis Course by Scalable Scripts on freeCodeCamp