Full Stack to create independent packages and to run on servers. Uses apollo, typescript, react, redux and more.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode updates Sep 15, 2017
config update Jul 2, 2018
docs update Sep 18, 2018
packages-modules remove persistgraphql Sep 15, 2018
packages remove json Sep 15, 2018
servers udpate build Sep 16, 2018
tools update Aug 24, 2018
typings udpate Jul 7, 2018
.gitignore update Sep 16, 2018
.travis.yml update Feb 4, 2018
CHANGELOG.md fixes for webpack 4 version May 6, 2018
ISSUES.md update Feb 17, 2018
Jenkinsfile edit namespace Jun 1, 2018
LICENSE updating with browser server Apr 5, 2017
MIGRATION.md Update MIGRATION.md Feb 12, 2018
README.md
ScreenShot.png update screenshot Oct 18, 2017
lerna.json old lerna Aug 11, 2018
package-lock.json update Aug 11, 2018
package.json udpate build Sep 16, 2018
tsconfig.json
tslint.json

README.md

Full Stack Packages

Fullstack packages to develop and test end to end; to use as packages or work independently.

Purpose:

The idea is to create modules for each package so it can work independently as well as integrated to another project as packages.

Screenshot

screencast

Useful commands:

command Description
lerna clean - removes the node_modules directory from all packages.
npm start(deprecated) - starts the web server and backend server. Use npm run spin:watch
npm run spin:watch - starts the web server and backend server in watch mode.
npm run spin:watch:debug - starts the web server and backend server in debug and watch mode.
npm run watch - build the packages in watchmode (Useful for development)
npm run lerna - install external dependencies at the repo root so they're
npm run build - build all the packages
npm install - runs lerna and build
lerna publish - publishes packages in the current Lerna project.

Files explained:

It uses lerna.json for creating the packages structure. Under packages you can create different modules based on its usage. For example:

 packages                    - Has the packages to organize the codebase into multi-package repositories.
     sample-core             - Core interfaces of the packages which can be shared between server and client.
     sample-server-core      - Core interfaces and its implementation code for Server.   
     sample-client-core      - Core interfaces and its implementation code for Client.
     sample-client-redux     - Redux's reducers and actions are defined. Which may use `@sample-stack\client-core` or `@sample-stack\core`
     sample-client-react     - React pure components and containers are defined. 
     sample-graphql-client   - Graphql Quries and Mutation for Client.
     sample-graphql-schema   - Graphql Schema for Server.
 servers                     - Has the packages to organize the codebase into multi-package repositories.
     frontend-server         - Frontend Client Server. This is useful to show demo of this package.
     backend-server          - Backend apollo server. 

Getting Started

If you want to develop FullStack locally you must follow the following instructions:

  • Fork or Clone this repository

  • Install the project in your computer

  1. Clone fullstack-pro locally
git clone https://github.com/cdmbase/fullstack-pro
cd fullstack-pro
  1. Install dependencies.
npm install
  1. Seed development database data
npm run db:seed
  1. Start both client and server together
npm start

The graphql server endpoints are

http://localhost:8080/graphql

http://localhost:8080/graphiql

The browser server endopoint is

http://localhost:3000

To run build with watch. Useful for auto reloading changes into the server to be productive during development.

npm run watch

Server Side Rendering

Useful to run Frontend and Backend in two seperate servers.

to start frontend server

cd frontend-server
npm run build
npm start

to start backend server

cd backend-server
npm run db:seed
npm run build
npm start

Docker build

Prior to it you need to run npm install from root directory.

Build three docker images by following the steps:

  • Frontend Server
cd frontend-server
npm run docker:build
  • Backend Server
cd backend-server
npm run docker:build
  • hemera-server
cd hemera-server
npm run docker:build

Environment settings for non-development

GRAPHQL_URL
CLIENT_URL
NATS_URL
NATS_USER
NATS_PW

Troubleshoot

To troubleshoot webpack configuration run

npm run spin:watch:debug

Known errors

In windows node-gyp need to be installed following below instructions.

Resources

Installing node-gyp

https://github.com/nodejs/node-gyp#installation