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 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" /> ); 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 👨‍💻 + - + + 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; 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; } diff --git a/pages/index.js b/pages/index.js index dc8756e..7ed27ea 100644 --- a/pages/index.js +++ b/pages/index.js @@ -52,7 +52,7 @@ export default function Home() {
Home - +
- +
+ Preview 🔥 +