Proje Yapısı ve CLI
CLI kullanarak yeni bir NestJS projesi başlatmayı, varsayılan klasör yapısını anlamayı ve bileşenleri verimli biçimde oluşturmayı öğrenin.
Proje Yapısı ve CLI, CoddyKit'te ücretsiz bir NestJS Enterprise Backend APIs dersidir. Bu, 3 dersinin 2. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, NestJS Enterprise Backend APIs öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. NestJS Enterprise Backend APIs kursu toplamda 3 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
NestJS CLI: Your Development Ally
The NestJS CLI is your dev assistant — it scaffolds projects, generates boilerplate for modules and services, and runs your builds.
Get the CLI Up and Running
Install the CLI globally with npm i -g @nestjs/cli (Node and npm required first). The -g flag makes the nest command available everywhere.
Starting a New NestJS App
Create a project with nest new my-first-backend. The CLI asks for a package manager, then sets up files, dependencies, and boilerplate.
Understanding the Project Layout
A new project's layout: src/ holds your code, node_modules/ the dependencies, test/ e2e tests, and dist/ the compiled output.
Core Application Files in `src`
Inside src/ are the core files: main.ts bootstraps the app, app.module.ts is the root module, plus a starter controller and service.
`main.ts`: Application Entry Point
main.ts is the entry point: NestFactory.create() builds the app and app.listen() starts the server, usually on port 3000.
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
console.log(`Application is running on: ${await app.getUrl()}`);
}
bootstrap();Building Blocks: A Simple Class
NestJS runs on classes — controllers, services, and modules are all TypeScript classes. This runnable snippet shows the basic class structure.
class Greeter {
name: string;
constructor(name: string) {
this.name = name;
}
greet(): string {
return `Hello, ${this.name}! Welcome to CoddyKit.`;
}
}
// This is the entry point for running the example
function main() {
const greeter = new Greeter("NestJS Learner");
console.log(greeter.greet());
}
main();Streamline with `nest generate`
As the app grows, use nest generate (or nest g) to scaffold modules, controllers, services, guards, pipes — and auto-wire them in.
CLI in Action: New Module
For a Users feature, run nest g module users. The CLI creates the folder and users.module.ts, then registers it in your root AppModule.
Test Your CLI Knowledge
You've learned about the NestJS CLI and how it helps set up and structure your project.
Which CLI command is used to quickly create a new NestJS project named my-api?
Summary: CLI & Project Setup
You used the CLI: installed it, created a project with nest new, explored the layout, and scaffolded components with nest generate.
Sıkça Sorulan Sorular
“Proje Yapısı ve CLI” dersi ücretsiz mi?
Evet — “Proje Yapısı ve CLI” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve NestJS Enterprise Backend APIs kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. NestJS Enterprise Backend APIs kursu toplamda 3 dersten oluşur.
“Proje Yapısı ve CLI” dersinde ne öğreneceğim?
CLI kullanarak yeni bir NestJS projesi başlatmayı, varsayılan klasör yapısını anlamayı ve bileşenleri verimli biçimde oluşturmayı öğrenin. NestJS Enterprise Backend APIs ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
NestJS Enterprise Backend APIs öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te NestJS Enterprise Backend APIs, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 3 dersinin 2. dersidir.
“Proje Yapısı ve CLI” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu NestJS Enterprise Backend APIs dersinde kod yazıp çalıştırabilir miyim?
Evet. Her NestJS Enterprise Backend APIs dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- NestJS Çerçevesine Giriş
- Proje Yapısı ve CLI
- Modüller, Denetleyiciler ve Hizmetler