nest-angular

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发、 常用JavaScript包
软件类型 开源软件
地区 不详
投 递 者 堵睿范
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

nest-angular

A fullstack JavaScript project, using technologies from the modern stack, such as:

  • NestJS - a JS backend framework providing architecture out of the box with a syntax similar to Angular
  • Angular - a JS frontend framework created by Google
  • Angular Universal - Angular Server Side Rendering - prerendered crawlable pages
  • RxJS - reactive extensions for JavaScript
  • Webpack - the ultimate JS bundler - used for the server code since Angular has it under the hood
  • MongoDB - a NoSQL database
  • Mongoose - MongoDB object modeling designed to work in an asynchronous environment
  • TypeScript - superset of JS which compiles to JS, providing compile-time type checking
  • Passport - a popular library used to implement JavaScript authentication
  • jsonwebtoken - a JavaScript json web tokens implementation by auth0

Running the project

These instructions should be sufficient for one to get the project going on their local machine

Cloning the github repository

To clone the project, run

git clone https://github.com/bojidaryovchev/nest-angular.git

Installing the dependencies

To install the dependencies after you've cloned the project, go to its root folder and run

npm install

Building the Angular application

Before you start the server, you need to build the Angular application. To do so, run

npm run build:universal

Starting the server

Once you have the Angular app built, you can start the server by running

npm run watch:server

Notice that the server uses MongoDB so we need to have a MongoDB instance running so the server can connect to it

Alternative commands

If you need to work on the frontend and backend parts at the same time, you can run

npm run watch

Then, you can go to the Angular dev server at port 4200 and test server requests (to port 1337), we got a proxy to the backend

If you only need to work on the frontend, you can run

npm run watch:client

Alternatively, if you only need to work on the backend, you can run

npm run watch:server

Keeping in mind that you need to have the Angular app built and a mongodb connection established

Instructions

Getting GraphQL to work

Currently there are issues with several packages so even though we have GraphQL implemented, it stays commented out because it doesn't work.. Here are the instructions to make it work:

  • Download https://www.dropbox.com/s/7bvht9thbmwt1e5/fixed-apollo-modules.rar?dl=0 - those are the apollo-angular and apollo-angular-link-http modules compiled in commonjs - then go in your node_modules folder and replace your apollo-angular and apollo-angular-link-http modules with these ones
  • Download https://www.dropbox.com/s/n0vwfvdmn7wtkj8/fixed-nest-modules.rar?dl=0 - this is the fixed @nestjs/graphql module - there was an error when in combination with Angular Universal which is now fixed - then replace your @nestjs/graphql module with this one
  • Open node_modules/@types/ws/index.d.ts and find net.AddressInfo - you will see a type definition of a function:address(): net.AddressInfo | string - change it to address(): string

Now, you can go ahead and uncomment the GraphqlModules on both client/server side and it works decently, I am using it in another project which is a clone of this one and everything works..

Use Social login

Modify with your application credentials:

  • src/server/modules/auth/config/facebook-config.ts
  • src/server/modules/auth/config/google-config.ts
  • src/server/modules/auth/config/twitter-config.ts

To use it in mobile application with Facebook-token integration (Facebook App), use /api/auth/facebook/token endpoint.

  • 记录学习 nest.js 开发的过程 演示环境 Windows 10 、mysql v8.0.12、Redis3 v.2.100、node v14.16.1、npm v6.14.12、nestjs v8.1.1 链接 node 下载安装地址 直接下载稳定版 nest.js 中文文档地址 文档参考 Nest CLI 安装 新建项目 运行以下命令新建 nest 项目 nest-admin-server

  • npm警告:npm WARN No repository field. 使用npm安装第三方扩展包出现警告提示: npm WARN nest-app@0.0.1 No repository field. 查看本机版本: $ node --version v10.11.0 $ npm --version 6.5.0 $ nest --version 5.7.1 具体警告内容: $ npm inst

 相关资料
  • NG-NEST NG-NEST 是一个开源的 Web 应用程序框架,基于 Angular 和 Nest ,主要用于研发企业级中后台产品。https://ngnest.com/ Angular 是一个应用设计框架与开发平台,用于创建高效、复杂、精致的单页面应用。 Nest 是构建高效、可扩展的 Node.js 服务器端应用程序的框架。 特性 客户端与服务端都使用 TypeScript 构建,提供完整

  • nest-cnode Description This is using the Nestjs imitation Cnode. Installation Currently runs with: nodejs v8.11.1 mongodb v3.4.1 redis v3.2.1 nestjs v6.11.11 With this sample, you can : Understand bas

  • NestJS Tutorial Repository Repository will be separated into server and client directory for NestJS backend and Angular frontend resepctively. Server repository Client repository Docker support Hook u

  • A progressive Node.js framework for building efficient and scalable server-side applications. Description The Nest CLI is a command-line interface tool that helps you to initialize, develop, and maint

  • nest-user-auth If this project helps you, please add a star! If you see an issue, please post it! This project uses NestJS, GraphQL, and MongoDB. This project implements user authentication. Adding ot

  • homebridge-nest-cam View your Nest cams in HomeKit using Homebridge with this plugin. FAQ Troubleshooting Error Codes Notes This plugin does not work with the latest Nest cameras. If you do not see it