nodejs

A Web & API app built using low-level NodeJS APIs (Implementing NodeJS without using NPM for web, api & cli)

Implementing NodeJS without using NPM

What is it?

A boilerplate or a sample built in NodeJS without using any NPM packages covering all (or most) of the Node’s API modules

What is needed?

NodeJS (LTS) ie. >= 8.11.3

How to download & setup?

# Clone this repo using your terminal
git clone https://github.com/faizahmedfarooqui/nodejs.git;

# Go inside the repo
cd nodejs;

# Make a data directory into the root of the project
mkdir .data && cd .data;

# Create 3 more directories into the .data directory
mkdir users checks tokens;

# Go back to project's root 
cd ..;

# Make a logs directory into the root of the project
mkdir .logs;

# Goto the https directory
cd https;

# Now run the command given in the file keyGeneration.txt
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem

List of things, this repository contains:

1. RESTful API:

2. Workers:

3. Logging:

4. Compress & Decompress:

3. Debugging:

4. Web App to serve routes & templates:

5. Web App to serve static assets:

6. CLI Tool with Input handlers & their responders:

---------------------------------------------------------------------------------------------------------------------------------------------------------
                     CLI Manual
---------------------------------------------------------------------------------------------------------------------------------------------------------
exit                          Kill the CLI (and the rest of the application)
man                           Show this help page
help                          Alias of the "man" command
stats                         Get statistics on the underlying operating system and resource utilization
List users                    Show a list of all the registered (undeleted) users in the system
More user info --{userId}     Show details of a specified user
List checks --up --down       Show a list of all the active checks in the system, including their state. The "--up" and "--down flags are both optional."
More check info --{checkId}   Show details of a specified check
List logs                     Show a list of all the log files available to be read (compressed only)
More log info --{fileName}    Show details of a specified log file

7. Handling error crash:

8. Debugger Mode:

9. Performance Hooks:

10. Cluster:

11. Child Process:

12. Other NodeJS Modules:

That’s It!

How do I contribute?

Please read the CONTRIBUTING.md

Issue Template?

Bug Report

Feature Request

Custom Report

Code of Conduct

Please read the file CODE_OF_CONDUCT.md

License

MIT License