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migrations/20240816162230_init/migration.sql deleted file mode 100644 index f6a1066ab..000000000 --- a/apps/api/prisma/migrations/20240816162230_init/migration.sql +++ /dev/null @@ -1,121 +0,0 @@ --- CreateTable -CREATE TABLE "Article" ( - "id" SERIAL NOT NULL, - "slug" TEXT NOT NULL, - "title" TEXT NOT NULL, - "description" TEXT NOT NULL, - "body" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "authorId" INTEGER NOT NULL, - - CONSTRAINT "Article_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Comment" ( - "id" SERIAL NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "body" TEXT NOT NULL, - "articleId" INTEGER NOT NULL, - "authorId" INTEGER NOT NULL, - - CONSTRAINT "Comment_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Tag" ( - "id" SERIAL NOT NULL, - "name" TEXT NOT NULL, - - CONSTRAINT "Tag_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "User" ( - "id" SERIAL NOT NULL, - "email" TEXT NOT NULL, - "username" TEXT NOT NULL, - "password" TEXT NOT NULL, - "image" TEXT DEFAULT 'https://api.realworld.io/images/smiley-cyrus.jpeg', - "bio" TEXT, - "demo" BOOLEAN NOT NULL DEFAULT false, - - CONSTRAINT "User_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "_ArticleToTag" ( - "A" INTEGER NOT NULL, - "B" INTEGER NOT NULL -); - --- CreateTable -CREATE TABLE "_UserFavorites" ( - "A" INTEGER NOT NULL, - "B" INTEGER NOT NULL -); - --- CreateTable -CREATE TABLE "_UserFollows" ( - "A" INTEGER NOT NULL, - "B" INTEGER NOT NULL -); - --- CreateIndex -CREATE UNIQUE INDEX "Article_slug_key" ON "Article"("slug"); - --- CreateIndex -CREATE UNIQUE INDEX "Tag_name_key" ON "Tag"("name"); - --- CreateIndex -CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); - --- CreateIndex -CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); - --- CreateIndex -CREATE UNIQUE INDEX "_ArticleToTag_AB_unique" ON "_ArticleToTag"("A", "B"); - --- CreateIndex -CREATE INDEX "_ArticleToTag_B_index" ON "_ArticleToTag"("B"); - --- CreateIndex -CREATE UNIQUE INDEX "_UserFavorites_AB_unique" ON "_UserFavorites"("A", "B"); - --- CreateIndex -CREATE INDEX "_UserFavorites_B_index" ON "_UserFavorites"("B"); - --- CreateIndex -CREATE UNIQUE INDEX "_UserFollows_AB_unique" ON "_UserFollows"("A", "B"); - --- CreateIndex -CREATE INDEX "_UserFollows_B_index" ON "_UserFollows"("B"); - --- AddForeignKey -ALTER TABLE "Article" ADD CONSTRAINT "Article_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Comment" ADD CONSTRAINT "Comment_articleId_fkey" FOREIGN KEY ("articleId") REFERENCES "Article"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Comment" ADD CONSTRAINT "Comment_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_ArticleToTag" ADD CONSTRAINT "_ArticleToTag_A_fkey" FOREIGN KEY ("A") REFERENCES "Article"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_ArticleToTag" ADD CONSTRAINT "_ArticleToTag_B_fkey" FOREIGN KEY ("B") REFERENCES "Tag"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_UserFavorites" ADD CONSTRAINT "_UserFavorites_A_fkey" FOREIGN KEY ("A") REFERENCES "Article"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_UserFavorites" ADD CONSTRAINT "_UserFavorites_B_fkey" FOREIGN KEY ("B") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_UserFollows" ADD CONSTRAINT "_UserFollows_A_fkey" FOREIGN KEY ("A") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "_UserFollows" ADD CONSTRAINT "_UserFollows_B_fkey" FOREIGN KEY ("B") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/apps/api/prisma/migrations/20241009081140_init/migration.sql b/apps/api/prisma/migrations/20241009081140_init/migration.sql new file mode 100644 index 000000000..8e2199027 --- /dev/null +++ b/apps/api/prisma/migrations/20241009081140_init/migration.sql @@ -0,0 +1,95 @@ +-- CreateTable +CREATE TABLE "Article" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "slug" TEXT NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT NOT NULL, + "body" TEXT NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "authorId" INTEGER NOT NULL, + CONSTRAINT "Article_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Comment" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "body" TEXT NOT NULL, + "articleId" INTEGER NOT NULL, + "authorId" INTEGER NOT NULL, + CONSTRAINT "Comment_articleId_fkey" FOREIGN KEY ("articleId") REFERENCES "Article" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "Comment_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Tag" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "name" TEXT NOT NULL +); + +-- CreateTable +CREATE TABLE "User" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "email" TEXT NOT NULL, + "username" TEXT NOT NULL, + "password" TEXT NOT NULL, + "image" TEXT DEFAULT 'https://api.realworld.io/images/smiley-cyrus.jpeg', + "bio" TEXT, + "demo" BOOLEAN NOT NULL DEFAULT false +); + +-- CreateTable +CREATE TABLE "_ArticleToTag" ( + "A" INTEGER NOT NULL, + "B" INTEGER NOT NULL, + CONSTRAINT "_ArticleToTag_A_fkey" FOREIGN KEY ("A") REFERENCES "Article" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "_ArticleToTag_B_fkey" FOREIGN KEY ("B") REFERENCES "Tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "_UserFavorites" ( + "A" INTEGER NOT NULL, + "B" INTEGER NOT NULL, + CONSTRAINT "_UserFavorites_A_fkey" FOREIGN KEY ("A") REFERENCES "Article" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "_UserFavorites_B_fkey" FOREIGN KEY ("B") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "_UserFollows" ( + "A" INTEGER NOT NULL, + "B" INTEGER NOT NULL, + CONSTRAINT "_UserFollows_A_fkey" FOREIGN KEY ("A") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "_UserFollows_B_fkey" FOREIGN KEY ("B") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateIndex +CREATE UNIQUE INDEX "Article_slug_key" ON "Article"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "Tag_name_key" ON "Tag"("name"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); + +-- CreateIndex +CREATE UNIQUE INDEX "_ArticleToTag_AB_unique" ON "_ArticleToTag"("A", "B"); + +-- CreateIndex +CREATE INDEX "_ArticleToTag_B_index" ON "_ArticleToTag"("B"); + +-- CreateIndex +CREATE UNIQUE INDEX "_UserFavorites_AB_unique" ON "_UserFavorites"("A", "B"); + +-- CreateIndex +CREATE INDEX "_UserFavorites_B_index" ON "_UserFavorites"("B"); + +-- CreateIndex +CREATE UNIQUE INDEX "_UserFollows_AB_unique" ON "_UserFollows"("A", "B"); + +-- CreateIndex +CREATE INDEX "_UserFollows_B_index" ON "_UserFollows"("B"); diff --git a/apps/api/prisma/migrations/migration_lock.toml b/apps/api/prisma/migrations/migration_lock.toml index fbffa92c2..e5e5c4705 100644 --- a/apps/api/prisma/migrations/migration_lock.toml +++ b/apps/api/prisma/migrations/migration_lock.toml @@ -1,3 +1,3 @@ # Please do not edit this file manually # It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file +provider = "sqlite" \ No newline at end of file diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 9f88c48a4..40ebb3d13 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -1,6 +1,6 @@ datasource db { - provider = "postgresql" - url = env("DATABASE_URL") + provider = "sqlite" + url = "file:./dev.db" } generator client { diff --git a/apps/documentation/src/assets/swagger.json b/apps/documentation/src/assets/swagger.json index 0a256fd31..66334827f 100644 --- a/apps/documentation/src/assets/swagger.json +++ b/apps/documentation/src/assets/swagger.json @@ -5,7 +5,7 @@ "description": "Conduit API documentation", "contact": { "name": "RealWorld", - "url": "https://realworld.how" + "url": "https://realworld-docs.netlify.app/" }, "license": { "name": "MIT License", diff --git a/apps/documentation/src/content/docs/implementation-creation/introduction.md b/apps/documentation/src/content/docs/implementation-creation/introduction.md index 2433afade..1684fe635 100644 --- a/apps/documentation/src/content/docs/implementation-creation/introduction.md +++ b/apps/documentation/src/content/docs/implementation-creation/introduction.md @@ -3,7 +3,6 @@ title: Introduction --- **Conduit** is a social blogging site (i.e. a Medium.com clone). It uses a custom API for all requests, including authentication. -Discover our [live demo](https://demo.realworld.how). :::tip Check for [Discussions](https://github.com/gothinkster/realworld/discussions/categories/wip-implementations) about works in progress as we don't list duplicate projects. diff --git a/apps/documentation/src/content/docs/index.mdx b/apps/documentation/src/content/docs/index.mdx index 66d95870a..1d7580096 100644 --- a/apps/documentation/src/content/docs/index.mdx +++ b/apps/documentation/src/content/docs/index.mdx @@ -11,8 +11,4 @@ hero: - text: Documentation link: /introduction icon: right-arrow - - text: Test the demo - link: https://demo.realworld.how - icon: external - variant: minimal --- diff --git a/apps/documentation/src/content/docs/introduction.mdx b/apps/documentation/src/content/docs/introduction.mdx index 5d64d61ea..0f6c29b63 100644 --- a/apps/documentation/src/content/docs/introduction.mdx +++ b/apps/documentation/src/content/docs/introduction.mdx @@ -8,11 +8,11 @@ title: Introduction -> See how _the exact same_ Medium.com clone (called [Conduit](https://demo.realworld.how)) is built using different [frontends](https://codebase.show/projects/realworld?category=frontend) and [backends](https://codebase.show/projects/realworld?category=backend). Yes, you can mix and match them, because **they all adhere to the same [API spec](specs/backend-specs/introduction)** 😮😎 +> See how _the exact same_ Medium.com clone is built using different [frontends](https://codebase.show/projects/realworld?category=frontend) and [backends](https://codebase.show/projects/realworld?category=backend). Yes, you can mix and match them, because **they all adhere to the same [API spec](specs/backend-specs/introduction)** 😮😎 While most "todo" demos provide an excellent cursory glance at a framework's capabilities, they typically don't convey the knowledge & perspective required to actually build _real_ applications with it. -**RealWorld** solves this by allowing you to choose any frontend (React, Angular, & more) and any backend (Node, Django, & more) and see how they power a real world, beautifully designed fullstack app called [**Conduit**](https://demo.realworld.how). +**RealWorld** solves this by allowing you to choose any frontend (React, Angular, & more) and any backend (Node, Django, & more). _Read the [full blog post announcing RealWorld on Medium.](https://medium.com/@ericsimons/introducing-realworld-6016654d36b5)_