• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

manikandanraji/twitter-clone-backend: Twitter Clone Backend (Prisma + GraphQL)

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

manikandanraji/twitter-clone-backend

开源软件地址(OpenSource Url):

https://github.com/manikandanraji/twitter-clone-backend

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

Twitter Clone Backend

NOTE: As of 10-06-2022 at 19:35 IST, I am archiving this repository. It was fun while it lasted.

Twitter clone backend built with Prisma and GraphQL.

If you are looking for the frontend repo, click here

Core Packages

  1. prisma - allows us to define our application models and generates CRUD operations from our defined models
  2. graphql-yoga - graphql server
  3. jsonwebtoken - authentication

Features

  • Signup / Login
  • New Tweet
  • Like
  • Retweet
  • Comment
  • View Profile
  • Edit Profile
  • Search by users, tags, people
  • Dark theme / Light theme

Running locally

Prisma setup

  • You need to have a prisma account

  • Make sure to install the prisma cli tool globally in your machine

     npm i -g prisma
    
     # once you created your account, you can login from the terminal
     prisma login
  • Once you logged into your account, you need to create a new prisma project

     prisma init 
  • Copy the 'datamodel.prisma' file in the 'prisma_setup' folder to the root directory

     cp prisma_setup/datamodel.prisma . # assuming you are present in the root directory
  • Then you need to simply deploy the changes you made

     prisma deploy

Environmental variables setup

  • Create a .env file at the root directory with the following contents
JWT_SECRET=<YOUR_SECRET>
PORT=<PORT>

Then run npm i && npm run dev to start the development server

Watch this video on how to setup locally

New Tweet

Deploying the backend to heroku

First create an heroku account and install the heroku cli globally and login

npm i -g heroku
heroku login

Once logged in, create a new heroku application and push it to the remote 'heroku'

heroku create
git push heroku master

Then you need to manually setup the environmental variables using the heroku dashboard

UI

Home

Home

Explore

Explore

Profile

Profile

Edit Profile

Edit Profile

New Tweet

New Tweet

Tweet

Tweet




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap