Nestia template project installed by "npx nestia start"

Overview

Nestia Template

Outline

Build Status

A template repository for backend projects using nestia.

You can create a new project from this boilerplate by running below command:

npx nestia start <directory>

For reference, this is a minimal boilerplate project concentrating only on nestia SDK generation. If you wanna much detailed boilerplate project even configured DB and Non-distruptive update system, visit samchon/backend and create a new repository from that.

Directories and Files

This template project has categorized directories like below.

As you can see from the below, all of the TypeScript source files are placed into the src directory. When you build the TypeScript source files, compiled files would be placed into the bin directory following the tsconfig.json configuration. Otherwise you build client SDK library for npm publishing and their compiled files would be placed into the packages directory.

NPM Run Commands

List of the run commands defined in the package.json are like below:

  • build: Compile the source code
  • build:api: Build client SDK libray for the client developers
  • build:sdk: Build SDK into main program only
  • build:swagger: Build Swagger Documents
  • dev: Incremental build for development
  • eslint & eslint:fix & prettier: Prettier and ESLint execution
  • test: Run test automation program

Specialization

Transform this template project to be yours.

When you've created a new backend project through this template project, you can specialize it to be suitable for you by changing some words. Replace below words through IDE specific function like Edit > Replace in Files (Ctrl + Shift + H), who've been supported by the VSCode.

Before After
ORGANIZATION Your account or corporation name
PROJECT Your own project name
AUTHOR Author name
https://github.com/samchon/nestia-template Your repository URL

Test Driven Development

With nestia helps to accomplish TDD (Test Driven Development).

Just define DTOs and API controllers' methods (only declarations) first. After the definitions, and build SDK (Software Development Kit) through nestia (npm run build:sdk). After buildling those SDK, develop test automation program using the SDK, following use-case scenarios in the framework of client side.

During the test automation program development, you can find that which API is mis-designed or which requirement analysis is not exact. Development of the main program must be the last step after such validation process during TDD.

Visit the samchon/backend, then you may find much detailed story about this TDD.

  1. Definitions
  2. SDK
  3. Test Automation Program
  4. Main Program
import TSON from "typescript-json";

import api from "@ORGANIZATION/PROJECT-api/lib/index";
import { IBbsArticle } from "@ORGANIZATION/PROJECT-api/lib/structures/bbs/IBbsArticle";

import { ArrayUtil } from "../../../../utils/ArrayUtil";
import { GaffComparator } from "../../../internal/GaffComparator";
import { RandomGenerator } from "../../../internal/RandomGenerator";
import { validate_index_sort } from "../../../internal/validate_index_sort";

export async function test_api_bbs_article_index_sort(
    connection: api.IConnection,
): Promise<void> {
    // GENERATE 100 ARTICLES
    const section: string = "general";
    const articles: IBbsArticle[] = await ArrayUtil.asyncRepeat(100, () =>
        api.functional.bbs.articles.store(connection, section, {
            writer: RandomGenerator.name(),
            title: RandomGenerator.paragraph(),
            body: RandomGenerator.content(),
            format: "txt",
            files: [],
            password: RandomGenerator.alphabets(8),
        }),
    );
    TSON.assertEquals(articles);

    // PREPARE VALIDATOR
    const validator = validate_index_sort("BbsArticleProvider.idex()")(
        (input: IBbsArticle.IRequest) =>
            api.functional.bbs.articles.index(connection, section, input),
    );

    // DO VALIDATE
    const components = [
        validator("created_at")(GaffComparator.dates((x) => x.created_at)),
        validator("updated_at")(GaffComparator.dates((x) => x.updated_at)),
        validator("title")(GaffComparator.strings((x) => x.title)),
        validator("writer")(GaffComparator.strings((x) => x.writer)),
        validator(
            "writer",
            "title",
        )(GaffComparator.strings((x) => [x.writer, x.title])),
    ];
    for (const comp of components) {
        await comp("+");
        await comp("-");
    }
}
You might also like...

A template to quickly start a new Node.js project

A template to quickly start a new Node.js project

🚀 A template, for your node project. Including typescript, eslint and prettier.

Aug 25, 2022

Template of yew project, using tailwind and webpack for css, trunk for build and serve, deployable as is for github.io

Yew Template for Github.io Yew template that deployable as is for github.io (or as a normal yew template with css/scss stuffs without github.io), with

Dec 23, 2022

Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.

Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.

ESP-TypeScript Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable,

Dec 20, 2022

Remix starter for a Contentful blog (template) project

Remix starter for a Contentful blog (template) project

Contentful Remix Starter Blog Create a Remix blog powered by Contentful. Based on the contentful gatsby starter blog repo. Getting started Get the sou

Dec 15, 2022

A template for a vanilla(no ui-framework) project with webgi engine in typescript using parcel bundler.

WebGi starter project A template for a vanilla(no ui-framework) project with webgi engine in typescript using parcel bundler. For the latest version a

Jan 3, 2023

Boilerplate starter template for a new TON blockchain project - FunC contracts, JS tests, compilation and deployment scripts

TON Starter Template - Contracts Starter template for a new TON project - FunC contracts, JS tests, compilation and deployment scripts Overview This p

Dec 17, 2022

A simple self-use pull template project

A simple self-use pull template project

English | 简体中文 temp_manage A simple self-use pull template project. Supports github, gitlab, Bitbucket If you have an excellent template project, you

Jul 21, 2022

📋 unjs project starter template

packageName Package description Usage Install package: # npm npm install packageName # yarn yarn install packageName # pnpm pnpm install packageName

Jan 6, 2023

📜 TypeScript Project Template for Back End Development

TypeScript Project Template Back End Development Project Template Browse TypeScript code» Built With Table of Contents Installation and Usage Error Ha

Dec 31, 2022
Comments
  • Bug from `typescript-transform-paths`

    Bug from `typescript-transform-paths`

    New version of typescript-transform-paths is occuring bug.

    Therefore, roll back it to previous version forcibly.

    Related issue: https://github.com/LeDDGroup/typescript-transform-paths/issues/163

    bug 
    opened by samchon 0
Owner
Jeongho Nam
The best programmer in Korea
Jeongho Nam
A CLI for generating starter files for different JS frameworks with tailwindCSS pre-installed

tailwindcsscli A CLI for generating starter files for different JS frameworks with tailwindCSS pre-installed Installation To install the CLI, run the

Kira 12 Sep 30, 2022
From now on, it can be installed with all package managers in npmjs.com.

Package installer commands From now on, it can be installed with all package managers in npmjs.com. Run Locally Clone the project git clone https://

Amirhossein Beigi 9 Oct 2, 2022
Bookmarklet exploit that can force-disable extensions installed on Chrome. Also has a very fancy GUI to manage all extensions!

ext remover Bookmarklet exploit that can force-disable any extension installed on Google Chrome Instructions Here are the instructions to using this e

Echo 124 Jan 6, 2023
A command-line tool to manage Deno scripts installed via deno install

??️ nublar nublar is a command-line tool to manage your scripts installed via deno install. ??️ Installation deno install --allow-read --allow-write -

Shun Ueda 16 Dec 26, 2022
Simple NextJS Project Template to write less boilerplate code when starting a new Next JS Project

Simple NextJS Project Template to write less boilerplate code when starting a new Next JS Project

Juan David Ramirez Mendoza 1 Feb 12, 2022
Discord.js bot starter template, Slash Commands only (Raymond forced me to make a bot template)

boat-template Raymond forced me to make a bot template This template is meant is just for stupidness ig Getting Started Rename the config.example.ts t

Drxckzyz tha idiot 3 Jan 5, 2022
The project is a To-Do list project to help plan daily, weekly or monthly activity. I used Html, CSS and JavaScript Technology to execute the project.

<<<<<<< HEAD To Do List This project is geared towards applying acguired skills for development of my porfolio through the following practices: Create

Victor Efosa Osagie 6 Dec 19, 2022
Leader Board is a simple project based on JavaScript programing language. The purpose of this project is to work with APIs and ASYNC & AWAIT methods. I have used vanilla JavaScript with web pack to implement this project

Leader Board - JavaScript Project Table of contents Overview The challenge Screenshot Links Project Setup commands My process Built with What I learne

Mahdi Rezaei 7 Oct 21, 2022
A fully-fledged Hardhat project template based on TypeScript.

Fully-Fledged Hardhat Project Template Based on TypeScript Installation It is recommended to install Yarn through the npm package manager, which comes

Pascal Marco Caversaccio 75 Dec 21, 2022
A template project for NRWL's NX, Ionic Framework, Stylelint, Eslint, and more from the OpenForge mobile app team.

OpenForge Ionic Monorepo Example This is a template project for all Ionic + Angular Monorepos. It was generated using a combination of Nx, Ionic Thank

OpenForge 14 Oct 26, 2022