Giter Club home page Giter Club logo

jianshu's Introduction

Jianshu

A simple application demonstrating Angular (SPA, SSR) the basic usage of permissions with NestJS (JWT, Passport, Github, User, Group, Permission) based on jianshu template.

Related Technology

  • @nrwl/nx - Nx is an open platform with plugins for many modern tools and frameworks.
  • 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 - a JS frontend framework created by Google
  • Material-ui - Material Design components for Angular
  • TypeScript - reactive extensions for JavaScript
  • RxJS - superset of JS which compiles to JS, providing compile-time type checking
  • MongoDB - a NoSQL database
  • Mongoose - MongoDB object modeling designed to work in an asynchronous environment
  • TypeORM - ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, WebSQL databases.
  • Redis - Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker.
  • Ioredis - A robust, performance-focused and full-featured Redis client for Node.js.
  • Passport - a popular library used to implement JavaScript authentication
  • JWT - JSON Web Token (JWT) is a compact URL-safe means of representing claims to be transferred between two parties.
  • Docker - Complete flexibility to run any Docker commands. Ship Better Code, Faster.

Features

  • Use the Mongoose(Typegoose) connect MongoDB
  • Use the Ioredis connect Redis
  • Use JWT for authentication
  • Support github authentication login
  • Super easy to install and start using the full-featured controllers and services
  • DB and service agnostic extendable CRUD controllers
  • Reach query parsing with filtering, pagination, sorting, relations, nested relations, cache, etc.
  • Framework agnostic package with query builder for a frontend usage
  • Query, path params and DTO validation included
  • Overriding controller methods with ease
  • Tiny config (including globally)
  • Additional helper decorators
  • Swagger documentation
  • Support Angular server rendering
  • Support Angular responsive presentation
  • Support Domain-Driven Design

Running the project

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

Installing core dependencies

  • make sure you have node.js installed version 12.13+

Local Installing DB dependencies

  • make sure you have MongoDB installed version 3.4+
  • make sure you have Redis installed version 3.2+

Docker Installing DB dependencies

Cloning the github repository

To clone the project, run

git clone https://github.com/jiayisheji/jianshu.git

Installing the dependencies

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

cd jianshu && npm install

Setting environment variables

cp .env.example  .env

Modify the corresponding values as required

Starting the MongoDB and Redis

Once you start the database application, you are ready to run the server

Boot according to your system

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

If you use Docker:

docker-compose up -d

Alternative commands

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

npm start

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

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

npm run start client

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

npm run start server

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

Documentation

Support

Any support is welcome. At least you can give us a star ⭐

Browser Support

Chrome
Chrome
Firefox
Firefox
IE / Edge
IE / Edge
Safari
Safari
Opera
Opera
last 2 versions last 2 versions IE11, Edge last 2 versions last 2 versions

License

MIT

jianshu's People

Contributors

jiayisheji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jianshu's Issues

感觉bug还挺多

感觉bug还挺多,例如

  1. 缺少utils-service/utils.service,infinitescroll/infinitescroll.directive文件,
  2. import /models/User,/models/Book等大小写和实际写的有问题,还有webAPI等,其实是webApi
  3. 在admin的SimpleTable中少了一个div
    jiayi大大,在你的机器上可以运行成功吗?能不能写个全一点的安装文档

Install

You can write detailed instructions before launching the site or record a video, I think it will come in handy not only to me, but to others!
Thank you very much for your hard work and efforts!
Yours faithfully...

import路径错误

在service/src/controllers/user.ts中,import {Article} from "../../src - 副本/models/article";路径错误

获取具体文章的page-data有问题

你好!试了下代码,在获取具体文章的时候,通过cheerio来获取$('[data-name=page-data]').text()是有问题的,结果为空,改成.html()即可,另外,使用JSON.parse()的时候一定要try,catch来捕获下异常。

联调问题

@jiayisheji ,大大,这些天一直在联调web端和servic端,自己出的问题还挺多,应该是通过调用webApi中的路由,然后使用大大推荐的postman查看数据是否正确,放到web中就可以了吧?但是不知道是不是我环境问题,还是步骤问题,一直都读取数据不成功,大大能给下具体这方面的步骤吗?或者相关的教程?
另外,发现github上有个类似的jianshu前端,和大大用的技术类似,可以参考下https://github.com/jeneser/jianshu

一个小小的建议:后台框架使用 koa2 怎么样?

偶然在 segmentfault 看到这个项目,非常喜欢。所以跟了过来,看到项目刚刚启动不久,而且使用了 express .
所以想咨询下作者,有没有打算更换为 koa2 ,自发版以来许多公司的新项目都会优先考虑使用了。作为新教程里的主要框架,若是能迎合这一点,我觉得会吸引更多的学习者吧~
只是作为小小的建议
另外,感谢推出这么全面的教程!加油~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.