import { useState, useEffect } from "react";
import { Link } from "react-router-dom";
import { IconCrossStroked } from "@douyinfe/semi-icons";
import SimpleCanvas from "../components/SimpleCanvas";
import Navbar from "../components/Navbar";
import { diagram } from "../data/heroDiagram";
import mysql_icon from "../assets/mysql.png";
import postgres_icon from "../assets/postgres.png";
import sqlite_icon from "../assets/sqlite.png";
import mariadb_icon from "../assets/mariadb.png";
import oraclesql_icon from "../assets/oraclesql.png";
import sql_server_icon from "../assets/sql-server.png";
import discord from "../assets/discord.png";
import github from "../assets/github.png";
import screenshot from "../assets/screenshot.png";
import FadeIn from "../animations/FadeIn";
import axios from "axios";
import { languages } from "../i18n/i18n";
import { Tweet } from "react-tweet";
import { socials } from "../data/socials";
function shortenNumber(number) {
if (number < 1000) return number;
if (number >= 1000 && number < 1_000_000)
return `${(number / 1000).toFixed(1)}k`;
}
export default function LandingPage() {
const [showSurvey, setShowSurvey] = useState(true);
const [stats, setStats] = useState({ stars: 18000, forks: 1200 });
useEffect(() => {
const fetchStats = async () => {
await axios
.get("https://api.github-star-counter.workers.dev/user/drawdb-io")
.then((res) => setStats(res.data));
};
document.body.setAttribute("theme-mode", "light");
document.title =
"drawDB | Online database diagram editor and SQL generator";
fetchStats();
}, []);
return (
{showSurvey && (
Help us improve! Share your feedback.
)}
{/* Hero section */}
Draw, Copy, and Paste
Free and open source, simple, and intuitive database design
editor, data-modeler, and SQL generator.{" "}
No sign up
Free of charge
Quick and easy
Try it for yourself
{/* Learn more */}
{shortenNumber(stats.stars)}
GitHub stars
{shortenNumber(stats.forks)}
GitHub forks
{shortenNumber(languages.length)}
Languages
Build diagrams with a few clicks, see the full picture, export SQL
scripts, customize your editor, and more.
Design for your database
{dbs.map((s, i) => (

))}
{/* Features */}
More than just an editor
What drawDB has to offer
{features.map((f, i) => (
{f.title}
{f.content}
{f.footer}
))}
{/* Tweets */}
What the internet says about us
{/* Contact us */}
Reach out to us
We love hearing from you. Join our community on Discord, GitHub, and
X.
Attention! The diagrams are saved in your browser. Before clearing the
browser make sure to back up your data.
© 2024 drawDB - All right reserved.
);
}
const dbs = [
{ icon: mysql_icon, height: 80 },
{ icon: postgres_icon, height: 48 },
{ icon: sqlite_icon, height: 64 },
{ icon: mariadb_icon, height: 64 },
{ icon: sql_server_icon, height: 64 },
{ icon: oraclesql_icon, height: 172 },
];
const features = [
{
title: "Export",
content: (
Export the DDL script to run on your database or export the diagram as a
JSON or an image.
),
footer: "",
},
{
title: "Reverse engineer",
content: (
Already have a schema? Import a DDL script to generate a diagram.
),
footer: "",
},
{
title: "Customizable workspace",
content: (
Customize the UI to fit your preferences. Select the components you want
in your view.
),
footer: "",
},
{
title: "Keyboard shortcuts",
content: (
Speed up development with keyboard shortuts. See all available shortcuts
here
.
),
footer: "",
},
{
title: "Templates",
content: (
Start off with pre-built templates. Get a quick start or get inspirition
for your design.
),
footer: "",
},
{
title: "Custom Templates",
content: (
Have boilerplate structures? Save time by saving them as templates and
load them when needed.
),
footer: "",
},
{
title: "Robust editor",
content: (
Undo, redo, copy, paste, duplacate and more. Add tables, subject areas,
and notes.
),
footer: "",
},
{
title: "Issue detection",
content: (
Detect and tackle errors in the diagram to make sure the scripts are
correct.
),
footer: "",
},
{
title: "Relational databases",
content: (
We support 5 relational databases - MySQL, PostgreSQL, SQLite, MariaDB,
SQL Server.
),
footer: "",
},
{
title: "Object-Relational databases",
content: (
Add custom types for object-relational databases, or create custom JSON
schemes.
),
footer: "",
},
{
title: "Presentation mode",
content: (
Present your diagrams on a big screen during team meetings and
discussions.
),
footer: "",
},
{
title: "Track todos",
content: Keep track of tasks and mark them done when finished.
,
footer: "",
},
];