From fb911f536a0fb97a7c597b97a8bc78ee9debc3b1 Mon Sep 17 00:00:00 2001 From: SpriteyOnTheDraconic <91148727+SpriteyOnTheDraconic@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:04:59 +0200 Subject: [PATCH 01/12] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 862f2c1..f7a3a19 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Code Box +# CodeSprite -A development platform where anyone can build websites using HTML, CSS and JS. And show off their work online. +A Dark theme of Code-Box + updating every time! ![Banner](https://raw.githubusercontent.com/rohitdhas/code-box/main/public/banner.png) @@ -8,4 +8,3 @@ A development platform where anyone can build websites using HTML, CSS and JS. A - Public/Private Codeboxes - Search users/codeboxes -- Deploy Codebox From cb2e7c113b763d38cdb1bc4fc8f160b79e1744d6 Mon Sep 17 00:00:00 2001 From: SpriteyOnTheDraconic <91148727+SpriteyOnTheDraconic@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:07:01 +0200 Subject: [PATCH 02/12] Update emptyState.jsx --- components/emptyState.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/emptyState.jsx b/components/emptyState.jsx index 00562c8..1596b6f 100644 --- a/components/emptyState.jsx +++ b/components/emptyState.jsx @@ -12,6 +12,7 @@ export default function EmptyState({ toggleModal }) { text="Create New Project" icon="plus" intent="primary" + className="rounded-full" /> ); From 55a4fd2d20afdf4c234c1fdc07b6b754f2eafd55 Mon Sep 17 00:00:00 2001 From: SpriteyOnTheDraconic <91148727+SpriteyOnTheDraconic@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:07:19 +0200 Subject: [PATCH 03/12] Update navbar.jsx --- components/navbar.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/navbar.jsx b/components/navbar.jsx index 876193a..871f98c 100644 --- a/components/navbar.jsx +++ b/components/navbar.jsx @@ -24,12 +24,13 @@ export default function Nav({ getProjects, previewBtn, editBtn }) { /> ); return ( - + - CodeBox 👨‍💻 + CodeSprite 👨‍💻 + - + + From 46d08cbc9cad0981046806d718c68d310e0566f8 Mon Sep 17 00:00:00 2001 From: SpriteyOnTheDraconic <91148727+SpriteyOnTheDraconic@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:08:19 +0200 Subject: [PATCH 05/12] Update mongodb.js --- lib/mongodb.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/lib/mongodb.js b/lib/mongodb.js index 81b0b1b..a35df96 100644 --- a/lib/mongodb.js +++ b/lib/mongodb.js @@ -1,23 +1,13 @@ import { MongoClient } from "mongodb"; -const MONGODB_URI = process.env.MONGODB_URI; -const MONGODB_DB = process.env.DB_NAME; - -// check the MongoDB URI -if (!MONGODB_URI) { - throw new Error("Define the MONGODB_URI environmental variable"); -} - -// check the MongoDB DB -if (!MONGODB_DB) { - throw new Error("Define the MONGODB_DB environmental variable"); -} +const MONGODB_URI = "Ur mongoDB URL"; +const MONGODB_DB = "DB NAME"; +const COLLECTION_NAME = "users"; let cachedClient = null; let cachedDb = null; export async function connectToDatabase() { - // check the cached. if (cachedClient && cachedDb) { // load from cache return { @@ -32,12 +22,10 @@ export async function connectToDatabase() { useUnifiedTopology: true, }; - // Connect to cluster - let client = new MongoClient(MONGODB_URI, opts); + const client = new MongoClient(MONGODB_URI, opts); await client.connect(); - let db = client.db(MONGODB_DB); + const db = client.db(MONGODB_DB); - // set cache cachedClient = client; cachedDb = db; From 2d3c9b76b18e24197196adf3bd4d7063f6a8a0fd Mon Sep 17 00:00:00 2001 From: SpriteyOnTheDraconic <91148727+SpriteyOnTheDraconic@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:08:46 +0200 Subject: [PATCH 06/12] Update createProject.js --- pages/api/createProject.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/api/createProject.js b/pages/api/createProject.js index d75bad9..ba29a92 100644 --- a/pages/api/createProject.js +++ b/pages/api/createProject.js @@ -10,7 +10,7 @@ export default async function handler(req, res) { user: userId, createdAt: new Date(), html: `
-

Welcome to codebox 🚀🔥

+

Welcome to CodeSprite 🚀🔥

`, @@ -21,6 +21,11 @@ export default async function handler(req, res) { flex-direction: column; align-items: center; } + + body{ + background-color: aliceblue; + } + h2 { color: cornflowerblue; } From a81cbb73c722aea5661c73f30f2b439ca01234c2 Mon Sep 17 00:00:00 2001 From: SpriteyOnTheDraconic <91148727+SpriteyOnTheDraconic@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:09:49 +0200 Subject: [PATCH 07/12] Update [id].jsx --- pages/preview/[id].jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/preview/[id].jsx b/pages/preview/[id].jsx index 97a6221..5d7861b 100644 --- a/pages/preview/[id].jsx +++ b/pages/preview/[id].jsx @@ -25,7 +25,7 @@ export default function Preview() { router.push({ pathname: "/" }); } else { const { name, html, css, js } = data; - document.title = `Codebox Preview - ${name}`; + document.title = `CodeSprite Preview - ${name}`; setSrcDoc(` ${html} From f6e4411f188a07e0ef9e835fa66b50c3cb856f09 Mon Sep 17 00:00:00 2001 From: SpriteyOnTheDraconic <91148727+SpriteyOnTheDraconic@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:10:03 +0200 Subject: [PATCH 08/12] Update [id].jsx --- pages/project/[id].jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/project/[id].jsx b/pages/project/[id].jsx index 5ec74f2..76caff7 100644 --- a/pages/project/[id].jsx +++ b/pages/project/[id].jsx @@ -52,7 +52,7 @@ export default function Project() { if (isError) { router.push({ pathname: "/" }); } else { - document.title = `Codebox - ${data.name}`; + document.title = `CodeSprite - ${data.name}`; setHTML(data.html); setCSS(data.css); setJS(data.js); @@ -84,9 +84,11 @@ export default function Project() { />
- +
+ Preview 🔥 +