dev-dsa 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +62 -0
  2. package/commands/apiCommand.js +31 -0
  3. package/commands/backendCommand.js +51 -0
  4. package/commands/databaseCommand.js +29 -0
  5. package/commands/frontendCommand.js +31 -0
  6. package/commands/helpCommand.js +19 -0
  7. package/commands/topics/api/deleteCommand.js +21 -0
  8. package/commands/topics/api/getCommand.js +21 -0
  9. package/commands/topics/api/postCommand.js +21 -0
  10. package/commands/topics/api/putCommand.js +21 -0
  11. package/commands/topics/api/restapiCommand.js +21 -0
  12. package/commands/topics/backend/authenticationCommand.js +21 -0
  13. package/commands/topics/backend/cloudinaryCommand.js +55 -0
  14. package/commands/topics/backend/cookieParser.js +18 -0
  15. package/commands/topics/backend/corsCommand.js +18 -0
  16. package/commands/topics/backend/dynamicRoutes.js +18 -0
  17. package/commands/topics/backend/ejsTemplates.js +18 -0
  18. package/commands/topics/backend/errorHandlingCommand.js +21 -0
  19. package/commands/topics/backend/expressCommand.js +21 -0
  20. package/commands/topics/backend/expressSession.js +18 -0
  21. package/commands/topics/backend/filesystemCommand.js +56 -0
  22. package/commands/topics/backend/formHandling.js +18 -0
  23. package/commands/topics/backend/googleOauth.js +18 -0
  24. package/commands/topics/backend/httpModuleCommand.js +47 -0
  25. package/commands/topics/backend/jwtCommand.js +18 -0
  26. package/commands/topics/backend/middlewareCommand.js +21 -0
  27. package/commands/topics/backend/mongodbCrud.js +18 -0
  28. package/commands/topics/backend/mongodbOperators.js +18 -0
  29. package/commands/topics/backend/mongodbSetup.js +18 -0
  30. package/commands/topics/backend/morganLogger.js +18 -0
  31. package/commands/topics/backend/multerCommand.js +52 -0
  32. package/commands/topics/backend/nodeCommand.js +21 -0
  33. package/commands/topics/backend/nodemailerCommand.js +101 -0
  34. package/commands/topics/backend/postman.js +18 -0
  35. package/commands/topics/backend/razorpay.js +18 -0
  36. package/commands/topics/backend/redis.js +18 -0
  37. package/commands/topics/backend/socketio.js +18 -0
  38. package/commands/topics/database/crudCommand.js +21 -0
  39. package/commands/topics/database/mongodbCommand.js +21 -0
  40. package/commands/topics/database/mongooseCommand.js +21 -0
  41. package/commands/topics/database/schemaCommand.js +21 -0
  42. package/commands/topics/frontend/cssCommand.js +21 -0
  43. package/commands/topics/frontend/htmlCommand.js +21 -0
  44. package/commands/topics/frontend/javascriptCommand.js +21 -0
  45. package/commands/topics/frontend/reactCommand.js +21 -0
  46. package/commands/topics/frontend/responsiveCommand.js +21 -0
  47. package/commands/webCommand.js +35 -0
  48. package/index.js +134 -0
  49. package/package.json +18 -0
@@ -0,0 +1,47 @@
1
+ const httpModuleCommand = (program) => {
2
+ program
3
+ .command("httpModule")
4
+ .description("Learn about Node.js HTTP Module")
5
+ .action(() => {
6
+ console.log(`
7
+ 🌐 Node.js HTTP Module
8
+
9
+ The built-in HTTP module allows Node.js to transfer data over the Hyper Text Transfer Protocol (HTTP) and create basic web servers.
10
+
11
+ --- 1. Prerequisites ---
12
+ • Node.js installed on your machine.
13
+ • No extra npm installs required!
14
+
15
+ --- 2. Creating a Basic Server ---
16
+ \`\`\`javascript
17
+ const http = require('http');
18
+
19
+ const server = http.createServer((req, res) => {
20
+ if (req.url === '/') {
21
+ res.writeHead(200, { 'Content-Type': 'text/html' });
22
+ res.write('<h1>Welcome to my Node.js Server</h1>');
23
+ res.end();
24
+ } else if (req.url === '/api') {
25
+ res.writeHead(200, { 'Content-Type': 'application/json' });
26
+ res.write(JSON.stringify({ message: "Hello World" }));
27
+ res.end();
28
+ } else {
29
+ res.writeHead(404, { 'Content-Type': 'text/plain' });
30
+ res.end('404 Not Found');
31
+ }
32
+ });
33
+
34
+ server.listen(3000, () => {
35
+ console.log('Server is running on http://localhost:3000');
36
+ });
37
+ \`\`\`
38
+
39
+ --- 3. Concepts ---
40
+ • req (Request): Contains headers, url, parameters, and body coming from the user.
41
+ • res (Response): Used to send data back. Always remember to call res.end().
42
+ • status codes: 200 (OK), 404 (Not Found), 500 (Server Error).
43
+ `);
44
+ });
45
+ };
46
+
47
+ module.exports = httpModuleCommand;
@@ -0,0 +1,18 @@
1
+ const jwtCommand = (program) => {
2
+ program
3
+ .command("jwt")
4
+ .description("JSON Web Tokens for stateless API auth")
5
+ .action(() => {
6
+ console.log("\nšŸ”‘ JWT Auth\n");
7
+ console.log("JSON Web Tokens for stateless API auth implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install jwt\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = jwtCommand;
@@ -0,0 +1,21 @@
1
+ const middlewareCommand = (program) => {
2
+ program
3
+ .command("middleware")
4
+ .description("Learn about Middleware")
5
+ .action(() => {
6
+ console.log("\n🧩 Middleware\n");
7
+ console.log("Middleware functions are functions that have access to the request and response objects in the pipeline.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Global Middleware: like cors() or express.json() for all routes");
11
+ console.log("- Route-Specific Middleware: Auth checks, validations on specific endpoints");
12
+ console.log("- Third-Party Middleware: Morgan, Helmet, Compression");
13
+ console.log("- Custom Middleware: Writing functions to verify permissions or tokens\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Backend → DEV-DSA backend");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = middlewareCommand;
@@ -0,0 +1,18 @@
1
+ const mongodbCrud = (program) => {
2
+ program
3
+ .command("mongodbCrud")
4
+ .description("Create, Read, Update, Delete queries")
5
+ .action(() => {
6
+ console.log("\nšŸƒ MongoDB CRUD\n");
7
+ console.log("Create, Read, Update, Delete queries implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install mongodbcrud\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = mongodbCrud;
@@ -0,0 +1,18 @@
1
+ const mongodbOperators = (program) => {
2
+ program
3
+ .command("mongodbOperators")
4
+ .description("Query and update operators like $set, $inc, $pull")
5
+ .action(() => {
6
+ console.log("\nšŸƒ MongoDB Operators\n");
7
+ console.log("Query and update operators like $set, $inc, $pull implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install mongodboperators\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = mongodbOperators;
@@ -0,0 +1,18 @@
1
+ const mongodbSetup = (program) => {
2
+ program
3
+ .command("mongodbSetup")
4
+ .description("Setting up MongoDB Atlas and Mongoose")
5
+ .action(() => {
6
+ console.log("\nšŸƒ MongoDB Setup\n");
7
+ console.log("Setting up MongoDB Atlas and Mongoose implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install mongodbsetup\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = mongodbSetup;
@@ -0,0 +1,18 @@
1
+ const morganLogger = (program) => {
2
+ program
3
+ .command("morgan")
4
+ .description("HTTP request logger middleware for node.js")
5
+ .action(() => {
6
+ console.log("\nšŸ“ Morgan Logger\n");
7
+ console.log("HTTP request logger middleware for node.js implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install morgan\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = morganLogger;
@@ -0,0 +1,52 @@
1
+ const multerCommand = (program) => {
2
+ program
3
+ .command("multer")
4
+ .description("Learn about handling file uploads with Multer")
5
+ .action(() => {
6
+ console.log(`
7
+ šŸ“‚ Multer (File Uploading)
8
+
9
+ Multer is a node.js middleware for handling multipart/form-data, primarily used for uploading files.
10
+
11
+ --- 1. Installation ---
12
+ npm install multer
13
+
14
+ --- 2. Configuration ---
15
+ \`\`\`javascript
16
+ const express = require('express');
17
+ const multer = require('multer');
18
+ const path = require('path');
19
+ const app = express();
20
+
21
+ // Set storage engine
22
+ const storage = multer.diskStorage({
23
+ destination: function (req, file, cb) {
24
+ cb(null, 'uploads/') // Create an "uploads" folder first!
25
+ },
26
+ filename: function (req, file, cb) {
27
+ // Make file names unique
28
+ cb(null, file.fieldname + '-' + Date.now() + path.extname(file.originalname))
29
+ }
30
+ });
31
+
32
+ const upload = multer({ storage: storage });
33
+
34
+ app.post('/upload', upload.single('myFile'), (req, res) => {
35
+ console.log(req.file); // Info about the uploaded file
36
+ res.send('File uploaded!');
37
+ });
38
+
39
+ app.listen(3000, () => console.log('Server started'));
40
+ \`\`\`
41
+
42
+ --- 3. Multiple Files ---
43
+ To upload multiple files, change upload.single('name') to upload.array('photos', 5)
44
+
45
+ --- 4. Troubleshooting ---
46
+ • "Unexpected field" error: Ensure your HTML form's name attribute perfectly matches what is in upload.single('exact_name').
47
+ • Files not saving: Ensure the "destination" folder physically exists before running the server, or use the root string './uploads'.
48
+ `);
49
+ });
50
+ };
51
+
52
+ module.exports = multerCommand;
@@ -0,0 +1,21 @@
1
+ const nodeCommand = (program) => {
2
+ program
3
+ .command("node")
4
+ .description("Learn about Node.js")
5
+ .action(() => {
6
+ console.log("\n🟢 Node.js\n");
7
+ console.log("Node.js is an open-source, cross-platform JavaScript runtime environment that executes JS outside a web browser.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- V8 Engine: Compiles JS to native machine code");
11
+ console.log("- Event Loop: Handles non-blocking asynchronous operations");
12
+ console.log("- NPM (Node Package Manager): Managing dependencies and packages");
13
+ console.log("- Built-in Modules: Uses like fs, http, path, os\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Backend → DEV-DSA backend");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = nodeCommand;
@@ -0,0 +1,101 @@
1
+ const nodemailerCommand = (program) => {
2
+ program
3
+ .command("nodemailer")
4
+ .description("Learn how to set up Nodemailer with Google OAuth2")
5
+ .action(() => {
6
+ console.log(`
7
+ šŸ“§ Nodemailer with OAuth2 Authentication
8
+
9
+ This guide provides step-by-step instructions for setting up and using Nodemailer in a Node.js application with OAuth2 authentication using ClientID and ClientSecret, along with generating a refresh token using the OAuth 2.0 Playground.
10
+
11
+ --- 1. Prerequisites ---
12
+ • Node.js installed on your machine.
13
+ • A Google account to generate OAuth2 credentials (ClientID and ClientSecret).
14
+ • Access to the Google API Console to create OAuth2 credentials.
15
+
16
+ --- 2. Getting OAuth2 Credentials ---
17
+ Go to the Google API Console:
18
+ 1. Navigate to the Google API Console.
19
+ 2. Create a new project or select an existing one.
20
+
21
+ Enable Gmail API:
22
+ 1. Go to the Library section.
23
+ 2. Search for Gmail API and enable it.
24
+
25
+ Create OAuth2 Credentials:
26
+ 1. Go to the Credentials section.
27
+ 2. Click on Create Credentials and choose OAuth 2.0 Client IDs.
28
+ 3. Set the application type to Web application.
29
+ 4. Under Authorized redirect URIs, add http://localhost and https://developers.google.com/oauthplayground.
30
+ 5. After creating, you'll get your ClientID and ClientSecret.
31
+
32
+ --- 3. Generating the Refresh Token ---
33
+ 1. Open the OAuth 2.0 Playground in your web browser.
34
+ 2. In the top-right corner, click on the gear icon (settings).
35
+ 3. Under OAuth 2.0 endpoints, select Use your own OAuth credentials.
36
+ 4. Enter your ClientID and ClientSecret.
37
+ 5. Set the Access type to Offline to obtain a refresh token.
38
+ 6. In Step 1 on the left panel, select scopes: https://mail.google.com/
39
+ 7. Click Authorize APIs. Log in with Google.
40
+ 8. Click on Exchange authorization code for tokens.
41
+ 9. Copy your refresh token!
42
+
43
+ --- 4. Installation ---
44
+ npm init -y
45
+ npm install nodemailer dotenv
46
+
47
+ --- 5. Configuration (.env) ---
48
+ CLIENT_ID=your-client-id
49
+ CLIENT_SECRET=your-client-secret
50
+ REFRESH_TOKEN=your-refresh-token
51
+ EMAIL_USER=your-email@example.com
52
+
53
+ --- 6. email.js setup ---
54
+ \`\`\`javascript
55
+ require('dotenv').config();
56
+ const nodemailer = require('nodemailer');
57
+
58
+ const transporter = nodemailer.createTransport({
59
+ service: 'gmail',
60
+ auth: {
61
+ type: 'OAuth2',
62
+ user: process.env.EMAIL_USER,
63
+ clientId: process.env.CLIENT_ID,
64
+ clientSecret: process.env.CLIENT_SECRET,
65
+ refreshToken: process.env.REFRESH_TOKEN,
66
+ },
67
+ });
68
+
69
+ transporter.verify((error, success) => {
70
+ if (error) console.error(error);
71
+ else console.log('Ready to send messages');
72
+ });
73
+
74
+ const sendEmail = async (to, subject, text, html) => {
75
+ try {
76
+ const info = await transporter.sendMail({
77
+ from: \`"Your Name" <\${process.env.EMAIL_USER}>\`,
78
+ to, subject, text, html,
79
+ });
80
+ console.log('Message sent: %s', info.messageId);
81
+ } catch (error) {
82
+ console.error('Error sending email:', error);
83
+ }
84
+ };
85
+ module.exports = sendEmail;
86
+ \`\`\`
87
+
88
+ --- 7. Usage in app.js ---
89
+ \`\`\`javascript
90
+ const sendEmail = require('./email');
91
+ sendEmail('recipient@example.com', 'Test Email', 'Hello', '<b>Hello</b>');
92
+ \`\`\`
93
+
94
+ --- 8. Troubleshooting ---
95
+ • Invalid Credentials Error: Ensure that your ClientID, ClientSecret, and RefreshToken are correct.
96
+ • Email Not Sent: Check if the OAuth2 scopes include Gmail API access.
97
+ `);
98
+ });
99
+ };
100
+
101
+ module.exports = nodemailerCommand;
@@ -0,0 +1,18 @@
1
+ const postman = (program) => {
2
+ program
3
+ .command("postman")
4
+ .description("Learn how to test APIs with Postman v10")
5
+ .action(() => {
6
+ console.log("\nšŸ“® Postman API Testing\n");
7
+ console.log("Learn how to test APIs with Postman v10 implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install postman\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = postman;
@@ -0,0 +1,18 @@
1
+ const razorpay = (program) => {
2
+ program
3
+ .command("razorpay")
4
+ .description("Learn how to integrate payment gateways")
5
+ .action(() => {
6
+ console.log("\nšŸ’³ Razorpay Integration\n");
7
+ console.log("Learn how to integrate payment gateways implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install razorpay\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = razorpay;
@@ -0,0 +1,18 @@
1
+ const redis = (program) => {
2
+ program
3
+ .command("redis")
4
+ .description("Learn about caching with Redis")
5
+ .action(() => {
6
+ console.log("\nšŸ”“ Redis caching\n");
7
+ console.log("Learn about caching with Redis implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install redis\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = redis;
@@ -0,0 +1,18 @@
1
+ const socketio = (program) => {
2
+ program
3
+ .command("socketio")
4
+ .description("Learn real-time websockets with Socket.io")
5
+ .action(() => {
6
+ console.log("\n⚔ Socket.io\n");
7
+ console.log("Learn real-time websockets with Socket.io implementation guide.\n");
8
+ console.log("--- 1. Installation ---");
9
+ console.log("npm install socketio\n");
10
+ console.log("--- 2. How it works ---");
11
+ console.log("This is an auto-generated template based on your request. It works similarly to the Nodemailer guide.\n");
12
+ console.log("šŸ“Œ Navigation:");
13
+ console.log("Back to Backend → DEV-DSA backend");
14
+ console.log("Help Menu → DEV-DSA help\n");
15
+ });
16
+ };
17
+
18
+ module.exports = socketio;
@@ -0,0 +1,21 @@
1
+ const crudCommand = (program) => {
2
+ program
3
+ .command("crud")
4
+ .description("Learn about CRUD Operations")
5
+ .action(() => {
6
+ console.log("\nšŸ”„ CRUD Operations\n");
7
+ console.log("CRUD stands for Create, Read, Update, and Delete - the four basic functions of persistent storage.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Create: Model.create(), new Model().save()");
11
+ console.log("- Read: Model.find(), Model.findById(), Model.findOne()");
12
+ console.log("- Update: Model.findByIdAndUpdate(), Model.updateOne()");
13
+ console.log("- Delete: Model.findByIdAndDelete(), Model.deleteOne()\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Database → DEV-DSA database");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = crudCommand;
@@ -0,0 +1,21 @@
1
+ const mongodbCommand = (program) => {
2
+ program
3
+ .command("mongodb")
4
+ .description("Learn about MongoDB")
5
+ .action(() => {
6
+ console.log("\nšŸƒ MongoDB\n");
7
+ console.log("MongoDB is a source-available cross-platform document-oriented database program classified as a NoSQL database.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Documents & Collections: Storing data in JSON-like formats instead of tables");
11
+ console.log("- BSON format: Binary-encoded serialization of JSON-like documents");
12
+ console.log("- NoSQL Advantages: Flexible schemas and high scalability");
13
+ console.log("- MongoDB Atlas: Managing databases in the cloud\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Database → DEV-DSA database");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = mongodbCommand;
@@ -0,0 +1,21 @@
1
+ const mongooseCommand = (program) => {
2
+ program
3
+ .command("mongoose")
4
+ .description("Learn about Mongoose")
5
+ .action(() => {
6
+ console.log("\nšŸ¦Ž Mongoose\n");
7
+ console.log("Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Schemas & Models: Defining the shape of your documents");
11
+ console.log("- Types & Validation: Ensuring correct data structure before saving");
12
+ console.log("- Hooks / Middleware: Intervening before saving or updating");
13
+ console.log("- Virtuals: Computed properties that do not persist to MongoDB\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Database → DEV-DSA database");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = mongooseCommand;
@@ -0,0 +1,21 @@
1
+ const schemaCommand = (program) => {
2
+ program
3
+ .command("schema")
4
+ .description("Learn about Schemas")
5
+ .action(() => {
6
+ console.log("\nšŸ“ Data Schema\n");
7
+ console.log("A schema defines the organization, structure, and constraints of data within a database.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Data Types: Strings, Numbers, Dates, Arrays, ObjectIds");
11
+ console.log("- Validations: Required fields, min/max lengths, default values, enums");
12
+ console.log("- Relations: Embedding sub-documents vs Referencing ObjectIds");
13
+ console.log("- Indexes: Enhancing the speed of data retrieval operations\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Database → DEV-DSA database");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = schemaCommand;
@@ -0,0 +1,21 @@
1
+ const cssCommand = (program) => {
2
+ program
3
+ .command("css")
4
+ .description("Learn about CSS")
5
+ .action(() => {
6
+ console.log("\nšŸŽØ CSS (Cascading Style Sheets)\n");
7
+ console.log("CSS describes how HTML elements are to be displayed on screen, paper, or in other media.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Selectors: Targeting HTML elements (class, id, pseudo-selectors)");
11
+ console.log("- Box Model: Margins, borders, padding, and the actual content");
12
+ console.log("- Flexbox: Efficiently layout, align and distribute space among items");
13
+ console.log("- Grid: Two-dimensional grid-based layout system\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Frontend → DEV-DSA frontend");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = cssCommand;
@@ -0,0 +1,21 @@
1
+ const htmlCommand = (program) => {
2
+ program
3
+ .command("html")
4
+ .description("Learn about HTML")
5
+ .action(() => {
6
+ console.log("\nšŸ“„ HTML (HyperText Markup Language)\n");
7
+ console.log("HTML is the standard markup language for documents designed to be displayed in a web browser.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Elements & Tags: Fundamental building blocks (div, span, p, a)");
11
+ console.log("- Attributes: Provide additional information about elements (class, id, src)");
12
+ console.log("- Semantic HTML: Using markers like <header>, <article>, and <footer>");
13
+ console.log("- Forms & Inputs: Allowing user input and data collection\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Frontend → DEV-DSA frontend");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = htmlCommand;
@@ -0,0 +1,21 @@
1
+ const javascriptCommand = (program) => {
2
+ program
3
+ .command("javascript")
4
+ .description("Learn about JavaScript")
5
+ .action(() => {
6
+ console.log("\n⚔ JavaScript\n");
7
+ console.log("JavaScript is a programming language that enables interactive web pages, dynamic content, and complex features.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Variables & Data Types: Let, const, var, string, numbers, objects");
11
+ console.log("- Functions: Arrow functions, scope, and closures");
12
+ console.log("- DOM Manipulation: Selecting nodes and event listeners");
13
+ console.log("- Asynchronous JS: Promises, async/await, and APIs\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Frontend → DEV-DSA frontend");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = javascriptCommand;
@@ -0,0 +1,21 @@
1
+ const reactCommand = (program) => {
2
+ program
3
+ .command("react")
4
+ .description("Learn about React.js")
5
+ .action(() => {
6
+ console.log("\nāš›ļø React.js\n");
7
+ console.log("React is a popular JavaScript library for building user interfaces based on UI components.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Components: Reusable chunks of UI");
11
+ console.log("- State & Props: Managing and passing data between components");
12
+ console.log("- Hooks: useState, useEffect, useRef, and custom hooks");
13
+ console.log("- Routing: React Router for client-side navigation\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Frontend → DEV-DSA frontend");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = reactCommand;
@@ -0,0 +1,21 @@
1
+ const responsiveCommand = (program) => {
2
+ program
3
+ .command("responsive")
4
+ .description("Learn about Responsive Design")
5
+ .action(() => {
6
+ console.log("\nšŸ“± Responsive Design\n");
7
+ console.log("Responsive Web Design makes web pages render well on a variety of devices and window or screen sizes.\n");
8
+
9
+ console.log("šŸ“š Subtopics:\n");
10
+ console.log("- Media Queries: Applying CSS rules for specific screen widths");
11
+ console.log("- Viewport Meta Tag: Helping browsers scale content efficiently");
12
+ console.log("- Fluid Layouts: Using percentages instead of fixed pixels");
13
+ console.log("- Mobile First Strategy: Designing UX for small screens first\n");
14
+
15
+ console.log("šŸ“Œ Navigation:\n");
16
+ console.log("Back to Frontend → DEV-DSA frontend");
17
+ console.log("Help Menu → DEV-DSA help\n");
18
+ });
19
+ };
20
+
21
+ module.exports = responsiveCommand;
@@ -0,0 +1,35 @@
1
+ const webCommand = (program) => {
2
+ program
3
+ .command("web")
4
+ .description("Web Developer Introduction")
5
+ .action(() => {
6
+ console.log("\nšŸš€ Welcome to DEV-DSA CLI\n");
7
+ console.log("šŸ‘Øā€šŸ’» Web Developer Introduction\n");
8
+ console.log("Hi, I am a Full Stack Web Developer.");
9
+ console.log("I build modern web applications using frontend, backend, and databases.\n");
10
+ console.log("šŸ“š Available Sections:\n");
11
+
12
+ console.log("1. Frontend Development");
13
+ console.log(" Run: DEV-DSA frontend");
14
+ console.log(" (HTML, CSS, JavaScript, React)\n");
15
+
16
+ console.log("2. Backend Development");
17
+ console.log(" Run: DEV-DSA backend");
18
+ console.log(" (Node.js, Express.js, Authentication)\n");
19
+
20
+ console.log("3. Database");
21
+ console.log(" Run: DEV-DSA database");
22
+ console.log(" (MongoDB, Mongoose, CRUD Operations)\n");
23
+
24
+ console.log("4. REST API Development");
25
+ console.log(" Run: DEV-DSA api");
26
+ console.log(" (GET, POST, PUT, DELETE, JSON APIs)\n");
27
+
28
+ console.log("šŸ’” Tip: Run any command above to see full details.");
29
+ console.log("Example: DEV-DSA frontend\n");
30
+
31
+ console.log("šŸ”„ Keep learning and keep building!\n");
32
+ });
33
+ };
34
+
35
+ module.exports = webCommand;