All Projects → manikandanraji → Twitter Clone Backend

manikandanraji / Twitter Clone Backend

Twitter Clone Backend (Prisma + GraphQL)

Programming Languages

javascript
184084 projects - #8 most used programming language

Twitter Clone Backend

Netlify Status

Twitter clone backend built with Prisma and GraphQL.

If you are looking for the frontend repo, click here

Check out the deployed site

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].