Skip to content

Commit

Permalink
Added readme, recipe, new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Sid-Lais committed Sep 26, 2024
1 parent 376a2d9 commit f409ec1
Show file tree
Hide file tree
Showing 110 changed files with 3,015 additions and 2,049 deletions.
Binary file added .gitbook/assets/frontend-chat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/redis-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
20 changes: 20 additions & 0 deletions Redis Chat App/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the official Node.js image as a base image
FROM node:latest

# Set the working directory inside the container
WORKDIR /app

# Copy package.json and package-lock.json files
COPY package*.json ./

# Install dependencies
RUN npm install --only=production

# Copy the rest of the application code
COPY . ./

# Expose the port the app runs on
EXPOSE 4000

# Start the Node.js application
CMD ["npm", "run", "start"]
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions backend/index.js → Redis Chat App/backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async function runApp() {
.then((x) => JSON.parse(x.toString()));

app.use(bodyParser.json());
app.use("/", express.static(path.dirname(__dirname) + "/client/build"));
app.use("/", express.static(path.dirname(__dirname) + "/frontend/build"));

initPubSub();

Expand Down Expand Up @@ -283,8 +283,8 @@ async function runApp() {
/** Fetch messages from a selected room */
app.get("/room/:id/messages", auth, async (req, res) => {
const roomId = req.params.id;
const offset = +req.query.offset ?? 0;
const size = +req.query.size ?? 50;
const offset = +req.query.offset;
const size = +req.query.size;
try {
const messages = await getMessages(roomId, offset, size);
return res.status(200).send(messages);
Expand Down
2 changes: 1 addition & 1 deletion backend/redis.js → Redis Chat App/backend/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require("dotenv").config();
const redis = require("redis");

const endpoint = process.env.REDIS_ENDPOINT_URL || "127.0.0.1:6379";
const endpoint = "redis-service.dz-redis.svc.cluster.local:6379";
const password = process.env.REDIS_PASSWORD || null;

const [host, port] = endpoint.split(":");
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions frontend/.gitignore → Redis Chat App/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions Redis Chat App/frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files": {
"main.css": "/static/css/main.0f8d9fe1.css",
"main.js": "/static/js/main.0f049fee.js",
"static/js/453.9b0844f2.chunk.js": "/static/js/453.9b0844f2.chunk.js",
"index.html": "/index.html",
"main.0f8d9fe1.css.map": "/static/css/main.0f8d9fe1.css.map",
"main.0f049fee.js.map": "/static/js/main.0f049fee.js.map",
"453.9b0844f2.chunk.js.map": "/static/js/453.9b0844f2.chunk.js.map"
},
"entrypoints": [
"static/css/main.0f8d9fe1.css",
"static/js/main.0f049fee.js"
]
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
17 changes: 17 additions & 0 deletions Redis Chat App/frontend/build/devzero-logo-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Redis Chat App/frontend/build/devzero-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Redis Chat App/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>DevZero Redis Chat</title><script defer="defer" src="/static/js/main.0f049fee.js"></script><link href="/static/css/main.0f8d9fe1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions Redis Chat App/frontend/build/static/css/main.0f8d9fe1.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Redis Chat App/frontend/build/static/js/453.9b0844f2.chunk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f409ec1

Please sign in to comment.