Skip to content

muhammadahmad1857/Cloud-Engineering-Course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

160 Commits
 
 
 
 
 
 

Repository files navigation

Cloud-Engineering course-repository containing solution of following.

  1. Classes
  2. Assignments
  3. Node Projects

I am a student at PIAIC batch-60

Welcome to the TypeScript repository organized by This repository contains resources, assignments, and examples related to TypeScript classes for students enrolled in PIAIC's courses.

Purpose

The primary purpose of this repository is to provide other students with comprehensive materials and practical exercises to learn and master TypeScript classes. By engaging with the content and completing the assignments, students will gain a deep understanding of object-oriented programming concepts in TypeScript, including classes, inheritance, encapsulation, and polymorphism.

Overview

In this repository, you will find a structured approach to learning TypeScript classes. We have organized the content into various modules, each covering specific aspects of classes and related topics. The modules include lectures, code examples, assignments, and supplementary materials to support your learning journey.

Course Curriculum

This course covers a diverse range of topics across five quarters:

Quarter 1: TypeScript

  • Introduction to TypeScript
  • Basic syntax and data types
  • Functions and classes
  • Advanced TypeScript features
  • Practical applications and projects

Quarter 2: Next.js (UI/UX)

  • Introduction to Next.js framework
  • Building user interfaces with Next.js
  • Enhancing user experience with Next.js features
  • Styling and responsive design
  • Real-world projects and case studies

Quarter 3: Python

  • Introduction to Python programming language
  • Basic syntax and data structures
  • Object-oriented programming in Python
  • Python for data analysis and manipulation
  • Practical Python applications and projects

Quarter 4: Generative AI

  • Fundamentals of Generative AI
  • Generative Adversarial Networks (GANs)
  • Variational Autoencoders (VAEs)
  • Applications of Generative AI in art, design, and beyond
  • Hands-on projects and experimentation with Generative AI models

Quarter 5: Cloud AI Engineering

  • Introduction to Cloud AI services
  • Deployment of AI models on cloud platforms
  • Scalability and performance optimization techniques
  • Cloud-based AI solutions for various domains
  • Capstone project involving the integration of AI with cloud technologies

This curriculum offers a comprehensive exploration of key technologies and concepts, providing students with a well-rounded understanding and practical skills in TypeScript, Next.js, Python, Generative AI, and Cloud AI Engineering.

Installation and Verification Guide

Node.js Installation:

  • Visit the Node.js website.
  • Click on the LTS version for stability.
  • Follow the installation instructions provided for your operating system.

Check Node.js Version:

  • Open Command Prompt (Cmd).
  • Type node -v and press Enter.

VS Code Installation:

  • Navigate to the VS Code website.
  • Download the installer using the provided button.
  • Install VS Code by following the installation wizard.

Check VS Code Version:

  • Open Command Prompt (Cmd).
  • Type code -v and press Enter.

Installing TypeScript

To install TypeScript, follow these steps:

For Windows Users:

  1. Open Command Prompt (Cmd).
  2. Type the following command and press Enter:
 npm install -g typescript

For Mac/Linux Users:

  1. Open Terminal.
  2. Type the following command and press Enter:
 sudo npm i -g typescript

What This Command Does:

  • npm install -g typescript: This command installs TypeScript globally on your system, allowing you to use it from any directory.

Note:

  • For Mac/Linux users, the sudo command is used to execute the installation with administrative privileges.
  • Make sure you have Node.js and npm (Node Package Manager) installed on your system before running these commands.

By following these steps, you'll have TypeScript installed and ready to use on your machine.

Verify TypeScript Installation and Version:

  • Type tsc -v in the command prompt and press Enter.

Make sure you have administrative privileges for installing global packages like TypeScript.

Versions:

  • Node.js Version: 20.11.1
  • VS Code Version: 1.87.2
  • TypeScript Version: 5.4.2

Ensure your system meets the minimum requirements for each software.

Changing Terminal from PowerShell to Command Prompt (Cmd) in VS Code

Using Command Palette:

For Windows Users:

  1. Open Visual Studio Code.

  2. Press Ctrl + Shift + P to open the command palette.

  3. Type "Terminal: Select Default Profile" and select it from the list.

  4. Choose "Command Prompt" or "Command Prompt (Cmd)" from the options provided.

  5. Your terminal will switch to Command Prompt as the default.

Now, whenever you open a new terminal in Visual Studio Code, it will default to Command Prompt instead of PowerShell.

For Mac/Linux Users:

  1. Open Visual Studio Code.

  2. Press Ctrl + Shift + P to open the command palette.

  3. Type "Terminal: Select Default Profile" and select it from the list.

  4. Choose "Command Prompt" or "Command Prompt (Cmd)" from the options provided.

  5. Your terminal will switch to Command Prompt as the default.

Now, whenever you open a new terminal in Visual Studio Code, it will default to Command Prompt instead of the default shell for your system.

Using UI:

For Windows Users:

  1. Open Visual Studio Code.

  2. Click on the terminal tab at the top menu.

  3. Near the top right corner of the terminal, click on the dropdown arrow.

  4. Select "Select Default Shell" from the dropdown menu.

  5. Choose "Command Prompt" or "Command Prompt (Cmd)" from the list.

  6. Your terminal will switch to Command Prompt as the default.

Now, whenever you open a new terminal in Visual Studio Code, it will default to Command Prompt instead of PowerShell.

For Mac/Linux Users:

  1. Open Visual Studio Code.

  2. Click on the terminal tab at the top menu.

  3. Near the top right corner of the terminal, click on the dropdown arrow.

  4. Select "Select Default Shell" from the dropdown menu.

  5. Choose "Command Prompt" or "Command Prompt (Cmd)" from the list.

  6. Your terminal will switch to Command Prompt as the default.

Now, whenever you open a new terminal in Visual Studio Code, it will default to Command Prompt instead of the default shell for your system.

TypeScript Setup and Compilation Guide

This guide outlines the steps to set up and compile TypeScript files for development.

Initializing Configuration

To set up project-specific settings for the TypeScript compiler, you can use the following command to create a tsconfig.json file:

npm init tsc --init

Compiling TypeScript Files

To compile TypeScript files (.ts) into JavaScript files (.js), use the tsc command followed by the filename of the TypeScript file you want to compile. Additionally, you can use the -w flag to enable watching for changes and automatic recompilation.

Example:

tsc filename.ts -w

Running the Compiled Code

Once you've compiled your TypeScript code into JavaScript, you can run the JavaScript file using node.

Example:

node filename.js

Alternatively, you can combine compilation and running the code using the following command:

tsc filename.ts && node filename.js

Using Nodemon for Development

For development purposes, you can utilize nodemon, a tool that automatically restarts your Node.js application whenever there are changes in the TypeScript files. This saves you time from manually recompiling and restarting the application.

nodemon node filename.js

Updating Configuration Files

If you need to update the configuration files tsconfig.json and package.json for your TypeScript project, you can follow these steps:

Updating tsconfig.json

  1. Change Target to ES2022: Update the target option in tsconfig.json to specify ES2022 as the target ECMAScript version.

    Example:

    {
      "compilerOptions": {
        "target": "ES2022", ///at line 14
        ...
      },
     ...
    }
  2. Change Module to NodeNext: Change the module option to specify NextNode as the module system.

Example:

{
  "compilerOptions": {
    ...
    "module": "NodeNext", // at line 28
    ...
  },
  ...
}
  1. Update Module Resolution: Comment out the moduleResolution option and change its value to NodeNext.

Example:

{
  "compilerOptions": {
    ...
    // "moduleResolution": "Node",  // Commented out
    "moduleResolution": "NodeNext", // at line 30
    ...
  },
  ...
}

Updating package.json

  1. Add Type Module: After the "main" field in package.json, add a "type" field with the value "module" to indicate that your project uses ECMAScript modules.

Example:

{
  "name": "your-package-name",
  "version": "1.0.0",
  "description": "Your package description",
  "main": "index.js",
  "type": "module",  // Added line
  "scripts": {
    ...
  },
  ...
}

This guide provides a solid foundation for getting started with TypeScript development.

Publishing Your Project on npm

To publish your project on npm, follow these steps:

Update Main File

  1. Add Shebang Line (#! /usr/bin/env node): In your main file (index.ts), add a shebang line at the top to make it executable as a command-line interface (CLI).

    Example:

    #! /usr/bin/env node
    
    // Your TypeScript code here

Update package.json

Update package.json Configuration:

  1. Update the package.json file to specify the necessary configuration for npm publishing.

Example:

{
  "name": "m-simple-calculator",
  "version": "1.0.1",
  "description": "A simple Calculator with TypeScript, Node.js, and Inquirer",
  "main": "index.js",
  "bin": "index.js",   // Add this line
  "type": "module",
  ...
}

Login to npm:

  1. If you haven't already have an account, create an account on npmjs.com. Then, in your terminal, run the following command to log in to npm:
npm login

Follow the prompts and enter your npm username, password, and email address or press enter to go on browser directly

Publish Your Package

  1. Ensure that your name is unique.
  2. Compile Your TypeScript Code: Before publishing, make sure to compile your TypeScript code into JavaScript using the TypeScript compiler (tsc).

Example:

tsc

or run

tsc filename.ts
  1. Publish Your Package: After compiling your code, navigate to the folder where your package.json is located. Then, run the following command to publish your package to npm:
npm publish

Check Your Package on npmjs.com:

  1. After publishing, you can check your package on npmjs.com. Log in to your npm account on the website and navigate to your profile. Click on the "Packages" dropdown to view your published package. You can click on your package to see its details.

That's it! Your package is now published on npm and can be installed and used by others.

Thanks for seeing myrepositories.

About

You can try my final nextjs project an e-commerce store

Resources

Stars

Watchers

Forks