oliver021 / nodejs-backend-kit

The superset to build node.js backend. Express | MongoDB easy Crud | Typescript | Mocha | MVC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starter Kit for Backend

This repository is a template that can be used through github to start your projects with typescript faster, offering basic and useful things in advance, it includes dependencies for test systems, lint for the quality of the code, a clean folder structure, everything needed to get started with Typescript.

This project offer a setup for node.js backend using express.js and MongoDb, contains severals example like query API, mongoDb easy CRUD, etc.

Note: This first section of the readme can be removed, it is only an explanation, the template this file begins below

Project Name

Your Project Name

Write a project description

Prerequisites

This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.

$ npm -v && node -v
6.4.1
v8.16.0

Table of contents

Installation

BEFORE YOU INSTALL: please read the prerequisites

Start with cloning this repo on your local machine:

$ git clone https://github.com/ORG/PROJECT.git
$ cd PROJECT

Apply installation command and later you can lauch dev mode.

npm install
npm run dev

Usage

For example you can try with this endpoint:

curl --location --request POST 'http://localhost:3000/users' --header 'Content-Type: application/json'  --data-raw '{
    "nickname": "ssss",
    "username": "sss",
    "password": "elmsddd455111"
}'

After that POST Request you can see the record from your MongoDb database, you just should care about .env configuration file.

Serving the app

$ npm start

Running the tests

$ npm test

Building a distribution version

$ npm run build

This task will create a distribution version of the project inside your local dist/ folder

Serving the distribution version

$ npm run serve:dist

This will use lite-server for servign your already generated distribution version of the project.

Note this requires Building a distribution version first.

API

useBasicFetch

useBasicFetch(url: string = '', delay: number = 0)

Supported options and result fields for the useBasicFetch hook are listed below.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Add your changes: git add .
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request 😎

Credits

TODO: Write credits

Built With

  • Dropwizard - Bla bla bla
  • Maven - Maybe
  • Atom - ergaerga
  • Love

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • John Doe - Initial work - JohnDoe

See also the list of contributors who participated in this project.

About

The superset to build node.js backend. Express | MongoDB easy Crud | Typescript | Mocha | MVC


Languages

Language:TypeScript 99.4%Language:Shell 0.6%