Free, simple, and intuitive online database diagram editor and SQL generator.
JavaScript databasedatabase-designdatabase-diagramdatabase-schemadbmldiagram-editoreditorer-diagramerderdiagramindexeddbmariadbmcporacle-databaseoracle-dbpostgresqlschema-designsqlsql-serversqlite
Remove files from older version
1ilitaac1eb45846b
diff --git a/public/images/emoji/1F600.png b/public/images/emoji/1F600.pngdeleted file mode 100644index ba0e4feb..00000000Binary files a/public/images/emoji/1F600.png and /dev/null differdiff --git a/public/images/emoji/1F641.png b/public/images/emoji/1F641.pngdeleted file mode 100644index 0dd4e5be..00000000Binary files a/public/images/emoji/1F641.png and /dev/null differdiff --git a/public/images/emoji/1F642.png b/public/images/emoji/1F642.pngdeleted file mode 100644index b37115fd..00000000Binary files a/public/images/emoji/1F642.png and /dev/null differdiff --git a/public/images/emoji/2764.png b/public/images/emoji/2764.pngdeleted file mode 100644index 2c6c24a9..00000000Binary files a/public/images/emoji/2764.png and /dev/null differdiff --git a/public/images/emoji/LICENSE.md b/public/images/emoji/LICENSE.mddeleted file mode 100644index 87b04e9a..00000000--- a/public/images/emoji/LICENSE.md+++ /dev/null@@ -1,5 +0,0 @@-OpenMoji-https://openmoji.org--Licensed under Attribution-ShareAlike 4.0 International-https://creativecommons.org/licenses/by-sa/4.0/diff --git a/src/animations/Reveal.jsx b/src/animations/Reveal.jsxdeleted file mode 100644index 5ef2a402..00000000--- a/src/animations/Reveal.jsx+++ /dev/null@@ -1,30 +0,0 @@-import { useRef, useEffect } from "react";-import { motion, useInView, useAnimation } from "framer-motion";--export default function Reveal({ children }) {- const ref = useRef(null);- const isInView = useInView(ref, { once: true });- const mainControls = useAnimation();-- useEffect(() => {- if (isInView) {- mainControls.start("visible");- }- }, [isInView, mainControls]);-- return (- <div ref={ref}>- <motion.div- variants={{- hidden: { opacity: 0, y: 75 },- visible: { opacity: 1, y: 0 },- }}- initial="hidden"- animate={mainControls}- transition={{ duration: 0.6 }}- >- {children}- </motion.div>- </div>- );-}\ No newline at end of filediff --git a/src/assets/bot.png b/src/assets/bot.pngdeleted file mode 100644index 6e5776c1..00000000Binary files a/src/assets/bot.png and /dev/null differdiff --git a/src/assets/chat.png b/src/assets/chat.pngdeleted file mode 100644index 42543a06..00000000Binary files a/src/assets/chat.png and /dev/null differdiff --git a/src/assets/google.png b/src/assets/google.pngdeleted file mode 100644index fa72a27e..00000000Binary files a/src/assets/google.png and /dev/null differdiff --git a/src/assets/group.png b/src/assets/group.pngdeleted file mode 100644index 3cc74c0c..00000000Binary files a/src/assets/group.png and /dev/null differdiff --git a/src/assets/logo_dark_46.png b/src/assets/logo_dark_46.pngdeleted file mode 100644index bb967793..00000000Binary files a/src/assets/logo_dark_46.png and /dev/null differdiff --git a/src/assets/logo_light_46.png b/src/assets/logo_light_46.pngdeleted file mode 100644index 966ffac6..00000000Binary files a/src/assets/logo_light_46.png and /dev/null differdiff --git a/src/components/Chat.jsx b/src/components/Chat.jsxdeleted file mode 100644index 12035609..00000000--- a/src/components/Chat.jsx+++ /dev/null@@ -1,64 +0,0 @@-import { useContext, useState } from "react";-import { Button, Input, Tag, Avatar } from "@douyinfe/semi-ui";-import { IconSend } from "@douyinfe/semi-icons";-import { socket } from "../data/socket";-import { MessageContext } from "../pages/Editor";--export default function Chat() {- const [message, setMessage] = useState("");- const { messages } = useContext(MessageContext);-- return (- <div className="mx-5 flex flex-col h-full sidesheet-theme">- <div className="h-full flex-1 overflow-y-auto flex flex-col-reverse py-2">- {messages.map((m, i) =>- m.type === "note" ? (- <div key={i} className="text-center my-1">- <Tag size="large" color={m.action === "join" ? "blue" : "amber"}>- {m.message}- </Tag>- </div>- ) : messages[i + 1].id !== m.id ? (- <div key={i} className="flex pt-1">- <Avatar- size="small"- alt={m.name}- color={m.color}- className="border border-color"- >- {m.name.split(" ").map((c) => c[0])}- </Avatar>- <div className="ms-2">- <div className="font-semibold">{m.name}</div>- <div>{m.message}</div>- </div>- </div>- ) : (- <div key={i} className="ms-10">- {m.message}- </div>- )- )}- </div>- <form- onSubmit={(e) => {- e.preventDefault();- if (message.trim() !== "") {- socket.emit("send-message", message);- }- setMessage("");- }}- className="flex mt-2"- >- <Input- onChange={(v) => setMessage(v)}- placeholder="Message"- value={message}- autoComplete="off"- className="me-2"- ></Input>- <Button icon={<IconSend />} htmlType="submit"></Button>- </form>- </div>- );-}diff --git a/src/components/DrawBot.jsx b/src/components/DrawBot.jsxdeleted file mode 100644index 5ca27d58..00000000--- a/src/components/DrawBot.jsx+++ /dev/null@@ -1,47 +0,0 @@-import { useContext, useState } from "react";-import { Button, Input, Avatar } from "@douyinfe/semi-ui";-import { IconSend } from "@douyinfe/semi-icons";-import { BotMessageContext } from "../pages/Editor";-import botIcon from "../assets/bot.png";--export default function DrawBot() {- const [message, setMessage] = useState("");- const { botMessages } = useContext(BotMessageContext);-- return (- <div className="mx-5 flex flex-col h-full sidesheet-theme">- <div className="h-full flex-1 overflow-y-auto flex flex-col-reverse py-2">- {botMessages.map((m, i) => (- <div key={i} className="flex pt-1">- <Avatar size="small" src={botIcon}>- {m.sender === "bot" ? "drawBOT" : "You"}- </Avatar>- <div className="ms-2">- <div className="font-semibold">- {m.sender === "bot" ? "drawBOT" : "You"}- </div>- <div>{m.message}</div>- </div>- </div>- ))}- </div>- <form- onSubmit={(e) => {- e.preventDefault();-- setMessage("");- }}- className="flex mt-2"- >- <Input- onChange={(v) => setMessage(v)}- placeholder="Message"- value={message}- autoComplete="off"- className="me-2"- ></Input>- <Button icon={<IconSend />} htmlType="submit"></Button>- </form>- </div>- );-}diff --git a/src/data/editor_config.js b/src/data/editorConfig.jssimilarity index 100%rename from src/data/editor_config.jsrename to src/data/editorConfig.jsdiff --git a/src/data/signupDiagram.js b/src/data/signupDiagram.jsdeleted file mode 100644index d3ca8000..00000000--- a/src/data/signupDiagram.js+++ /dev/null@@ -1,71 +0,0 @@-const xOffset = window.innerWidth * 0.42 * 0.15;-export const diagram = {- tables: [- {- name: "galactic_users",- x: xOffset + 101,- y: window.innerHeight * 0.75 - (4 * 36 + 50 + 7) * 0.5,- fields: [- {- name: "id",- type: "INT",- },- {- name: "username",- type: "VARCHAR",- },- {- name: "email",- type: "VARCHAR",- },- {- name: "password",- type: "VARCHAR",- },- ],- color: "#7d9dff",- },- {- name: "celestial_data",- x: xOffset,- y: window.innerHeight * 0.32 - (5 * 36 + 50 + 7) * 0.5,- fields: [- {- name: "id",- type: "INT",- },- {- name: "user_id",- type: "INT",- },- {- name: "type",- type: "ENUM",- },- {- name: "time",- type: "TIMESTAMP",- },- {- name: "content",- type: "VARCHAR",- },- ],- color: "#89e667",- },- ],- relationships: [- {- startTableId: 1,- startFieldId: 1,- endTableId: 0,- endFieldId: 0,- startX: xOffset + 16,- startY:- window.innerHeight * 0.32 - (4 * 36 + 50 + 7) * 0.5 + (50 + 18 * 2),- endX: xOffset + 115,- endY: window.innerHeight * 0.75 - (4 * 36 + 50 + 7) * 0.5 + (50 + 18 * 1),- cardinality: "Many to one",- },- ],-};\ No newline at end of filediff --git a/src/data/socket.js b/src/data/socket.jsdeleted file mode 100644index d2dc7530..00000000--- a/src/data/socket.js+++ /dev/null@@ -1,7 +0,0 @@-import { io } from "socket.io-client";--const URL = "http://localhost:5000";--export const socket = io(URL, {- autoConnect: false,-});diff --git a/src/pages/BugReport.jsx b/src/pages/BugReport.jsxindex 477af8fc..d2b06473 100644--- a/src/pages/BugReport.jsx+++ b/src/pages/BugReport.jsx@@ -10,7 +10,7 @@ import {} from "@douyinfe/semi-icons";import RichEditor from "../components/RichEditor";import { LexicalComposer } from "@lexical/react/LexicalComposer";-import { editorConfig } from "../data/editor_config";+import { editorConfig } from "../data/editorConfig";import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";import { $generateHtmlFromNodes } from "@lexical/html";import { CLEAR_EDITOR_COMMAND } from "lexical";diff --git a/src/pages/Dashboard.jsx b/src/pages/Dashboard.jsxdeleted file mode 100644index cfe25f87..00000000--- a/src/pages/Dashboard.jsx+++ /dev/null@@ -1,92 +0,0 @@-import { useEffect, useState } from "react";-import { useCookies } from "react-cookie";-import logo_light from "../assets/logo_light_160.png";-import logo_dark from "../assets/logo_dark_160.png";--const Page = {- MY_FILES: 0,- SHARED: 1,- TEMPLATES: 2,- TODOS: 3,- SETTINGS: 4,-};--export default function Dashboard() {- const [cookies] = useCookies(["username"]);- const [theme, setTheme] = useState("");- const [currentPage, setCurrentPage] = useState(Page.MY_FILES);-- const buttons = [- {- icon: "fa-regular fa-folder-closed",- label: "My files",- onClick: () => setCurrentPage(Page.MY_FILES),- },- {- icon: "fa-solid fa-share-from-square",- label: "Shared",- onClick: () => setCurrentPage(Page.SHARED),- },- {- icon: "fa-solid fa-book",- label: "Templates",- onClick: () => setCurrentPage(Page.TEMPLATES),- },- {- icon: "fa-solid fa-list",- label: "My to-dos",- onClick: () => setCurrentPage(Page.TODOS),- },- {- icon: "fa-solid fa-diagram-project",- label: "Editor",- onClick: () => window.open("/editor"),- },- {- icon: "bi bi-gear",- label: "Settings",- onClick: () => setCurrentPage(Page.SETTINGS),- },- ];-- const pages = [- <div key={0}>My files</div>,- <div key={0}>Shared</div>,- <div key={0}>Templates</div>,- <div key={0}>Todos</div>,- <div key={0}>Settings</div>,- ];-- useEffect(() => {- const t = localStorage.getItem("theme");- setTheme(t);- if (t) document.body.setAttribute("theme-mode", t);- document.title = cookies.username + "'s Dashboard | drawDB";- document.body.setAttribute("class", "theme");- }, [setTheme, cookies]);-- return (- <div className="grid grid-cols-10">- <div className="h-screen overflow-hidden border-r border-zinc-800 col-span-2 py-8 px-8">- <img- src={theme === "dark" ? logo_dark : logo_light}- alt="logo"- className="w-[70%]"- />- <div className="font-semibold my-6 tracking-wide ">- {buttons.map((b, i) => (- <button- key={i}- onClick={b.onClick}- className="flex items-center w-full hover:bg-zinc-800 p-2 py-2.5 rounded-md cursor-pointer opacity-70 hover:opacity-100"- >- <i className={`${b.icon} me-5`}></i>- <div>{b.label}</div>- </button>- ))}- </div>- </div>- <div className="col-span-8 py-8 px-24">{pages[currentPage]}</div>- </div>- );-}diff --git a/src/pages/Home.jsx b/src/pages/Home.jsxdeleted file mode 100644index 6cb72889..00000000--- a/src/pages/Home.jsx+++ /dev/null@@ -1,8 +0,0 @@-import LandingPage from "./LandingPage";-import Dashboard from "./Dashboard";-import { useCookies } from "react-cookie";--export default function Home() {- const [cookies] = useCookies(["logged_in"]);- return <div>{cookies.logged_in ? <Dashboard /> : <LandingPage />}</div>;-}diff --git a/src/pages/Login.jsx b/src/pages/Login.jsxdeleted file mode 100644index 90a42d1d..00000000--- a/src/pages/Login.jsx+++ /dev/null@@ -1,141 +0,0 @@-import { useEffect, useState } from "react";-import { Link, useNavigate } from "react-router-dom";-import logo from "../assets/icon_dark_64.png";-import google_logo from "../assets/google.png";-import github_logo from "../assets/github.png";-import axios from "axios";-import Canvas from "../components/SimpleCanvas";-import { diagram } from "../data/loginDiagram";--import { useCookies } from "react-cookie";--export default function Login() {- const [formValues, setFormValues] = useState({- email: "",- password: "",- });- const [showPassword, setShowPassword] = useState(false);- const [, setCookie] = useCookies(["logged_in", "username"]);- const navigate = useNavigate();-- const handleChange = (e) =>- setFormValues((prev) => ({- ...prev,- [e.target.name]: e.target.value,- }));-- const onSubmit = async () => {- await axios- .post(- `${import.meta.env.VITE_API_BACKEND_URL}/login`,- {- email: formValues.email,- password: formValues.password,- },- { withCredentials: true }- )- .then((res) => {- setCookie("logged_in", true, {- path: "/",- expires: new Date(Date.parse(res.data.session.cookie.expires)),- });- setCookie("username", res.data.username, {- path: "/",- expires: new Date(Date.parse(res.data.session.cookie.expires)),- });- navigate("/");- })- .catch(() => {});- };-- useEffect(() => {- document.title = "Log in | drawDB";- });-- return (- <div className="grid grid-cols-7 h-screen bg-white">- <div className="col-span-3 rounded-r-[2rem] bg-white sm:col-span-full md:col-span-full flex flex-col justify-center items-center border border-zinc-200 shadow-xl z-10">- <div className="w-[70%] sm:w-[80%] md:w-[75%]">- <div className="text-2xl font-bold text-zinc-800 tracking-wide">- Welcome back!- </div>- <div className="flex items-center sm:block my-6 gap-4 font-semibold text-sm">- <button className="sm:mb-2 w-full flex gap-2 justify-center items-center px-3 py-2 rounded-md border border-zinc-300 hover:bg-neutral-100 transition-all duration-300">- <img src={google_logo} width={22} />- <div>Log in with Google</div>- </button>- <button className="w-full flex gap-2 justify-center items-center px-3 py-2 rounded-md border border-zinc-300 hover:bg-neutral-100 transition-all duration-300">- <img src={github_logo} width={22} />- <div>Log in with Github</div>- </button>- </div>- <div className="flex items-center justify-center my-1">- <hr className="border-zinc-300 flex-grow" />- <div className="mx-2 text-zinc-500">or</div>- <hr className="border-zinc-300 flex-grow" />- </div>- <div>- <label- className="font-semibold text-zinc-600 text-sm"- htmlFor="email"- >- </label>- <input- id="email"- name="email"- className="py-2 px-3 block w-full mb-0.5 border rounded border-zinc-400 border-opacity-70 hover:shadow focus:outline-blue-600"- onChange={handleChange}- />- <label- className="font-semibold text-zinc-600 text-sm"- htmlFor="password"- >- Password- </label>- <div className="mb-3 relative">- <input- id="password"- name="password"- type={showPassword ? "text" : "password"}- className="py-2 ps-3 pe-10 block w-full border rounded border-zinc-400 border-opacity-70 hover:shadow focus:outline-blue-600"- onChange={handleChange}- />- <button- className="absolute right-3 top-[50%] translate-y-[-50%] text-blue-900 text-lg"- onClick={() => setShowPassword((prev) => !prev)}- >- {showPassword ? (- <i className="bi bi-eye-fill"></i>- ) : (- <i className="bi bi-eye-slash-fill"></i>- )}- </button>- </div>- <button- className="w-full px-3 py-2.5 mt-4 mb-2 bg-[#386b8f] hover:bg-[#467ba1] rounded-md text-white font-semibold"- onClick={onSubmit}- >- Log in- </button>- <div className="text-sm">- Already have an account?- <Link- to="/signup"- className="ms-2 font-semibold text-indigo-700 hover:underline"- >- Sign up here.- </Link>- </div>- </div>- </div>- </div>- <div className="bg-white col-span-4 sm:hidden md:hidden overflow-y-hidden relative">- <Canvas diagram={diagram} />- <Link to="/">- <img src={logo} className="absolute right-0 top-0 p-3" width={56} />- </Link>- </div>- </div>- );-}diff --git a/src/pages/Signup.jsx b/src/pages/Signup.jsxdeleted file mode 100644index 16ade345..00000000--- a/src/pages/Signup.jsx+++ /dev/null@@ -1,202 +0,0 @@-import { useEffect, useState } from "react";-import { Link } from "react-router-dom";-import logo from "../assets/icon_dark_64.png";-import google_logo from "../assets/google.png";-import github_logo from "../assets/github.png";-import axios from "axios";-import { Toast } from "@douyinfe/semi-ui";-import Canvas from "../components/SimpleCanvas";-import { diagram } from "../data/signupDiagram";--export default function SignUp() {- const [formValues, setFormValues] = useState({- username: "",- email: "",- password: "",- });- const [showPassword, setShowPassword] = useState(false);- const [showVerified, setShowVerified] = useState(false);- const [resendCounter, setResendCounter] = useState(0);-- const handleChange = (e) =>- setFormValues((prev) => ({- ...prev,- [e.target.name]: e.target.value,- }));-- const onSubmit = async () => {- await axios- .post(`${import.meta.env.VITE_API_BACKEND_URL}/signup`, {- username: formValues.username,- email: formValues.email,- password: formValues.password,- })- .then(() => setShowVerified(true))- .catch(() => {});- };-- const resendEmail = async () => {- await axios- .post(`${import.meta.env.VITE_API_BACKEND_URL}/resend`, {- username: formValues.username,- email: formValues.email,- password: formValues.password,- })- .then(() => setResendCounter((prev) => prev + 1))- .catch((e) => {- if (e.response.status === 400)- Toast.error("Account has already been verified.");- });- };-- useEffect(() => {- document.title = "Create account | drawDB";- });-- return (- <div className="grid grid-cols-7 h-screen bg-white">- <div className="bg-white col-span-3 sm:hidden md:hidden lg:col-span-3 overflow-y-hidden relative">- <Canvas diagram={diagram} />- <Link to="/">- <img src={logo} className="absolute left-0 top-0 p-3" width={56} />- </Link>- </div>- <div className="col-span-4 rounded-l-[2rem] bg-white sm:col-span-full md:col-span-full flex flex-col justify-center items-center border border-zinc-200 shadow-xl z-10">- <div className="w-[64%] sm:w-[80%] md:w-[72%]">- {!showVerified ? (- <>- <div className="text-2xl font-bold text-zinc-800 tracking-wide">- Create Account- </div>- <div className="flex items-center my-6 gap-4 font-semibold text-sm">- <button className="w-full flex gap-2 justify-center items-center px-3 py-2 rounded-md border border-zinc-300 hover:bg-neutral-100 transition-all duration-300">- <img src={google_logo} width={22} />- <div>Sign up with Google</div>- </button>- <button className="w-full flex gap-2 justify-center items-center px-3 py-2 rounded-md border border-zinc-300 hover:bg-neutral-100 transition-all duration-300">- <img src={github_logo} width={22} />- <div>Sign up with Github</div>- </button>- </div>- <div className="flex items-center justify-center my-1">- <hr className="border-zinc-300 flex-grow" />- <div className="mx-2 text-zinc-500">or</div>- <hr className="border-zinc-300 flex-grow" />- </div>- <div>- <label- className="font-semibold text-zinc-600 text-sm"- htmlFor="username"- >- Username- </label>- <input- id="username"- name="username"- className="py-2 px-3 block w-full mb-0.5 border rounded border-zinc-400 border-opacity-70 hover:shadow focus:outline-blue-600"- onChange={handleChange}- />- <label- className="font-semibold text-zinc-600 text-sm"- htmlFor="email"- >- </label>- <input- id="email"- name="email"- className="py-2 px-3 block w-full mb-0.5 border rounded border-zinc-400 border-opacity-70 hover:shadow focus:outline-blue-600"- onChange={handleChange}- />- <label- className="font-semibold text-zinc-600 text-sm"- htmlFor="password"- >- Password- </label>- <div className="mb-3 relative">- <input- id="password"- name="password"- type={showPassword ? "text" : "password"}- className="py-2 ps-3 pe-10 block w-full border rounded border-zinc-400 border-opacity-70 hover:shadow focus:outline-blue-600"- onChange={handleChange}- />- <button- className="absolute right-3 top-[50%] translate-y-[-50%] text-blue-900 text-lg"- onClick={() => setShowPassword((prev) => !prev)}- >- {showPassword ? (- <i className="bi bi-eye-fill"></i>- ) : (- <i className="bi bi-eye-slash-fill"></i>- )}- </button>- </div>- <button- className="w-full px-3 py-2.5 mt-4 mb-2 bg-[#386b8f] hover:bg-[#467ba1] rounded-md text-white font-semibold"- onClick={onSubmit}- >- Sign up- </button>- <div className="text-sm">- Already have an account?- <Link- to="/login"- className="ms-2 font-semibold text-indigo-700 hover:underline"- >- Log in here.- </Link>- </div>- </div>- </>- ) : (- <>- <div className="text-2xl font-bold text-zinc-800 tracking-wide">- Verify Account- </div>- <div className="my-6 space-y-1.5">- <div>- We {resendCounter == 0 ? "sent" : "resent"} a verification- email to{" "}- <span className="text-blue-700 font-bold">- {formValues.email}- </span>- .- </div>- <div>Please check your inbox and verify your email.</div>- </div>- <div>- <div className="font-bold">Don't see the email?</div>- {resendCounter < 4 ? (- <div className="mt-1.5 text-sm leading-6">- If you haven't recieved the email after a few minutes,- make sure to check your junk mail or{" "}- <button- onClick={resendEmail}- className="text-blue-700 font-bold hover:underline"- >- resend verification- </button>- .- </div>- ) : (- <div className="mt-1.5 text-sm leading-6">- Looks like we're having trouble signing you up. Please- try again in a little bit or contact us at{" "}- <a- href="mailto:hi"- className="text-blue-700 hover:underline font-bold"- >- </a>- </div>- )}- </div>- </>- )}- </div>- </div>- </div>- );-}diff --git a/src/pages/Survey.jsx b/src/pages/Survey.jsxindex 4fb2e625..c3239e13 100644--- a/src/pages/Survey.jsx+++ b/src/pages/Survey.jsx@@ -15,7 +15,7 @@ import {import { IconSun, IconMoon } from "@douyinfe/semi-icons";import RichEditor from "../components/RichEditor";import { LexicalComposer } from "@lexical/react/LexicalComposer";-import { editorConfig } from "../data/editor_config";+import { editorConfig } from "../data/editorConfig";import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";import { $generateHtmlFromNodes } from "@lexical/html";import { CLEAR_EDITOR_COMMAND } from "lexical";