caldero-nest-library
v1.5.5
Published
<space></space> <h1 align="center"> Creation of a standardized development library for Node.Js based web applications </h1> <p align="center">This repository relates to research question 4: How does an open source library for developing web applications
Downloads
16
Readme
Table of contents
About the library
It's mainly inspired by the PHP Framework Laravel and closes the functional gap bewteen best-practice frameworks like Laravel and the Node.Js web framework NestJs. In reserach question 1, the most important features of these best-practice frameworks were identified and analyzed. After that, the most popular Node.Js frameworks were analyzed in research question 2. Out of the analyzed frameworks, NestJs has the highest coverage of features and also has the biggest community. Because of that, it was chosen as the foundation of this library.
Goal
The goal of this library is to help developers build NestJs web applications faster and more efficiently by providing the missing features out-of-the-box and combining existing community solutions. This means that it provides services and endpoints to access those features, making it possible to integrate and use them in new NestJs projects, without having to implement all the logic of those features by oneself. It also generates a lot of useful files, like for example an user entity and decorator, mail templates and a database config file.
- Auth System using JWT
- i18n
- Notifications
- Sending Mails
- Full-Text Search using Algolia
- Payments (Stripe)
- Chat
- Helpers for Strings, Arrays and Dates
- Seeder
How you can set up and use each feature is explained in the links above.
Requirements
Node.Js and npm
To be able to use the library, Node.Js and npm need to be installed on your computer. Install npm with the following command:
npm install -g npm
The best way of installing Node.js is to use a node version manager. A guide for doing so can be found here. To check whether you already have Node.Js and npm installed, run the following commands:
node -v
npm -v
Database
A (test) database is neccessary to test the features of the library. You can use XAMPP to setup a test database.
- Download and install XAMPP
- Run the XAMPP Control Panel
- Start the Apache and MySQL Server.
- You can access the user interface on 'localhost/phpmyadmin'
The connection details are handled in the typeormconfig.ts file, which will be located in the src folder of your NestJs project.
Getting started
# First, install the nestjs cli
npm i -g @nestjs/[email protected]
# and then, create a new nest project.
nest new project-name
# enter the root folder of the project
cd project-name
# install the library there
npm i caldero-nest-library
npm install
# After everything is installed, this command generates the necessary files for scaffolding your app
caldero-file-generate
# IMPORTANT: If the command wasn't found, install the library globally and execute the above command again.
npm i caldero-nest-library -g
# start the project
nest start
Rename the generated .env-example
file to .env
Using the features
After completing the Getting started section, you can already start using the seeder by executing the following command. This will create ten new users in your database.
npm run seed
Also, you can start to import and use all the other features. How that works for each specific feature is explained in the links of the Features section.
Demo App
To make a proof of concept, we developed a demo app. If you want to start and test the app, start both the frontend and backend projects. How you start them is explained in the README of each project.
| Project | Description | | :------------- |:-------------| |StubyProjects/library-demo-backend| Task manager app, which includes the core features of the library | |StubyProjects/library-demo-frontend| Demo Frontend for the App (created by Ariel Weinberger) |
To have access to the repositories use the following github account:
username: bachelortester
password: Bachelor2021Zugriff123!
web.de
email: [email protected]
password: Bachelor2021Zugriff123!
stripe
email: [email protected]
password: Bachelor2021Zugriff123!