Is there need to create external AngularJS/JSP/JSF for hyperledger-fabric - hyperledger-fabric

I am working on hyperledger composer
after deploy bna file to server it will automatically create angular UI when we connect to angular through fabric server
now my question is is there need to create jsp/angular/jsf whatever files to dispaly UI(client) like login web pages or it will automatically generate???

If you are using the angular generator via Yo, then what is generated is a simple angular example. It's intention is not to generate a complete working application but to provide you with a starting point from which you can tailor to meet your needs. For example the generator can only handle simple models and cannot handle models that contain concepts. It can only interact with a rest server that doesn't have authentication enabled or multi-user enabled.
In answer to your specific question about login pages, it won't, you will have to add this kind of capability yourself.

Related

Should I build server-side of application inside nuxt.js server directory?

I want to build full-stack application with Nuxt.js. I am wondering where I should create my server-side inside Nuxt.js or maybe I should create separated project only for server stuff.
I am trying to set up my project but I do not know how I should do it. The application which I am building will have own front-end, back-end and also database (I will use MongoDB) but actually I do not know how I should start. I was reading a lot about SSR and Nuxt.js seems really good if am planing to use Vue.js on fronted. While creating nuxt app I can choose to use Express and then I can see server directory inside my directory structure does it mean that i should build all back-end inside this directory or maybe it is only for small stuff?
I have also another question what if I want to use Nest.js on back-end can i just use npm i -g #nestjs/cli and then nest new project-name inside my server directory ? I was looking also for this answer but almost all results in google for this type are about (comparison between Nuxt.js, Next.js and Nest.js).
It will be my first bigger full-stack project and I want to do it right but I am a really beginner in this so I am looking for answer from more experienced programmers.
You can run express or any node.js server you want inside Nuxt.js. When installing Nuxt.js with scaffolding tool create-nuxt-app, you can choose integrated server-side frameworks : Express, Koa, Hapi, Feathers, Micro, Fastify, Adonis (WIP). There isn't offical Nest.js integration, but you can easily find a starter kit on github.
With create-nuxt-app, if you choose to use any node.js server inside your nuxt app, you will see a server directory inside your directory structure, with the corresponding server-side pre-configured index.js file.
Here is my own feeling about it:
I think the inside solution make sense for a small SPA or Headless project (Ex: parse and serve files, a simple JWT Authentification, a small websocket server...), or for a front-end logic application that cannot fit in client browser and who are nothing to do with the database (like image or file computation).
But generally, this server run the database layer for your Nuxt application: a REST or GraphQL API. It can also run your business logic of your app, serve authentification, and more and more when project growth...
If you think about separation of concerns and microservices
architecture, do not use server inside Nuxt.js. Splitting both frontend and server will result more flexibility. You can host frontend and API in different servers.
So now, do nuxt.js really need a node.js server ?
Yes if you plan to use it in SSR mode, No if you plan to use it like a SPA or Static generated way. Docs here... .
In SSR mode, nuxt.js ask data to your API at the first rendering, and provide a complete SEO compatible page to the client browser or bots. It also provide all javascript that the browser need to navigate and fetch your API. For that, nuxt.js in SSR mode should run with node.js.
I assume you said "back-end" for your API and your business logic application, in this case, you should separate nuxt.js and your server. Two node.js instances to run both.

Feathersjs frontend and backend in a single project

I'm looking to build a small customer management portal for myself. I've recently started working with node and vuejs a lot (coming from an html/css/javascript background). I've really enjoyed CLI development though and am looking to build a customer management portal (nothing fancy) that has a MySQL backend. After studying frameworks and ideas I found feathersjs which I REALLY like. After a few hours I was able to have a REST api that returns data from my MySQL database and uses authentication. I can get MySQL data in a JSON datasource and even do inserts, updates, deletes. I generated the services and models using the feathersjs CLI generator.
My question is, do I really need to make two separate projects (one for backend and one for a public frontend) and run them each on a node server? Or could I do this in as single project? I'm still learning and reading up on feathersjs but I'm not seeing a way to make this possible. I do see a public folder in my feathersjs project that was generated but I don't know how to utilize it for node (I wanted my frontend written in Vue). I can see how static HTMLfiles would work in this public folder.

Basic Question First Node+express+angular app in production

I am creating my first app node express app with angular 7 on the frontend to be deployed in production. I have below question?
What folder structure is preferred, should I create separate
projects for node and angular or same project(server.js in the root
of angular project and server folder to create express server
files)? What is the preferred one and I have to checkin the project
in one folder of svn.
Should I use babel and create the node server code with es2015 or
continue with old approach?
Its all up to you, what I am doing is I have sepreate directory for Angular and Node projet
project
|
client - Your anguar project
server - Your Apis and server side coding (Only this folder require at productino level)
Then we can create a gulp file and task to gulp that Build my client
project and put that build folder inside the
server -> public
Now only server can be use to production where Build will be render as static.
And next to authentication and autherization process you can follow JWT based permission .
Generally I would say that separating your client and server code into separate projects is preferred so that you do not have to release both your client and server at the same time when you make a change to one or the other. The rest of my answer is based on the assumption that you would separate the two sides into different projects.
As far as structuring your server side Express-based application, check out this link for some guidance on how to handle your situation. See the answer to the first question about different approaches to how to structure your Express application for different deployment scenarios. Also, if you use the latest LTS version of node, you will not need to use a transpiler to convert your files to Javascript because the Node environment will handle that for you.
As far as structuring your client side Angular-based application, check out this link for a very detailed discussion about best practices for structuring your Angular application.
I would prefer following, in case in future you need to separate the API layer with client you can do it with ease,
project
|----client
| ---client-template //All UI code like .css/htmls and node process initiates from here
| ---client-angular // All the directives and controllers goes here
| ---client-service //Service layer, All the API call to server goes here
|----server
| ---server API's // separated by its own module if any
|--- you API modules and so on..
This will help you to have flexibility over client and server integration without any tight coupling. Also easy to maintain and debug.
Answer 1: you should make two separate folder/repository structure for frontend and backend.
let's suppose your application grows fast at that time you want to scale your backend and you want to host your Angular app as static web app using Amazon-S3 so at that time it will be very easy to manage this.
May you want to use CICD, in that case also it will be good if your separate folder so you can create separate CICD jobs for backend and frontend.
May be your company hired some developer which is either expert in frontend or in backend only. in that case your company don't want give them unnecessary code access. so separate repo will be an easy option for this case. (this may be Depends on your team and company's approach for development)
Answer 2: I recommend go for es6 or es6+ features.
latest node.js version is supporting some of the features of es6. for example
- spread operator
- destructing
- classes (you can use OOPs)
- arrow functions
- let, const
- async await and etc
you can use babel if any other feature which is not supported by node.js. there could be may reason for using babel, but i want to know which specific feature do you want to use with babel? so i can explain according to that.
I have used the following approach that bind the Angular Application and the Node server as a single unit.
Steps for creating the project structure is:
Create a new Angular project with the CLI.
Create a server.js file in the root directory of the project and configure it to render the contents of the dist/ folder on the / route.
You can refer the link for the server code: https://github.com/nikhilbaby/node-server
Running the server
I usually run the project with ng build && node server. This will make sure that the angular application is build first and after that node server is started.

Google Cloud as server for node.js

I want to create a node.js with express application that can host multiple clients with different domain names.
I have never created such application, so my question is:
If I have a project on my computer and want google (or some other hosting) to run my node application, how do I do it? Do I need to zip the whole project, and transfer it to the host? If not, how do Google know the front-end and back-end code?
If you just want to deploy your code, App Engine is the best option for you.
You can deploy your code there, and Google will manage how many instances will you need. For NodeJS, you can see a quickstart that will show you how to start here. You can deploy different services and map those services with different domain names.
There are examples on App Engine if you are using Express, and a tutorial that will show you how to organize your front-end and back-end in App Engine.

Best way to add Custom LoginModule to my web application

I need to implement User lockout in my web application which uses DatabaseServerLoginModule and JBoss5. I am planning to write a custom login module class to achieve this. My next question is: where should I put my custom login module class? After some research I found couple of solutions:
Deploy the login module class in a JAR as a standalone module, independent of the webapp
Deploy the login module class as a part of the webapp in a JAR inside WEB-INF/lib/
My web application will be packaged and shipped to the customer and customers install this package and JBoss separately on a Server. My question is: Where should I put my custom login module class?
Any suggestions will be really helpful.
If I were the data center, I would expect two packages:
One containing the login module
and another one for the real application
Reasons
The data center might have special responsibilities regarding sensitive user data, authentication etc. So in case of a login module, they might even have a special internal review process (this is normally not applied on an ordinary application). In order to avoid this review with each application update, a separate package is preferred. In order to have a quick review, a small package is better.
There might be other applications which use the same login module
A data center must be paranoid: An application which ships with it's own authentication could be abused to install a back door. Again internal or legal requirements may not even allow it.

Resources