DEPRECATED IN FAVOR OF https://github.com/tiagob/create-full-stack
TypeScript with React, Apollo and Node example
Assumes MacOS
Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Install MySQL
Install MySQL with Homebrew (MySQL commands on MacOS).
brew install mysql
brew tap homebrew/servicesStart MySQL
brew services start mysqlInstall Yarn
brew install yarngit clone https://github.com/tiagob/todo-starter.git
cd todo-starterAll commands below are run from the root project directory todo-starter.
yarn installCreate database and sync (creating tables).
cd server
./createDb.sh # Assumes MySQL is installed with Homebrew
yarn sync-dbCreate two bash terminals (terminal 1, terminal 2). cd into the root of the cloned repo in both.
In terminal 1
cd server
yarn watchIn terminal 2
cd client
yarn watchSetup VSCode (recommended IDE/Editor)
The config files (.vscode/) are included which formats on save and automatically attaches the debugger.
Install recommended extensions
Run watch from VSCode terminal.
cd client
yarn watchPress F5 or click the green debug icon for Chrome launch configuration to attach.
Run watch-debug from VSCode terminal. Debugger automattically attaches. See debugging in VSCode.
cd server
yarn watch-debugRepo uses graphql-code-generator. Client React components for GraphQL queries and mutations are automatically generated via the typescript-react-apollo plugin from the *.graphql files. Server relies on type generation via the typescript plugin. This code is automattically generated when running yarn watch for client and server. It lives in the /src/generated folder in both /client and /server.
Kill all node processes.
killall node