geoseong / talktalk-node

Graphql node project using prisma for talktalk.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to the talktalk-node wiki!

talktalk-node

codecov CircleCI

This is backend application for talktalk built in react-native. TalkTalk is an opensource chat app under construction.

Specification

You need to know about below techniques in able to understand the server specifications comfortably.

Version

The version listed is used in current environment. This must not be identical to your environment.

Tool Version
babeljs 7+
nodejs 10+
npm 6.4+
prisma 1.2+
mysql 5.7+
docker 18.09+
docker-compose 1.23+

Setting up talktalk-node

Install Docker Desktop

Download Links : This step requires Sign in (or Sign Up) to DockerHub

Install the Prisma CLI

  • Document: Set up Prisma

    npm install -g prisma
    
    or
    
    brew tap prisma/prisma
    brew install prisma
    

    Caution: prisma installation via npm recommended.

    Error: Cannot find module 'generate'
    
    • when you execute local test via prisma deploy command at post-deploy hook setting in prisma.yml, this error occured in prisma Homebrew installation.
    • that error not fixed in Homebrew installation yet.
    • so install via npm
    • GitHub issues: Error: Cannot find module 'generate'

Running server

First of all, run cp .env.sample .env to generate environment file.

Basically you need to change nothing but only JWT_SECRET with any value for local dev environment.

Name Description required? default
JWT_SECRET Secret key to enc/dec JWT true
DEBUG Flag to enable debug mode false
PRISMA_ENDPOINT Prisma endpoint URL true http://localhost:4466
PRISMA_MANAGEMENT_API_SECRET Prisma service secret, required for production false
PRISMA_DB_CONNECTOR Database connector true mysql
PRISMA_DB_DATABASE Database name true prisma
PRISMA_DB_USER Database username true prisma
PRISMA_DB_PASSWORD Database password true prisma

Then,

  1. docker-compose up -d
    Run all prisma services in background.

  2. prisma deploy
    Initialize or apply changes of prisma data model to database.

  3. npm start
    Start Express.js server to provide GraphQL API

Applying schema to database

  • If you've edited prisma/datamodel.prisma, you must prisma deploy in order to apply changes to database.

More details

About

Graphql node project using prisma for talktalk.

License:Other


Languages

Language:JavaScript 96.8%Language:Shell 1.8%Language:Dockerfile 1.3%