question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Completely separated client and server sides?

See original GitHub issue

I suggest splitting apart server and client sides, making them completely separate and independent directory structures.

Optionally, when the user specifies both, a top level build script could provide shortcuts for automating mundane tasks performed on both sides, like npm install on both sides; ng serve on the client side and gulp run-watch on the server side, etc.

The user could then choose to run build/run scripts separately when convenient or run everything in one go when convenient, depending on specific needs or preferences.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
frgomescommented, Mar 7, 2017

Iā€™m using only npm now as per this article: https://www.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/

I have now a completely self contained frontend and a completely self contained backend. My main project has only a .gitmodules file and thatā€™s all.

In particular, Iā€™ve removed gulp from the build process. The reason for that is that now Iā€™m using a tool called s2i from RedHat OpenShift, which builds the application and generates a Docker image which conforms with best practices. Iā€™ve found difficulties running s2i because, in a nutshell, gulp was not installed in the default bootstrap environment, which contains only node and npm. For this reason, Iā€™ve completely eliminated the need of gulp in my build process.

For our information, this is how the build process of the backend looks like:

  "devDependencies": {
    "watch": "1.0.1",
    "nodemon": "1.11.0",
    "parallelshell": "2.0.0",
    "typescript": "^2.1.5",
    "ntypescript": "1.201609302242.1",
    "typings": "^2.1.0",
    "tslint": "^4.4.2",
    "mocha": "^2.4.5",
    "should": "^11.2.0"
  },

  "scripts": {
    "postinstall": "npm run build",
    
    "start":       "node dist/server.js",
    
    "clean":   "rimraf dist",
    "zap":     "rimraf dist node_modules typings",

    "build":   "typings install && npm run compile && npm run test",
    "compile": "ntsc --outDir ./dist",

    "test":    "mocha",

    "watch": "watch 'npm run build' src",
    "reload": "nodemon --watch dist",
    "watch:reload": "parallelshell 'npm run watch' 'npm run reload'",

    "tools:typings": "npm install -g typings@2.1.0 && typings install"
  },

Doing this way, the backend can be reloaded when sources change, employing npm only.

I hope Iā€™ve contributed with something useful. Thanks a lot for your great work on ng-fullstack! šŸ˜ƒ

0reactions
ericmdantascommented, Mar 7, 2017

Thank you for all the information, @frgomes, itā€™s definitely useful - and itā€™s also a good example for someone who wants to do something like in your case.

šŸ‘

Read more comments on GitHub >

github_iconTop Results From Across the Web

What do client side and server side mean? - Cloudflare
Client side and server side describe where web application code runs. Learn more about client-side vs. server-side processes and client-side scripting.
Read more >
unity3d - How to separate server-side and client-side code
Using Network class you can easily differentation between the server and Client. using UnityEngine; using System.
Read more >
Separate client and server import? Ā· Issue #2582 Ā· vercel/next.js
Developing a sophisticated website product with Next.js, Express and a database, I'm using REST and isomorphic fetch for my API abstraction,Ā ...
Read more >
What does REST's Client-Server mean now? - Byte Rot
REST has a strong emphasis on separation of client and server. ... Implementing the functionality in the wrong side of wire can be...
Read more >
Separation of client and server | EN.601.421 - GitHub Pages
This means that the code on the client/server side can be changed at any time without affecting the other side. RESTful. REST-compliant systems,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found