feat: whyrating - initial project from turbostarter boilerplate

This commit is contained in:
Alejandro Gutiérrez
2026-02-04 01:54:52 +01:00
commit 5cdc07cd39
1618 changed files with 338230 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import { defineConfig } from "@content-collections/core";
import { collections } from "./src/collections/api";
export default defineConfig({
collections,
});

View File

@@ -0,0 +1,3 @@
import baseConfig from "@turbostarter/eslint-config/base";
export default baseConfig;

36
packages/cms/package.json Normal file
View File

@@ -0,0 +1,36 @@
{
"name": "@turbostarter/cms",
"version": "0.1.0",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"build": "content-collections build",
"clean": "git clean -xdf .cache .turbo dist node_modules",
"dev": "content-collections watch",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit"
},
"prettier": "@turbostarter/prettier-config",
"dependencies": {
"@content-collections/core": "0.11.1",
"@turbostarter/shared": "workspace:*",
"reading-time": "1.5.0",
"zod": "catalog:"
},
"devDependencies": {
"@content-collections/cli": "0.1.7",
"@content-collections/mdx": "0.2.2",
"@shikijs/rehype": "3.14.0",
"@turbostarter/eslint-config": "workspace:*",
"@turbostarter/prettier-config": "workspace:*",
"@turbostarter/tsconfig": "workspace:*",
"concurrently": "9.2.1",
"eslint": "catalog:",
"prettier": "catalog:",
"typescript": "catalog:"
}
}

View File

@@ -0,0 +1,4 @@
import { blog } from "./blog";
import { legal } from "./legal";
export const collections = [legal, blog];

View File

@@ -0,0 +1,121 @@
---
title: Quick Tips to Improve Your Skills Right Away
description: Discover quick tips to enhance your skills, whether technical or personal. Learn goal-setting, consistent practice, and progress tracking using Markdown.
publishedAt: 2023-04-19
tags: [learning, skills, progress]
thumbnail: https://images.unsplash.com/photo-1483639130939-150975af84e5?q=80&w=2370&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
status: published
---
Learning something new can feel overwhelming, but a few key habits can help accelerate your progress. Whether you're improving a technical skill or working on personal development, these quick tips can push you forward immediately.
## 1. Break Down Your Goals
Focus on **small, manageable tasks**. Instead of aiming to master an entire skill at once, break it down into smaller parts:
- **Example**: Instead of "Learn Web Development," focus on "Understand basic HTML," "Learn CSS styling," and "Master JavaScript loops."
The more specific and granular your goals, the easier it will be to track progress and stay motivated.
```markdown
- [ ] Understand basic HTML
- [ ] Learn CSS styling
- [ ] Master JavaScript loops
```
By using checkboxes in Markdown, you can even create simple task lists to stay organized!
---
## 2. Practice Consistently
The fastest way to build a skill is through **consistent practice**. Even 15 minutes a day is enough to build momentum over time.
Here's an easy way to track your progress using Markdown:
```markdown
### Daily Practice Log
| Date | Time Spent | Topic |
| ---------- | ---------- | ---------------- |
| 2024-09-07 | 20 minutes | CSS Grid Layouts |
| 2024-09-08 | 30 minutes | JavaScript Loops |
| 2024-09-09 | 15 minutes | HTML Forms |
```
---
## 3. Learn by Teaching
One of the most effective ways to solidify your knowledge is by **teaching others**. Whether you're writing blog posts, mentoring, or even explaining concepts to a friend, teaching forces you to clarify your understanding.
You can start by creating a **cheat sheet** for the skill you're learning using Markdowns syntax for emphasis and organization:
````markdown
### JavaScript Cheat Sheet
#### Variables
```javascript
let x = 10; // block-scoped
const y = 20; // constant
```
#### Loops
```javascript
for (let i = 0; i < 5; i++) {
console.log(i);
}
```
````
---
## 4. Track Your Progress
Use version control, like **Git**, to track your coding progress or project development. Here's how you can get started with simple Git commands:
```bash
git init # Initialize a new Git repository
git add . # Add all files to staging area
git commit -m "Initial commit" # Commit changes
```
---
## 5. Stay Accountable
Find a community or an accountability partner to help keep you on track. You can use a simple Markdown checklist to track goals and share them with your peers:
```markdown
### Weekly Goals
- [ ] Finish 3 coding challenges
- [x] Watch 2 tutorial videos on Python
- [ ] Build a simple to-do list app
```
---
## 6. Reflect on What You've Learned
Take time to review your progress and document what you've learned. This reflection can happen weekly or monthly, and Markdown is an excellent way to keep a clean, organized journal.
```markdown
## Learning Journal
### September 7, 2024
- Learned how to create flexbox layouts in CSS.
- Solved two medium-level coding challenges in Python.
- Worked on understanding callback functions in JavaScript.
```
By reflecting on your progress, you'll notice how much you've grown and where you need to focus next.
---
## Conclusion
By breaking down your goals, practicing consistently, and using tools like Markdown to stay organized, you can improve your skills right away. Whether you're a coder, writer, or artist, these tips will help you move forward with clarity and purpose.

View File

@@ -0,0 +1,121 @@
---
title: Consejos Rápidos para Mejorar tus Habilidades de Inmediato
description: Descubre consejos rápidos para mejorar tus habilidades, ya sean técnicas o personales. Aprende a establecer objetivos, practicar de manera consistente y hacer seguimiento del progreso usando Markdown.
publishedAt: 2023-04-19
tags: [learning, skills, progress]
thumbnail: https://images.unsplash.com/photo-1483639130939-150975af84e5?q=80&w=2370&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
status: published
---
Aprender algo nuevo puede sentirse abrumador, pero algunos hábitos clave pueden ayudar a acelerar tu progreso. Ya sea que estés mejorando una habilidad técnica o trabajando en desarrollo personal, estos consejos rápidos pueden impulsarte hacia adelante inmediatamente.
## 1. Divide tus Objetivos
Enfócate en **tareas pequeñas y manejables**. En lugar de intentar dominar una habilidad completa de una vez, divídela en partes más pequeñas:
- **Ejemplo**: En lugar de "Aprender Desarrollo Web", enfócate en "Entender HTML básico", "Aprender estilos CSS" y "Dominar los bucles de JavaScript".
Mientras más específicos y granulares sean tus objetivos, será más fácil rastrear el progreso y mantenerte motivado.
```markdown
- [ ] Entender HTML básico
- [ ] Aprender estilos CSS
- [ ] Dominar los bucles de JavaScript
```
¡Usando casillas de verificación en Markdown, incluso puedes crear listas de tareas simples para mantenerte organizado!
---
## 2. Practica de Manera Consistente
La forma más rápida de desarrollar una habilidad es a través de la **práctica consistente**. Incluso 15 minutos al día es suficiente para generar impulso con el tiempo.
Aquí tienes una forma fácil de rastrear tu progreso usando Markdown:
```markdown
### Registro de Práctica Diaria
| Fecha | Tiempo Dedicado | Tema |
| ---------- | --------------- | -------------------- |
| 2024-09-07 | 20 minutos | Layouts CSS Grid |
| 2024-09-08 | 30 minutos | Bucles de JavaScript |
| 2024-09-09 | 15 minutos | Formularios HTML |
```
---
## 3. Aprende Enseñando
Una de las formas más efectivas de solidificar tu conocimiento es **enseñando a otros**. Ya sea escribiendo publicaciones de blog, siendo mentor, o incluso explicando conceptos a un amigo, enseñar te obliga a clarificar tu comprensión.
Puedes comenzar creando una **hoja de referencia** para la habilidad que estás aprendiendo usando la sintaxis de Markdown para énfasis y organización:
````markdown
### Hoja de Referencia de JavaScript
#### Variables
```javascript
let x = 10; // ámbito de bloque
const y = 20; // constante
```
#### Bucles
```javascript
for (let i = 0; i < 5; i++) {
console.log(i);
}
```
````
---
## 4. Rastrea tu Progreso
Usa control de versiones, como **Git**, para rastrear tu progreso en programación o desarrollo de proyectos. Aquí tienes cómo empezar con comandos simples de Git:
```bash
git init # Inicializar un nuevo repositorio Git
git add . # Agregar todos los archivos al área de preparación
git commit -m "Commit inicial" # Confirmar cambios
```
---
## 5. Mantente Responsable
Encuentra una comunidad o un compañero de responsabilidad para ayudarte a mantenerte en el camino. Puedes usar una simple lista de verificación en Markdown para rastrear objetivos y compartirlos con tus compañeros:
```markdown
### Objetivos Semanales
- [ ] Terminar 3 desafíos de programación
- [x] Ver 2 videos tutoriales sobre Python
- [ ] Construir una aplicación simple de lista de tareas
```
---
## 6. Reflexiona sobre lo que has Aprendido
Tómate tiempo para revisar tu progreso y documentar lo que has aprendido. Esta reflexión puede ocurrir semanal o mensualmente, y Markdown es una excelente manera de mantener un diario limpio y organizado.
```markdown
## Diario de Aprendizaje
### 7 de septiembre, 2024
- Aprendí cómo crear layouts flexbox en CSS.
- Resolví dos desafíos de programación de nivel medio en Python.
- Trabajé en entender las funciones callback en JavaScript.
```
Al reflexionar sobre tu progreso, notarás cuánto has crecido y dónde necesitas enfocarte después.
---
## Conclusión
Al dividir tus objetivos, practicar de manera consistente y usar herramientas como Markdown para mantenerte organizado, puedes mejorar tus habilidades de inmediato. Ya seas programador, escritor o artista, estos consejos te ayudarán a avanzar con claridad y propósito.

View File

@@ -0,0 +1,124 @@
---
title: Step-by-Step Guide to Building Your First Product
description: A beginner-friendly guide to building your first product, covering key steps from concept to launch. Learn how to define your vision, conduct research, prototype, and gather feedback.
publishedAt: 2024-09-01
tags: [product, development, prototype, launch]
thumbnail: https://images.unsplash.com/photo-1556228578-567ba127e37f?q=80&w=2351&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
status: published
---
**Building your first product** can seem like a daunting task, but breaking it down into smaller, more manageable steps makes the journey smoother. This guide will walk you through the essential steps to take your idea from concept to reality.
---
## Understanding Your Vision
Before diving into development, take a moment to **define your product's vision**. Ask yourself these questions:
- What problem does your product solve?
- Who is your target audience?
- What makes your product unique?
By clearly understanding your goals, you set a foundation for all the work that follows.
> **Tip**: Keep your vision simple at the start. You can always expand on it later.
---
## Research & Planning
Once you have a vision, its time to do some **research**. The more you know about your market and competitors, the better your product will be.
Here are a few research steps to follow:
- **Identify Competitors**: Find out what similar products exist.
- **Market Research**: Who are your potential customers?
- **Customer Pain Points**: What are the issues that your product will solve?
After gathering your research, create a **product roadmap**. This should include:
- A list of essential features
- A timeline for development
- Any necessary resources (e.g., tools, people, budget)
You might also want to explore the following resources:
- [Guide to Product Research](https://example.com/product-research)
- [How to Build a Product Roadmap](https://example.com/roadmap)
---
## Creating a Prototype
Once your planning is done, it's time to **build a prototype**. A prototype is a simplified version of your product that allows you to visualize and test your idea. At this stage, dont worry about perfection—focus on functionality.
### Steps to Create a Prototype
1. **Sketch Your Design**: Start with basic sketches to map out the user experience.
2. **Use Prototyping Tools**: Use tools like Figma, Adobe XD, or even pen and paper to bring your sketches to life.
3. **Build a Simple Model**: Depending on your product, this could be a physical model or a digital mockup.
---
## Testing & Feedback
Once you have a prototype, its time to **test it out**. Share your prototype with a small group of people who represent your target audience. Be open to **constructive feedback**—its an invaluable part of the process.
Heres how to get meaningful feedback:
- Create a short **survey** or **questionnaire**.
- **Observe** users interacting with the prototype.
- Ask for feedback on **ease of use**, **functionality**, and **design**.
**Remember**: Dont take feedback personally; it's there to help you improve your product!
---
## Iterating & Improving
After gathering feedback, it's time to **iterate and improve** your product. This is where the real magic happens! Focus on refining the most critical aspects first. Repeat the cycle of **test → feedback → iterate** until your product feels polished.
Heres a simple iteration loop:
1. **Analyze Feedback**: Identify patterns or recurring suggestions.
2. **Make Changes**: Adjust your product based on the feedback.
3. **Test Again**: Keep testing your updated prototype with users.
---
## Launching Your Product
Youve made it! Now, it's time to **launch your product**. Whether it's a soft launch or a full-scale release, here are a few steps to ensure a smooth launch:
1. **Create Buzz**: Use social media, email marketing, or even word-of-mouth to build excitement.
2. **Set Up Sales Channels**: If applicable, ensure your website, e-commerce platform, or storefront is ready to handle orders.
3. **Support & Feedback**: Make it easy for your customers to reach out with questions or issues.
---
## Whats Next?
Congratulations on launching your first product! But remember, the journey doesnt end here. Youll want to:
- **Continue gathering feedback** from real users.
- **Iterate on your product** based on market response.
- **Plan for future updates** and features.
> “The only way to do great work is to love what you do.” Steve Jobs
Now that you've successfully launched your product, you're on your way to even greater success. Take what you've learned and apply it to future projects.
---
## Final Thoughts
Building your first product is an **incredible journey**. By taking it step by step, youve turned a simple idea into something tangible. Keep pushing forward, and remember that every iteration brings you closer to a product that people will love!
Happy building! 🎉
---
### Additional Resources:
- [Best Practices for Product Development](https://example.com/product-development)
- [How to Conduct User Research](https://example.com/user-research)

View File

@@ -0,0 +1,124 @@
---
title: Guía Paso a Paso para Construir tu Primer Producto
description: Una guía amigable para principiantes sobre cómo construir tu primer producto, cubriendo pasos clave desde el concepto hasta el lanzamiento. Aprende a definir tu visión, realizar investigación, crear prototipos y recopilar comentarios.
publishedAt: 2024-09-01
tags: [product, development, prototype, launch]
thumbnail: https://images.unsplash.com/photo-1556228578-567ba127e37f?q=80&w=2351&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
status: published
---
**Construir tu primer producto** puede parecer una tarea desafiante, pero dividirlo en pasos más pequeños y manejables hace que el viaje sea más fluido. Esta guía te acompañará a través de los pasos esenciales para llevar tu idea del concepto a la realidad.
---
## Entendiendo tu Visión
Antes de sumergirte en el desarrollo, tómate un momento para **definir la visión de tu producto**. Hazte estas preguntas:
- ¿Qué problema resuelve tu producto?
- ¿Quién es tu audiencia objetivo?
- ¿Qué hace único a tu producto?
Al entender claramente tus objetivos, estableces una base para todo el trabajo que sigue.
> **Consejo**: Mantén tu visión simple al principio. Siempre puedes expandirla más tarde.
---
## Investigación y Planificación
Una vez que tengas una visión, es hora de hacer algo de **investigación**. Mientras más sepas sobre tu mercado y competidores, mejor será tu producto.
Aquí tienes algunos pasos de investigación a seguir:
- **Identificar Competidores**: Descubre qué productos similares existen.
- **Investigación de Mercado**: ¿Quiénes son tus clientes potenciales?
- **Puntos de Dolor del Cliente**: ¿Cuáles son los problemas que tu producto resolverá?
Después de recopilar tu investigación, crea una **hoja de ruta del producto**. Esta debería incluir:
- Una lista de características esenciales
- Un cronograma para el desarrollo
- Cualquier recurso necesario (ej., herramientas, personas, presupuesto)
También podrías querer explorar los siguientes recursos:
- [Guía para Investigación de Productos](https://example.com/product-research)
- [Cómo Construir una Hoja de Ruta de Producto](https://example.com/roadmap)
---
## Creando un Prototipo
Una vez que tu planificación esté lista, es hora de **construir un prototipo**. Un prototipo es una versión simplificada de tu producto que te permite visualizar y probar tu idea. En esta etapa, no te preocupes por la perfección—enfócate en la funcionalidad.
### Pasos para Crear un Prototipo
1. **Bosqueja tu Diseño**: Comienza con bosquejos básicos para mapear la experiencia del usuario.
2. **Usa Herramientas de Prototipado**: Utiliza herramientas como Figma, Adobe XD, o incluso lápiz y papel para dar vida a tus bosquejos.
3. **Construye un Modelo Simple**: Dependiendo de tu producto, esto podría ser un modelo físico o una maqueta digital.
---
## Pruebas y Comentarios
Una vez que tengas un prototipo, es hora de **probarlo**. Comparte tu prototipo con un pequeño grupo de personas que representen tu audiencia objetivo. Mantente abierto a **comentarios constructivos**—es una parte invaluable del proceso.
Aquí tienes cómo obtener comentarios significativos:
- Crea una **encuesta** o **cuestionario** corto.
- **Observa** a los usuarios interactuando con el prototipo.
- Pide comentarios sobre **facilidad de uso**, **funcionalidad** y **diseño**.
**Recuerda**: ¡No tomes los comentarios de manera personal; están ahí para ayudarte a mejorar tu producto!
---
## Iterando y Mejorando
Después de recopilar comentarios, es hora de **iterar y mejorar** tu producto. ¡Aquí es donde ocurre la verdadera magia! Enfócate en refinar los aspectos más críticos primero. Repite el ciclo de **probar → comentarios → iterar** hasta que tu producto se sienta pulido.
Aquí tienes un bucle de iteración simple:
1. **Analizar Comentarios**: Identifica patrones o sugerencias recurrentes.
2. **Hacer Cambios**: Ajusta tu producto basándote en los comentarios.
3. **Probar de Nuevo**: Continúa probando tu prototipo actualizado con usuarios.
---
## Lanzando tu Producto
¡Lo lograste! Ahora, es hora de **lanzar tu producto**. Ya sea un lanzamiento suave o una liberación a gran escala, aquí tienes algunos pasos para asegurar un lanzamiento fluido:
1. **Crear Expectación**: Usa redes sociales, marketing por email, o incluso el boca a boca para generar emoción.
2. **Configurar Canales de Venta**: Si aplica, asegúrate de que tu sitio web, plataforma de comercio electrónico, o tienda esté lista para manejar pedidos.
3. **Soporte y Comentarios**: Facilita que tus clientes se pongan en contacto con preguntas o problemas.
---
## ¿Qué Sigue?
¡Felicitaciones por lanzar tu primer producto! Pero recuerda, el viaje no termina aquí. Querrás:
- **Continuar recopilando comentarios** de usuarios reales.
- **Iterar en tu producto** basándote en la respuesta del mercado.
- **Planificar futuras actualizaciones** y características.
> "La única manera de hacer un gran trabajo es amar lo que haces." Steve Jobs
Ahora que has lanzado exitosamente tu producto, estás en camino hacia un éxito aún mayor. Toma lo que has aprendido y aplícalo a futuros proyectos.
---
## Pensamientos Finales
Construir tu primer producto es un **viaje increíble**. Al tomarlo paso a paso, has convertido una idea simple en algo tangible. Sigue empujando hacia adelante, y recuerda que cada iteración te acerca más a un producto que la gente amará.
¡Feliz construcción! 🎉
---
### Recursos Adicionales:
- [Mejores Prácticas para Desarrollo de Productos](https://example.com/product-development)
- [Cómo Realizar Investigación de Usuarios](https://example.com/user-research)

View File

@@ -0,0 +1,51 @@
import { defineCollection } from "@content-collections/core";
import { compileMDX } from "@content-collections/mdx";
import rehypeShiki from "@shikijs/rehype";
import readingTime from "reading-time";
import * as z from "zod";
import { ContentStatus, ContentTag } from "../../types";
import { getLastModifiedAt } from "../../utils";
export const blog = defineCollection({
name: "blog",
directory: "src/collections/blog/content",
include: "**/*.mdx",
schema: z.object({
title: z.string(),
description: z.string(),
thumbnail: z.string(),
publishedAt: z.coerce.date(),
tags: z.array(z.enum(ContentTag)),
status: z.enum(ContentStatus),
}),
transform: async (document, context) => {
const mdx = await compileMDX(context, document, {
rehypePlugins: [
[
rehypeShiki,
{
/* see https://shiki.matsu.io/themes for available themes */
theme: "one-dark-pro",
},
],
],
});
const lastModifiedAt = await context.cache(
document._meta.filePath,
getLastModifiedAt,
);
const timeToRead = readingTime(document.content).time;
return {
...document,
mdx,
lastModifiedAt,
timeToRead,
slug: document._meta.directory,
locale: document._meta.fileName.split(".")[0],
};
},
});

View File

@@ -0,0 +1,115 @@
import { SortOrder } from "@turbostarter/shared/constants";
import { allBlogs, allLegals } from "../../.content-collections/generated";
import { ContentStatus } from "../types";
import type {
ContentTag,
GetContentItemBySlug,
GetContentItems,
} from "../types";
export const CollectionType = {
LEGAL: "legal",
BLOG: "blog",
} as const;
export type CollectionType =
(typeof CollectionType)[keyof typeof CollectionType];
export const content = {
[CollectionType.LEGAL]: allLegals,
[CollectionType.BLOG]: allBlogs,
} as const;
export type ContentCollection = typeof content;
type ContentCollectionItem<T extends CollectionType> =
ContentCollection[T][number];
const hasTags = <T extends CollectionType>(
item: ContentCollectionItem<T>,
): item is ContentCollectionItem<T> & { tags: ContentTag[] } => {
return "tags" in item;
};
const sortItems = <T extends CollectionType>(
items: ContentCollectionItem<T>[],
sortBy: keyof ContentCollectionItem<T>,
sortOrder: SortOrder,
) => {
return items.sort((a, b) => {
const aValue = a[sortBy];
const bValue = b[sortBy];
if (!aValue || !bValue) {
return 0;
}
if (typeof aValue === "string" && typeof bValue === "string") {
return sortOrder === SortOrder.ASCENDING
? aValue.localeCompare(bValue)
: bValue.localeCompare(aValue);
}
if (typeof aValue === "number" && typeof bValue === "number") {
return sortOrder === SortOrder.ASCENDING
? aValue - bValue
: bValue - aValue;
}
if (aValue instanceof Date && bValue instanceof Date) {
return sortOrder === SortOrder.ASCENDING
? aValue.getTime() - bValue.getTime()
: bValue.getTime() - aValue.getTime();
}
return 0;
});
};
export const getContentItems: GetContentItems = ({
collection,
status = ContentStatus.PUBLISHED,
tags = [] as ContentTag[],
sortBy,
sortOrder = SortOrder.DESCENDING,
locale,
}) => {
const items = content[collection];
const itemsWithTags = items.filter(
(item) =>
!tags.length ||
!hasTags(item) ||
item.tags.some((tag) => tags.includes(tag)),
);
const itemsWithStatus = itemsWithTags.filter(
(item) => item.status === status,
);
const itemsWithLocale = itemsWithStatus.filter(
(item) => !locale || item.locale === locale,
);
const sortedItems = sortBy
? sortItems(itemsWithLocale, sortBy, sortOrder)
: itemsWithLocale;
return {
count: sortedItems.length,
items: sortedItems,
};
};
export const getContentItemBySlug: GetContentItemBySlug = ({
collection,
slug,
status = ContentStatus.PUBLISHED,
locale,
}) =>
content[collection].find(
(item) =>
item.slug === slug && item.status === status && item.locale === locale,
) ?? null;

View File

@@ -0,0 +1,16 @@
---
title: Cookie Policy
description: Our cookie policy explains how we use cookies and similar technologies to improve your experience on our website and services. Learn about the types of cookies we use and how you can manage them.
status: published
---
{/* 💡 You can use one of the following ChatGPT prompts to generate this 💡 */}
{/* 1 */}
{/* Write a cookie policy for a <your saas details>. Explain what cookies are, how they are used, and how users can manage them. */}
{/* 2 */}
{/* Create a comprehensive cookie policy for a <your saas details>. Explain the types of cookies used, their purpose, and how users can manage their cookie preferences. */}
{/* 3 */}
{/* Write a detailed cookie policy for a <your saas details>. Explain the different types of cookies used, their functions, and how users can control their cookie settings. */}

View File

@@ -0,0 +1,16 @@
---
title: Privacy Policy
description: Our privacy policy outlines how we collect, use, and protect your personal information when you use our website and services. Learn about your rights and our commitment to data security.
status: published
---
{/* 💡 You can use one of the following ChatGPT prompts to generate this 💡 */}
{/* 1 */}
{/* "Create a Privacy Policy page for a <your SaaS details>. Include a title and a description that explains the purpose of the policy. The policy should outline how personal information is collected, used, and protected when users interact with the website and services. Mention user rights and the commitment to data security." */}
{/* 2 */}
{/* "Write a Privacy Policy for a <your SaaS details>. The policy should detail how personal information is collected, used, and protected when users interact with the website and services. Include information about user rights and the commitment to data security. Make sure to provide a clear title and description for the policy." */}
{/* 3 */}
{/* "Draft a Privacy Policy for a <your SaaS details>. Explain how personal information is collected, used, and protected when users interact with the website and services. Include details about user rights and the commitment to data security. Provide a title and a description that clearly outlines the purpose of the policy." */}

View File

@@ -0,0 +1,16 @@
---
title: Terms and Conditions
description: Our terms and conditions outline the rules and regulations for the use of our website and services. Learn about your rights and obligations when you use our website and services.
status: published
---
{/* 💡 You can use one of the following ChatGPT prompts to generate this 💡 */}
{/* 1 */}
{/* Prepare a detailed terms and conditions document for a <your saas details>. Outline the terms of use, user responsibilities, and the rights of the service provider. */}
{/* 2 */}
{/* Create a comprehensive terms and conditions document for a <your saas details>. Include sections on user obligations, intellectual property rights, and dispute resolution. */}
{/* 3 */}
{/* Write a detailed terms and conditions document for a <your saas details>. Cover aspects like user conduct, data protection, and the termination of services. */}

View File

@@ -0,0 +1,32 @@
import { defineCollection } from "@content-collections/core";
import { compileMDX } from "@content-collections/mdx";
import * as z from "zod";
import { ContentStatus } from "../../types";
import { getLastModifiedAt } from "../../utils";
export const legal = defineCollection({
name: "legal",
directory: "src/collections/legal/content",
include: "**/*.mdx",
schema: z.object({
title: z.string(),
description: z.string(),
status: z.enum(ContentStatus),
}),
transform: async (document, context) => {
const mdx = await compileMDX(context, document);
const lastModifiedAt = await context.cache(
document._meta.filePath,
getLastModifiedAt,
);
return {
...document,
mdx,
lastModifiedAt,
slug: document._meta.directory,
locale: document._meta.fileName.split(".")[0],
};
},
});

View File

@@ -0,0 +1,2 @@
export * from "./types";
export * from "./collections";

View File

@@ -0,0 +1,44 @@
import type { CollectionType, ContentCollection } from "../collections";
import type { SortOrder } from "@turbostarter/shared/constants";
export const ContentStatus = {
DRAFT: "draft",
PUBLISHED: "published",
} as const;
export const ContentTag = {
LEARNING: "learning",
SKILLS: "skills",
PROGRESS: "progress",
PRODUCT: "product",
DEVELOPMENT: "development",
PROTOTYPE: "prototype",
LAUNCH: "launch",
} as const;
export type ContentStatus = (typeof ContentStatus)[keyof typeof ContentStatus];
export type ContentTag = (typeof ContentTag)[keyof typeof ContentTag];
type ContentCollectionItem<T extends CollectionType> =
ContentCollection[T][number];
export type GetContentItems = <T extends CollectionType>(args: {
collection: T;
status?: ContentStatus;
tags?: ContentCollectionItem<T> extends { tags: ContentTag[] }
? ContentTag[]
: never;
locale?: string;
sortBy?: keyof ContentCollectionItem<T>;
sortOrder?: SortOrder;
}) => {
count: number;
items: ContentCollectionItem<T>[];
};
export type GetContentItemBySlug = <T extends CollectionType>(args: {
collection: T;
slug: string;
status?: ContentStatus;
locale?: string;
}) => ContentCollectionItem<T> | null;

View File

@@ -0,0 +1,20 @@
import { exec } from "child_process";
import { promisify } from "util";
const execPromise = promisify(exec);
export const getLastModifiedAt = async (filePath: string) => {
try {
const { stdout } = await execPromise(
`git log -1 --format=%ai -- ${filePath}`,
);
if (stdout) {
return new Date(stdout.trim()).toISOString();
}
return new Date().toISOString();
} catch {
return new Date().toISOString();
}
};

View File

@@ -0,0 +1,10 @@
{
"extends": "@turbostarter/tsconfig/internal.json",
"compilerOptions": {
"paths": {
"content-collections": ["./.content-collections/generated"]
}
},
"include": ["*.ts", "src/**/*"],
"exclude": ["node_modules"]
}

15
packages/cms/turbo.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"tasks": {
"build": {
"outputs": [".content-collections/**"]
},
"lint": {
"dependsOn": ["build"]
},
"typecheck": {
"dependsOn": ["build"]
}
}
}