Spaces

Configure content spaces for your application

Spaces represent one of the most powerful and flexible architectural concepts in NestSaaS. Each space functions as an independent content domain with its own articles, groups, categories, and tags, allowing you to organize different types of content within a single application.

The spaces configuration is a critical component that defines the structure and organization of your application's content sections. This configuration serves as the foundation for your content architecture.

During initialization, Prisma scripts utilize this configuration to seed the space data in your database, establishing the core content structure of your application.

Location

/config/spaces.ts

Key Components

Space Definition

Each space has the following structure:

interface Space {
  name: string       // Display name
  slug: string       // URL slug
  type: "directories" | "basic"  // Content type
  title: string      // Page title
  description: string // Description text
  options: object    // Additional options
}

Spaces Groups

// NestSaaS default spaces
export const spaces: Space[] = [
  {
    name: "Resource",
    slug: "resource",
    type: "directories",
    title: "Collected resources",
    description: "A collection of hand-picked tools and resources...",
    options: {},
  },
  // Additional spaces...
]
// You can define spaces for different use cases
// Example: indietion.com use this space config, A Products space with type `directories` for directory listing, and other spaces with type `basic` for articles contents
export const const spaces: Space[] = [
  {
    name: "Products",
    slug: "product",
    type: "directories",
    title: "Indie hackers products",
    description:
      "The products launched by indie hackers are turning their ideas into income.",
    options: {},
  },
  {
    name: "Tech",
    slug: "tech",
    type: "basic",
    title: "For Tech Founders",
    description:
      "Building a tech business? You don't have to go it alone as an entrepreneur. This is your definitive resource for accessing expert strategies and keeping up with the latest developments. Updated frequently.",
    options: {},
  },
  {
    name: "Creators",
    slug: "creators",
    type: "basic",
    title: "For Creators",
    description:
      "Trying to grow your influence in the creator economy? Leave the guesswork out of it. This is your definitive resource for accessing expert strategies and keeping up with the latest developments. Updated frequently.",
    options: {},
  },
  {
    name: "A.I.",
    slug: "ai",
    type: "basic",
    title: "Artificial Intelligence (A.I.)",
    description:
      "Dive into the world of artificial intelligence. Learn about its applications, latest advancements, and impact across various industries, and how it can transform your business.",
    options: {},
  },
  {
    name: "Lifestyle",
    slug: "lifestyle",
    type: "basic",
    title: "Lifestyle",
    description:
      "Interested in designing the best lifestyle for yourself as an entrepreneur? This is your definitive resource for productivity tips, self-care advice, insights on remote work and travel, and much more. Updated frequently.",
    options: {},
  },
  {
    name: "Money",
    slug: "money",
    type: "basic",
    title: "Money",
    description:
      "How are other entrepreneurs are doing financially? If that question interests you, you've come to the right place. This is your definitive resource for stories and breakdowns on how much money people are spending, earning, saving, and investing as they run their businesses, as well as the strategies that inform their financial decisions. Updated frequently.",
    options: {},
  },
]
 
export const defaultSpace: Space = spaces[0]

Usage

After configuring your spaces, you can add them to the navigation configuration in the site settings as needed.

Space Types

  • directories: Used for content that should be displayed in a directory format (like products, resources)
  • basic: Used for simpler content pages (like news, blog posts)

Customization

  • Add new spaces by extending the appropriate array
  • Ensure slug values are URL-friendly and unique
  • The first space in the combined array becomes the default space

On this page