Giter Site home page Giter Site logo

clone.instagram.server's Introduction

instagram-clone-coding

node.js + react.js + react native + prisma + GraphQL

Setting up the project

npm install graphql-yoga
npm install nodemon -D

Creating GraphQL Server

npm install dotenv -D
npm install @babel/preset-env -D
npm install @babel/core -D
npm install @babel/node -D

Setting Up the Server like the Pros

npm install morgan -D
npm install eslint-config-airbnb-base
npx install-peerdeps --dev eslint-config-airbnb
#! package.json
"eslintConfig": {
    "extends": "airbnb"
}
npm install graphql-tools merge-graphql-schemas --save

Introduction to Prisma

npm install prisma
npm install --save prisma-client-lib
prisma init

prisma

  • prisma deploy : schema of datamodel.prisma migrate
  • prisma generate : create prisma client

dotenv

import .env

models.graphql

Using GraphQL Server datamodel.prisma -> models.graphql db model schema

api

create folder .graphql (query type) + .js (query resolvers)

merge schema and resolvers

#! src/schema.js

const allTypes = fileLoader(path.join(__dirname, '/api/**/*.graphql'));
const allResolvers = fileLoader(path.join(__dirname, '/api/**/*.js'));

const schema = makeExecutableSchema({
  typeDefs: mergeTypes(allTypes),
  resolvers: mergeResolvers(allResolvers),
});

#! src/server.js
const server = new GraphQLServer({
  schema,
});

utils.js

utility functions

nodemailer

npm install --save nodemailer
npm install --save nodemailer-sendgrid-transport

passport.js

npm install passport passport-jwt

passport는 인증관련 일처리. jwt 토큰이나 쿠키에서 정보를 가져와 사용자 정보에 serialize(저장)함. 토큰을 해독 후 사용자 객체를 request에 추가.

clone.instagram.server's People

Contributors

bumkeyy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.