- Classes
- Assignments
- 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.
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.
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.
This course covers a diverse range of topics across five quarters:
- Introduction to TypeScript
- Basic syntax and data types
- Functions and classes
- Advanced TypeScript features
- Practical applications and projects
- 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
- 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
- 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
- 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.
- Visit the Node.js website.
- Click on the LTS version for stability.
- Follow the installation instructions provided for your operating system.
- Open Command Prompt (Cmd).
- Type
node -vand press Enter.
- Navigate to the VS Code website.
- Download the installer using the provided button.
- Install VS Code by following the installation wizard.
- Open Command Prompt (Cmd).
- Type
code -vand press Enter.
To install TypeScript, follow these steps:
- Open Command Prompt (Cmd).
- Type the following command and press Enter:
npm install -g typescript- Open Terminal.
- Type the following command and press Enter:
sudo npm i -g typescriptnpm install -g typescript: This command installs TypeScript globally on your system, allowing you to use it from any directory.
- For Mac/Linux users, the
sudocommand 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.
- Type
tsc -vin the command prompt and press Enter.
Make sure you have administrative privileges for installing global packages like TypeScript.
- 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.
-
Open Visual Studio Code.
-
Press
Ctrl + Shift + Pto open the command palette. -
Type "Terminal: Select Default Profile" and select it from the list.
-
Choose "Command Prompt" or "Command Prompt (Cmd)" from the options provided.
-
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.
-
Open Visual Studio Code.
-
Press
Ctrl + Shift + Pto open the command palette. -
Type "Terminal: Select Default Profile" and select it from the list.
-
Choose "Command Prompt" or "Command Prompt (Cmd)" from the options provided.
-
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.
-
Open Visual Studio Code.
-
Click on the terminal tab at the top menu.
-
Near the top right corner of the terminal, click on the dropdown arrow.
-
Select "Select Default Shell" from the dropdown menu.
-
Choose "Command Prompt" or "Command Prompt (Cmd)" from the list.
-
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.
-
Open Visual Studio Code.
-
Click on the terminal tab at the top menu.
-
Near the top right corner of the terminal, click on the dropdown arrow.
-
Select "Select Default Shell" from the dropdown menu.
-
Choose "Command Prompt" or "Command Prompt (Cmd)" from the list.
-
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.
This guide outlines the steps to set up and compile TypeScript files for development.
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 --initTo 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 -wOnce you've compiled your TypeScript code into JavaScript, you can run the JavaScript file using node.
Example:
node filename.jsAlternatively, you can combine compilation and running the code using the following command:
tsc filename.ts && node filename.jsFor 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.jsIf you need to update the configuration files tsconfig.json and package.json for your TypeScript project, you can follow these steps:
-
Change Target to ES2022: Update the
targetoption intsconfig.jsonto specify ES2022 as the target ECMAScript version.Example:
{ "compilerOptions": { "target": "ES2022", ///at line 14 ... }, ... } -
Change Module to NodeNext: Change the module option to specify NextNode as the module system.
Example:
{
"compilerOptions": {
...
"module": "NodeNext", // at line 28
...
},
...
}- 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
...
},
...
}- 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.
To publish your project on npm, follow these steps:
-
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 Configuration:
- 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",
...
}
- 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 loginFollow the prompts and enter your npm username, password, and email address or press enter to go on browser directly
- Ensure that your name is unique.
- 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- 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- 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.