Skip to content

🗄️ - Threads Backend 🔴- Apollo GraphQL , Docker Compose,TypeScript , Prisma ORM ,Postgresql ,Express, Json Web Tokens

Notifications You must be signed in to change notification settings

neeraj-gs/Threads-App-Backend-GraphQL

Repository files navigation

Threads Backend [GraphQL]

A Complete Backend Apllication that allows users to Register or Login and then Post on the social media platform. It is a Backend App where all the API calling is done Using GraphQL and setup docker-compose for using postgresql as a Dependency instead of installing postgresql.

Tech Stack

  • GraphQL + ExpressJs
  • Docker Compose
  • PostgreSQL
  • Prisma ORM
  • TypeScript
  • Json Web Token
  • Apollo Server

Features

  • Allows users to Authenticate and Authorize
  • Uses Jwt for authentication
  • Uses b-crypto for hashing the password
  • Uses a containerized envirnment to interact with the databse
  • Uses Prisma as a service layer between the database and communication

Screenshots

docker file conenction

docker file conenction

docker file conenction

docker file conenction

docker file conenction

Connecting to Database

To run this project, you will need to add the following environment variables to your .env file

DATABASE_URL='postgresql://janedoe:mypassword@localhost:5432/mydb?schema=sample'
  • You need to replace username, password and databse name from the docker-compose file and connecto the databse.

Steps to Run Locally

Clone the project

  git clone https://github.com/neeraj-gs/Threads-App-Backend-GraphQL.git

Go to the project directory

  cd Threads-App-Backend-GraphQL

Install dependencies

  npm install

Start the graphql server

  npm run dev

Go to Apollo Server to Check the API Callings

  http://localhost:8000/graphql

Run docker container in the background

  docker-compose up -d

Connect to postgresql database using docker

  docker exec -it <container_id_here> bash
  su postgres  

Open postgresql terminal in docker

  psql

Some basic databse commands to navigate

  \l - lists the databases present 
  \c <db_name_here> - connects to the databse
  \d - lists the tables
  \d <table_name_here> - lists all the columns in the talbe 
  \x - to dispaly data column wise

Any postgresql commands can be run here:

  select * from  users;

Future Work

Can Add more features related to different interactions present in a SOcial Media Platform and can interact with the apllication using docker used as a postgresql databse for integrations.

About

🗄️ - Threads Backend 🔴- Apollo GraphQL , Docker Compose,TypeScript , Prisma ORM ,Postgresql ,Express, Json Web Tokens

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published