Skip to content

feat: javascript-server #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 122 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
caeea38
feat: Add VS-CODE.md
Jan 21, 2020
7be7cfe
Update VS-CODE.md
AryanSinghal Jan 21, 2020
b082255
Update VS-CODE.md
AryanSinghal Jan 21, 2020
9c95b2d
Merge pull request #1 from AryanSinghalGit/feature/39512
AryanSinghal Jan 21, 2020
31d5837
Delete VS-CODE.md
AryanSinghal Jan 22, 2020
2384ec3
Update VS-CODE.md
AryanSinghal Jan 22, 2020
20f4a92
Update VS-CODE.md
AryanSinghal Jan 22, 2020
ca5658d
feat:Add .editorconfig
Jan 22, 2020
fd06a99
fix: conflicts
Jan 22, 2020
0617198
Merge pull request #4 from AryanSinghalGit/feature/39512
nxvinay Jan 22, 2020
a9c6c33
feat : Add MERN-STACK.md
Jan 22, 2020
45df94c
feat : Add 12FACTOR-APP.md
Jan 22, 2020
36f0c6c
feat: Add CLIENT-SERVER.md
Jan 22, 2020
97fa516
feat: Add 12FACTOR-APP.md
Jan 22, 2020
3ffca3c
Merge pull request #5 from AryanSinghalGit/feature/39513
Rahul-Successive Jan 23, 2020
e4a708f
feat: Add Package extra
Jan 23, 2020
32ee139
fix: Add package.json
Jan 23, 2020
1535f24
feat: Add package utils
Jan 24, 2020
a3187ba
feat: Add package utils
Jan 24, 2020
036fa32
feat : Add permissions.js
Jan 24, 2020
c090c19
fix: Add permissions.js
Jan 24, 2020
16fa13b
fix: modified conflicts
Jan 27, 2020
ad25fb7
"fix: Delete npm-debug.log"
AryanSinghal Jan 27, 2020
29d066c
"feat: Delete npm-debug.log"
AryanSinghal Jan 27, 2020
c25a914
feat: Add all
Jan 27, 2020
3230ef3
Update validation.js
AryanSinghal Jan 27, 2020
8eb6976
fix : validation.js
Jan 27, 2020
245211a
Merge pull request #6 from AryanSinghalGit/feature/39515
Rahul-Successive Jan 27, 2020
8cf6cb9
Delete npm-debug.log
AryanSinghal Jan 27, 2020
d79daf3
Delete npm-debug.log
AryanSinghal Jan 27, 2020
fac0237
Update validation.js
AryanSinghal Jan 27, 2020
174093a
Merge pull request #7 from AryanSinghalGit/feature/39517
Rahul-Successive Jan 27, 2020
86cd0ef
Add all
Jan 28, 2020
a136b46
fix:conflicts
Jan 28, 2020
24b6bde
Update validation.js
AryanSinghal Jan 28, 2020
8eeeb7a
fix : Add package.json
Jan 28, 2020
830408f
fix : Add all
Jan 28, 2020
30d94b1
fix : Add all
Jan 28, 2020
7b3d8e7
fix : Add validation.js
Jan 28, 2020
c2eb5c9
feat : Add all
Jan 28, 2020
d55a0b3
feat : Add all
Jan 28, 2020
8ba62be
feat : Add all
Jan 28, 2020
6fee544
feat : Add all
Jan 28, 2020
eb6c5c6
feat : Add all
Jan 28, 2020
8900817
fix: package.json
Jan 29, 2020
c09e703
fix: Add package.json
Jan 29, 2020
fb29aa5
Merge pull request #8 from AryanSinghalGit/feature/39519
Rahul-Successive Jan 29, 2020
28506ca
fix: Add package.json
Jan 29, 2020
64f4956
fix: Resolve Conflicts
Jan 29, 2020
9715506
Merge pull request #9 from AryanSinghalGit/feature/39520
Rahul-Successive Jan 29, 2020
f919b5f
feat : Add all
Jan 29, 2020
01251f2
feat : Add all
Jan 29, 2020
39f742f
fix : Resolve Conflict
Jan 29, 2020
5133925
feat: 🎸 Add body-parser
Jan 30, 2020
b3da522
feat: 🎸 Add body-parser
Jan 30, 2020
798b65c
refactor: 💡 Define type of req and res
Jan 30, 2020
1139969
feat: 🎸 Add body-parser
Jan 30, 2020
2fc9cf1
feat: 🎸 Add Controller
Jan 31, 2020
25ff0e9
feat: 🎸 Add Controller
Jan 31, 2020
12f1bac
feat: 🎸 Add Generic Routes Validations
Feb 3, 2020
7b17c1f
Merge pull request #10 from AryanSinghalGit/feature/39521
Rahul-Successive Feb 3, 2020
6d77336
feat: 🎸 Add Generic Routes Validations
Feb 3, 2020
4e3b20b
fix: 🐛 Resolve conflict
Feb 3, 2020
accf5d3
fix: 🐛 error
Feb 3, 2020
391d66e
fix: 🐛 Resolve conflicts
Feb 3, 2020
a62aaf9
Merge pull request #14 from AryanSinghalGit/feature/39522
Rahul-Successive Feb 3, 2020
8b5e9a8
Merge branch 'develop' of https://github.com/AryanSinghalGit/javascri…
Feb 3, 2020
54c160d
Merge pull request #15 from AryanSinghalGit/feature/39523
Rahul-Successive Feb 3, 2020
f11e0eb
feat: 🎸 Generic Routes Validations
Feb 4, 2020
809a356
feat: 🎸 Authentication and Authorization
Feb 4, 2020
a773e2d
Update validationHandler.ts
AryanSinghal Feb 4, 2020
641e0b6
Update validation.ts
AryanSinghal Feb 4, 2020
982b132
feat: 🎸 Generic Routes Validations
Feb 4, 2020
8cf5a1d
feat: 🎸 Generic Routes Validations
Feb 4, 2020
496bbb6
feat: 🎸 Authentication and Authorization
Feb 4, 2020
b9a3acd
feat: 🎸 Authentication and Authorization
Feb 4, 2020
185517f
feat: 🎸 Authentication and Authorization
Feb 4, 2020
31877bb
feat: 🎸 Add Authentication and Authorization
Feb 4, 2020
d920c5b
feat: 🎸 Add Mongoose and promises
Feb 5, 2020
0d0393e
fix: 🐛 Add changes
Feb 5, 2020
0f806fd
fix: 🐛 Add changes
Feb 5, 2020
813b53a
fix: 🐛 Add changes
Feb 6, 2020
d589c91
Merge pull request #13 from AryanSinghalGit/feature/39524
Rahul-Successive Feb 6, 2020
bae0d5c
fix: 🐛 Resolve Conflict
Feb 6, 2020
411ee5f
Merge pull request #18 from AryanSinghalGit/feature/40009
Rahul-Successive Feb 6, 2020
20752d7
Merge branch 'develop' of https://github.com/AryanSinghalGit/javascri…
Feb 6, 2020
256847b
fix: 🐛 Resolve conflits
Feb 6, 2020
a9d3986
feat: 🎸 Add Models setup with initial Seed
Feb 6, 2020
28a7078
Merge pull request #19 from AryanSinghalGit/feature/40010
Rahul-Successive Feb 6, 2020
2adccd7
feat: 🎸 Add Models setup with initial Seed
Feb 7, 2020
9d80808
feat: 🎸 Add Models setup with initial Seed
Feb 7, 2020
ddb9aed
feat: 🎸 Models setup with initial Seed
Feb 7, 2020
45a9415
feat: 🎸 Add Models setup with initial Seed
Feb 10, 2020
f896d64
feat: 🎸 Add Models setup with initial Seed
Feb 10, 2020
b1a0ba9
Update Controller.ts
AryanSinghal Feb 10, 2020
8869b68
feat: 🎸 Add Profile Setup
Feb 10, 2020
3eccfe3
Merge pull request #22 from AryanSinghalGit/feature/40011
Rahul-Successive Feb 10, 2020
a2867ee
Merge branch 'develop' into feature/40012
AryanSinghal Feb 10, 2020
5c55950
Merge pull request #23 from AryanSinghalGit/feature/40012
AryanSinghal Feb 10, 2020
719bd50
feat: 🎸 add Setup all the Entities
Feb 12, 2020
3ad57a5
feat: 🎸 add Setup all the Entities
Feb 13, 2020
1108280
feat: 🎸 add Setup all the Entities
Feb 13, 2020
dee3779
feat: 🎸 add Magic of Await
Feb 13, 2020
9ff8455
feat: 🎸 Magic of Await
Feb 14, 2020
801003b
feat: 🎸 Magic of Await
Feb 14, 2020
0c21991
Update Controller.ts
AryanSinghal Feb 14, 2020
ab029c8
feat: 🎸 add APIs Completion
Feb 14, 2020
3a4c047
Merge pull request #24 from AryanSinghalGit/feature/40013
Rahul-Successive Feb 17, 2020
c2f23e9
Merge pull request #25 from AryanSinghalGit/feature/40014
Rahul-Successive Feb 17, 2020
0733218
fix: 🐛 add changes
Feb 17, 2020
0fa24cb
fix: 🐛 add changes
Feb 18, 2020
e28d791
Update UserSchema.ts
AryanSinghal Feb 18, 2020
8671ce7
feat: 🎸 add APIs Completion
Feb 18, 2020
4e0bfc3
fix: 🐛 add changes
Feb 19, 2020
2a7079b
Merge pull request #26 from AryanSinghalGit/feature/40313
Rahul-Successive Feb 19, 2020
ccf5933
feat: 🎸 add APIs Completion
Feb 20, 2020
7d416db
feat: 🎸 add APIs Completion
Feb 21, 2020
4cd210b
feat: 🎸 add APIs Completition
Feb 21, 2020
da5cba8
feat: 🎸 add APIs Completion
Feb 21, 2020
f0c1f40
fix: 🐛 add changes
Feb 21, 2020
bb6bebd
fix: 🐛 add changes
Feb 25, 2020
ccc6913
Merge pull request #27 from AryanSinghalGit/feature/40314
Rahul-Successive Feb 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
# editorconfig-tools is unable to ignore longs strings or urls
max_line_length = off

[CHANGELOG.md]
indent_size = false
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PORT=9000
NODE_ENV=dev
SECRET_KEY=qwertyuiopasdfghjklzxcvbnm123456
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to commit .env file?
You can create a .env.example that can be committed but do not commit .env file

MONGO_URL=mongodb://localhost:27017/express-training
PASSWORD=aryan@123
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#node_modules
node_modules

#package-lock.json
package-lock.json

#Package dist
dist
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for this file.

}
66 changes: 66 additions & 0 deletions 12FACTOR-APP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
The Twelve Factors
===
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these equal operators for?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For making The Twelve Factors heading

# 1. Codebase
**There should be exactly one codebase for a deployed service with the codebase being used for many deployments.**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have Text?
Why it is not in correct manner?


There is always a one-to-one correlation between the codebase and the app:
* If there are multiple codebases, it’s not an app – it’s a distributed system. Each component in a distributed system is an app, and each can individually comply with twelve-factor.
* Multiple apps sharing the same code is a violation of twelve-factor. The solution here is to factor shared code into libraries which can be included through the dependency manager.

# 2. Dependencies
**All dependencies should be declared, with no implicit reliance on system tools or libraries.**
A twelve-factor app never relies on implicit existence of system-wide packages. It declares all dependencies, completely and exactly, via a dependency declaration manifest. Furthermore, it uses a dependency isolation tool during execution to ensure that no implicit dependencies “leak in” from the surrounding system. The full and explicit dependency specification is applied uniformly to both production and development.

# 3. Config
**Configuration that varies between deployments should be stored in the environment.**
An app’s config is everything that is likely to vary between deploys (staging, production, developer environments, etc). This includes:
* Resource handles to the database, Memcached, and other backing services
* Credentials to external services such as Amazon S3 or Twitter
* Per-deploy values such as the canonical hostname for the deploy

# 4. Backing services
**All backing services are treated as attached resources and attached and detached by the execution environment.**
A backing service is any service the app consumes over the network as part of its normal operation. Examples include datastores (such as MySQL or CouchDB), messaging/queueing systems (such as RabbitMQ or Beanstalkd), SMTP services for outbound email (such as Postfix), and caching systems (such as Memcached).

# 5. Build, release, run
**The delivery pipeline should strictly consist of build, release, run.**

A codebase is transformed into a (non-development) deploy through three stages:

* The build stage is a transform which converts a code repo into an executable bundle known as a build. Using a version of the code at a commit specified by the deployment process, the build stage fetches vendors dependencies and compiles binaries and assets.
* The release stage takes the build produced by the build stage and combines it with the deploy’s current config. The resulting release contains both the build and the config and is ready for immediate execution in the execution environment.
* The run stage (also known as “runtime”) runs the app in the execution environment, by launching some set of the app’s processes against a selected release.

# 6. Processes
**Applications should be deployed as one or more stateless processes with persisted data stored on a backing service.**

In the simplest case, the code is a stand-alone script, the execution environment is a developer’s local laptop with an installed language runtime, and the process is launched via the command line (for example, python my_script.py). On the other end of the spectrum, a production deploy of a sophisticated app may use many process types, instantiated into zero or more running processes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no consistency maintained between different types of heading.


# 7. Port binding
**Self-contained services should make themselves available to other services by specified ports.**
The twelve-factor app is completely self-contained and does not rely on runtime injection of a webserver into the execution environment to create a web-facing service. The web app exports HTTP as a service by binding to a port, and listening to requests coming in on that port.

# 8. Concurrency
**Concurrency is advocated by scaling individual processes.**
Any computer program, once run, is represented by one or more processes. Web apps have taken a variety of process-execution forms. For example, PHP processes run as child processes of Apache, started on demand as needed by request volume. Java processes take the opposite approach, with the JVM providing one massive uberprocess that reserves a large block of system resources (CPU and memory) on startup, with concurrency managed internally via threads. In both cases, the running process(es) are only minimally visible to the developers of the app.

# 9. Disposability
**Fast startup and shutdown are advocated for a more robust and resilient system.**
Processes should strive to minimize startup time. Ideally, a process takes a few seconds from the time the launch command is executed until the process is up and ready to receive requests or jobs. Short startup time provides more agility for the release process and scaling up; and it aids robustness, because the process manager can more easily move processes to new physical machines when warranted.

# 10. Dev/Prod parity
**All environments should be as similar as possible.**

Historically, there have been substantial gaps between development (a developer making live edits to a local deploy of the app) and production (a running deploy of the app accessed by end users). These gaps manifest in three areas:

* **The time gap:** A developer may work on code that takes days, weeks, or even months to go into production.
* **The personnel gap:** Developers write code, ops engineers deploy it.
* **The tools gap:** Developers may be using a stack like Nginx, SQLite, and OS X, while the production deploy uses Apache, MySQL, and Linux.

# 11. Logs
**Applications should produce logs as event streams and leave the execution environment to aggregate.**
Logs provide visibility into the behavior of a running app. In server-based environments they are commonly written to a file on disk (a “logfile”); but this is only an output format.

# 12. Admin Processes
**Any needed admin tasks should be kept in source control and packaged with the application.**
One-off admin processes should be run in an identical environment as the regular long-running processes of the app. They run against a release, using the same codebase and config as any process run against that release. Admin code must ship with application code to avoid synchronization issues.
18 changes: 18 additions & 0 deletions CLIENT-SERVER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
How a request get served?
==
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ==?

---

Web Server accepts request and responds to Hypertext Transfer Protocol (HTTP) requests. Browsers such as Netscape™ Communicator communicate using several protocols including HTTP and FTP.

The transfer of resources happens using TCP (Transmission Control Protocol). In viewing this webpage, TCP manages the channels between your browser and the server. TCP is used to manage many types of internet connections in which one computer or device wants to send something to another. HTTP is the command language that the devices on both sides of the connection must follow in order to communicate.

Once the TCP connection is established, the client sends a HTTP GET request to the server to retrieve the webpage it should display. After the server has sent the response, it closes the TCP connection. If you open the website in your browser again, or if your browser automatically requests something from the server, a new connection is opened which follows the same process described above.

# _HTTP Basics_
---
As a quick summary, the HTTP/1.1 protocol works as follows:

* The client (usually a browser) opens a connection to the server and sends a request.
* The server processes the request, generates a response, and closes the connection if it finds a Connection: Close header.
* The request consists of a line indicating a method such as GET or POST, a Uniform Resource Identifier (URI) indicating which resource is being requested, and an HTTP protocol version separated by spaces.
* This is normally followed by a number of headers, a blank line indicating the end of the headers, and sometimes body data. Headers may provide various information about the request or the client body data. Headers are typically only sent for POST and PUT methods.
66 changes: 66 additions & 0 deletions MERN-STACK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
MERN Stack:
==
MERN Stack is a Javascript Stack that is used for easier and faster deployment of full-stack web applications. MERN Stack comprises of 4 technologies namely: MongoDB, Express, React and Node.js. It is designed to make the development process smoother and easier.

Each of these 4 powerful technologies provides an end-to-end framework for the developers to work in and each of these technologies play a big part in the development of web applications.

# 1. MongoDB: Cross-platform Document-Oriented Database
---

MongoDB is a NoSQL database where each record is a document comprising of key-value pairs that are similar to JSON (JavaScript Object Notation) objects. MongoDB is flexible and allows its users to create schema, databases, tables, etc. Documents that are identifiable by a primary key make up the basic unit of MongoDB. Once MongoDB is installed, users can make use of Mongo shell as well. Mongo shell provides a JavaScript interface through which the users can interact and carry out operations (eg: querying, updating records, deleting records).

**Why use MongoDB?**
--

* Fast – Being a document-oriented database, easy to index documents. Therefore a faster response.
* Scalability – Large data can be handled by dividing it into several machines.
* Use of JavaScript – MongoDB uses JavaScript which is the biggest advantage.
* Schema Less – Any type of data in a separate document.
* Data stored in the form of JSON –
Objects, Object Members, Arrays, Values and Strings
* JSON syntax is very easy to use.
* JSON has a wide range of browser compatibility.

# 2. Express: Back-End Framework:
---
Express is a Node.js framework. Rather than writing the code using Node.js and creating loads of Node modules, Express makes it simpler and easier to write the back-end code. Express helps in designing great web applications and APIs. Express supports many middlewares which makes the code shorter and easier to write.

**Why use Express?**
--

* Asynchronous and Single-threaded.
* Effecient, fast & scalable
* Has the biggest community for Node.js
* Express promotes code reusability with its built-in router.
* Robust API

# 3. React: Front-End Framework
---
React is a JavaScript library that is used for building user interfaces. React is used for the development of single-page applications and mobile applications because of its ability to handle rapidly changing data. React allows users to code in JavasScript and create UI components.

**Why use React?**
---
* **Virtual DOM** – A virtual DOM object is a representation of a DOM object. Virtual DOM is actually a copy of the original DOM. Any modification in the web application causes the entire UI to re-render the virtual DOM. Then the difference between the original DOM and this virtual DOM is compared and the changes are made accordingly to the original DOM.

* **JSX** – Stands for JavaScript XML. It is an HTML/XML JavaScript Extension which is used in React. Makes it easier and simpler to write React components.

* **Components** – ReactJS supports Components. Components are the building blocks of UI wherein each component has a logic and contributes to the overall UI. These components also promote code reusability and make the overall web application easier to understand.

* **High Performance** – Features like Virtual DOM, JSX and Components makes it much faster than the rest of the frameworks out there.

* **Developing Android/Ios Apps** – With React Native you can easily code Android-based or IOS-Based apps with just the knowledge of JavaScript and ReactJS.

# 4. Node.js: JS Runtime Environment
---
Node.js provides a JavaScript Environment which allows the user to run their code on the server (outside the browser). Node pack manager i.e. npm allows the user to choose from thousands of free packages (node modules) to download.

**Why use Node.JS?**
--

* Open source JavaScript Runtime Environemnt
* Single threading – Follows a single threaded model.
* Data Streaming
* Fast – Built on Google Chrome’s JavaScript Engine, Node.js has a fast code execution.
* Highly Scalable


85 changes: 85 additions & 0 deletions VS-CODE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Features:
=========
**1. Edit, build, and debug with ease**

**2. Robust and extensible architecture**

**3. Available for macOS, Linux, and Windows**

**4. Make it your own**

Customize every feature to your liking and install any number of third-party extensions

**5. Built with love for the Web**

VS Code includes enriched built-in support for Node.js development with JavaScript and TypeScript, powered by the same underlying technologies that drive Visual Studio

---

Plugins:
========

**1. Quokka**

Quokka is a debugging tool that gives live feedback on the code you are writing. It shows you previews of the results of functions and calculated values for variables. The extension is easy to configure and works out of the box with JSX or TypeScript projects.

**2. Faker**

Quickly insert placeholder data using the popular Faker JavaScript library. You can generate random names, addresses, images, phone numbers, or just paragraphs of classic Lorem Ipsum. Each category has various subcategories so you can make the data fit your needs.

**3. Color Info**

Small plugin that gives you various information about the colors you've used in your CSS. By hovering on a color you can see a larger preview of how it looks, as well as info about its translation to all formats (hex, rgb, hsl, and cmyk).

**4. SVG Viewer**

This extension adds a number of utilities for working with SVGs in Visual Studio Code. It makes it possible to render SVG files and see how they look like without having to leave the editor. There are also options for converting to PNG and generating data URI schemes.

**5. TODO Highlight**

This tool marks all TODO comments in your code, making it easier to track down any unfinished business before pushing to production. By default it looks for TODO and FIXME keywords but you can add your custom expressions as well.

**6. Icon Fonts**

Tiny snippets for including icon fonts in your project (from a CDN) and then adding the icons themselves. The extension supports over 20 popular icon sets, including Font Awesome, Ionicons, Glyphicons, and Material Design Icons.

**7. Language and Framework Packs**

VSCode ships with support for a large number of languages. If for some reason your programming language of choice isn't included, you can download an extension pack which will add autocompletion, proper indentation, and other utilities. Some web dev frameworks like react native and vue also offer language packs.

**8. Minify**

Extension for minifying your code. It offers a ton of customization settings and the option to automatically minify on save and export to a .min file. Minify works with JavaScript, CSS, and HTML through uglify-js, clean-css, and html-minifier respectively.

---

Commands Used:
=========
* echo "# javascript-client" >> README.md

* git init

* git add README.md

* git commit -m "first commit"

* git remote add origin https://github.com/AryanSinghalGit/javascript-client.git

* git push -u origin master

* git branch

* git checkout -b develop

* git push origin develop

* git checkout -b feature/39512

* gedit VS-CODE.md

* git add VS-CODE.md

* git status

* git push origin feature/39512

3 changes: 3 additions & 0 deletions extra/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package-lock.json

node_modules/
15 changes: 15 additions & 0 deletions extra/constant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const permissions={
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not proper indentation followed for the line and file as well.

'getUsers': {
all: ['head-trainer'],
read : ['trainee', 'trainer'],
write : ['trainer'],
delete: [],
},
'myUsers':{
all: ['hod'],
read : ['student', 'teacher'],
write : ['teacher'],
delete: ['admin'],
}
};
export {permissions};
25 changes: 25 additions & 0 deletions extra/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {diamond} from './patterns/index.js';
import {equilateral} from './patterns/index.js';
import {hasPermission, validateUser} from './utils/index.js';
diamond(10);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please maintain a proper space between code snippets.

equilateral(8);
hasPermission("getUsers","trainer","write");
const user=[
{
traineeEmail: 'trainee1@successive.tech',
reviewerEmail: 'reviewer1@successive.tech'
},
{
traineeEmail: 'aryan.singhal@successive.tech',
reviewerEmail: 'rahul.sadhukhan@successive.tech'
},
{
traineeEmail: 'trainee1@gmail.com',
reviewerEmail: 'reviewer1@hotmail.com'
},
{
traineeEmail: 'Aman$2@successive.tech',
reviewerEmail: 'vinay.chaudhary@successive.tech'
}
];
validateUser(user);
30 changes: 30 additions & 0 deletions extra/patterns/diamond.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function diamond(n)
{
for(let i=0;i<n;i++)
{
let str="";
for(let k=0;k<n-i-1;k++)
{
str=str+" ";
}
for(let j=0;j<=i;j++)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No proper indentation is done over here in this file

{
str=str+"* ";
}
console.log(str);
}
for(let i=n;i>0;i--)
{
let str="";
for(let k=0;k<n-i;k++)
{
str=str+" ";
}
for(let j=0;j<i;j++)
{
str=str+"* ";
}
console.log(str);
}
}
export default diamond;
18 changes: 18 additions & 0 deletions extra/patterns/equilateral.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function equilateral(n)
{
for(let i=0;i<n;i++)
{
let str="";
for(let k=0;k<n-i-1;k++)
{
str=str+" ";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No indentation in file

}
for(let j=0;j<=i;j++)
{

str=str+"* ";
}
console.log(str);
}
}
export default equilateral;
3 changes: 3 additions & 0 deletions extra/patterns/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import diamond from "./diamond.js";
import equilateral from "./equilateral.js";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No indentation in file

export {diamond,equilateral};
Loading