npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@larussoft/backend

v0.5.0

Published

Larussoft NestJS backend iskelet paketi — hazır admin, CMS ve e-ticaret API endpoint'leri

Downloads

69

Readme

@larussoft/backend

NestJS tabanli backend iskelet paketi. Hazir admin paneli, CMS ve e-ticaret API endpoint'leri ile birlikte gelir. Tum is mantigi @larussoft/core paketinden saglanir; bu paket yalnizca API katmanini icerir.

Kurulum

npm install @larussoft/core @larussoft/backend

Hizli Baslangic

main.ts

import { bootstrap } from '@larussoft/backend'
import { AppModule } from './app.module'

bootstrap(AppModule, {
  port: parseInt(process.env.PORT || '4000'),
  cors: { origin: ['http://localhost:3000'] },
  swagger: { title: 'My API', version: '1.0' },
})

app.module.ts

import { Module } from '@nestjs/common'
import { BackendModule } from '@larussoft/backend'
import { AdminModule } from '@larussoft/backend/admin'
import { CmsModule } from '@larussoft/backend/cms'
import { CommerceModule } from '@larussoft/backend/commerce'

@Module({
  imports: [
    BackendModule.forRoot({
      database: {
        host: process.env.DB_HOST || 'localhost',
        port: parseInt(process.env.DB_PORT || '5432'),
        database: process.env.DB_NAME!,
        username: process.env.DB_USERNAME || 'postgres',
        password: process.env.DB_PASSWORD || '',
      },
      auth: {
        jwt: { secret: process.env.JWT_SECRET! },
        loginWith: 'email',
      },
      logger: { appName: 'myapp' },
    }),
    AdminModule.forRoot({ userEntity: User }),
    CmsModule,
    CommerceModule,
  ],
})
export class AppModule {}

Konfiguration

IBackendConfig

BackendModule.forRoot() asagidaki ayarlari kabul eder:

| Alan | Aciklama | Zorunlu | |---|---|---| | database | PostgreSQL baglanti bilgileri (host, port, database, username, password) | Evet | | database.entities | Proje ozel entity'ler (orn. [Salon, Appointment]) | Hayir | | auth | Kimlik dogrulama ayarlari | Evet | | auth.jwt.secret | JWT imzalama anahtari | Evet | | auth.loginWith | Giris yontemi: 'email' veya 'phone' | Evet | | logger | Log ayarlari | Hayir | | logger.appName | Uygulama adi (loglarda kullanilir) | Hayir | | storage | Dosya depolama ayarlari (S3, local vb.) | Hayir | | notification | Bildirim ayarlari (email, SMS) | Hayir |

Bootstrap Secenekleri

bootstrap() fonksiyonunun ikinci parametresi:

| Secenek | Varsayilan | Aciklama | |---|---|---| | port | 4000 | Sunucu portu | | cors | — | CORS ayarlari (origin, methods vb.) | | swagger | — | Swagger/OpenAPI ayarlari (title, version) | | helmet | Aktif | Helmet guvenlik basliklarini yapilandirir | | globalPrefix | — | Tum endpoint'lere ortak prefix ekler (orn. /api) |

Moduller

AdminModule

Admin paneli endpoint'leri. AdminModule.forRoot({ userEntity: User }) ile aktif edilir.

POST   /auth/login
POST   /auth/register
POST   /auth/refresh
POST   /auth/logout

GET    /admin/users
GET    /admin/users/:id
POST   /admin/users
PATCH  /admin/users/:id
DELETE /admin/users/:id

GET    /admin/roles
POST   /admin/roles
PATCH  /admin/roles/:id

GET    /admin/logs/system
GET    /admin/logs/audit
GET    /admin/logs/export

GET    /admin/files
POST   /admin/files/upload
DELETE /admin/files/:id

GET    /admin/settings
PATCH  /admin/settings

GET    /admin/dashboard

CmsModule

Icerik yonetim sistemi endpoint'leri. CmsModule import edilerek aktif edilir.

GET|POST|PATCH|DELETE  /admin/pages
GET|POST|PATCH|DELETE  /admin/menus
GET|POST|PATCH|DELETE  /admin/categories
GET|POST|PATCH|DELETE  /admin/tags
GET|POST|DELETE        /admin/media

CommerceModule

E-ticaret endpoint'leri. CommerceModule import edilerek aktif edilir.

GET|POST|PATCH|DELETE  /admin/products
GET|POST|PATCH|DELETE  /admin/orders
GET|POST|PATCH|DELETE  /admin/customers
GET|POST|PATCH|DELETE  /admin/discounts

Proje Ozel Modul Ekleme

Proje ozel moduller standart NestJS modulleri olarak yazilir ve AppModule'e eklenir:

// src/salons/salon.module.ts
import { Module } from '@nestjs/common'
import { TypeOrmModule } from '@nestjs/typeorm'
import { Salon } from './salon.entity'
import { SalonsController } from './salons.controller'
import { SalonsService } from './salons.service'

@Module({
  imports: [TypeOrmModule.forFeature([Salon])],
  controllers: [SalonsController],
  providers: [SalonsService],
})
export class SalonModule {}
// app.module.ts
@Module({
  imports: [
    BackendModule.forRoot({
      database: {
        host: process.env.DB_HOST || 'localhost',
        port: parseInt(process.env.DB_PORT || '5432'),
        database: process.env.DB_NAME!,
        username: process.env.DB_USERNAME || 'postgres',
        password: process.env.DB_PASSWORD || '',
        entities: [Salon], // proje ozel entity'ler buraya eklenir
      },
      auth: {
        jwt: { secret: process.env.JWT_SECRET! },
        loginWith: 'email',
      },
    }),
    AdminModule.forRoot({ userEntity: User }),
    SalonModule,
  ],
})
export class AppModule {}

Proje ozel servisler @larussoft/core servislerini inject edebilir:

import { StorageService } from '@larussoft/core/storage'
import { LoggerService } from '@larussoft/core/logger'

Veritabani

  • Uygulama basladiginda tablolar otomatik olusturulur (TypeORM synchronize).
  • Tum ID alanlari bigint tipindedir.
  • Metin alanlari icin kisa degerler varchar, uzun degerler text kullanilir.

Entity Listesi

Setting

| Kolon | Tip | |---|---| | id | bigint | | key | varchar(100) | | value | text |

Page

| Kolon | Tip | |---|---| | id | bigint | | title | varchar(255) | | slug | varchar(255) | | content | text | | status | varchar(20) |

Menu

| Kolon | Tip | |---|---| | id | bigint | | name | varchar(100) | | slug | varchar(100) | | position | int |

MenuItem

| Kolon | Tip | |---|---| | id | bigint | | menuId | bigint | | title | varchar(255) | | url | varchar(500) | | target | varchar(20) |

Category

| Kolon | Tip | |---|---| | id | bigint | | name | varchar(100) | | slug | varchar(100) | | description | text | | parentId | bigint |

Tag

| Kolon | Tip | |---|---| | id | bigint | | name | varchar(50) | | slug | varchar(50) |

Product

| Kolon | Tip | |---|---| | id | bigint | | name | varchar(255) | | slug | varchar(255) | | description | text | | price | bigint | | stock | int |

Order

| Kolon | Tip | |---|---| | id | bigint | | customerId | bigint | | status | varchar(20) | | total | bigint | | note | text |

OrderItem

| Kolon | Tip | |---|---| | id | bigint | | orderId | bigint | | productId | bigint | | name | varchar(255) | | quantity | int | | unitPrice | bigint | | total | bigint |

Customer

| Kolon | Tip | |---|---| | id | bigint | | name | varchar(100) | | email | varchar(255) | | phone | varchar(20) | | address | text |

Discount

| Kolon | Tip | |---|---| | id | bigint | | code | varchar(50) | | type | varchar(20) | | value | int | | minOrderAmount | bigint | | maxUses | int |

Teknoloji

| | Secim | |---|---| | Framework | NestJS | | Dil | TypeScript (strict mode) | | ORM | TypeORM | | Veritabani | PostgreSQL 16 | | Validation | class-validator + class-transformer | | Guvenlik | Helmet, throttler |

Versiyon Geçmişi

Tüm değişiklikler CHANGELOG.md dosyasında belgelenmiştir.

Lisans

MIT