Feature/Use fastify instead of express (#1)

- Replaced Apollo Server with Mercurius for GraphQL API
- Updated resolvers to use Mercurius-compatible GraphQL implementation
- Migrated from Express to Fastify for server framework
- Improved error handling with GraphQL error extensions
- Added Zod for environment variable validation
- Updated Prisma schema and migrations
- Configured CORS and WebSocket subscriptions
- Simplified GraphQL schema and resolver structure
- Enhanced type safety and code organization
- Replaced Apollo Server with Mercurius for GraphQL API
- Updated resolvers to use Mercurius-compatible GraphQL implementation
- Migrated from Express to Fastify for server framework
- Improved error handling with GraphQL error extensions
- Added Zod for environment variable validation
- Updated Prisma schema and migrations
- Configured CORS and WebSocket subscriptions
- Simplified GraphQL schema and resolver structure
- Enhanced type safety and code organization

Reviewed-on: #1
Co-authored-by: Jusemon <juansmm@outlook.com>
Co-committed-by: Jusemon <juansmm@outlook.com>
This commit is contained in:
Juan Sebastián Montoya 2025-03-06 19:15:56 -05:00 committed by Juan Sebastián Montoya
parent b4e5a04126
commit 6214b503bc
47 changed files with 4968 additions and 5424 deletions

View file

@ -1,4 +1,4 @@
import { config } from "@repo/eslint-config/react-internal";
import { config } from '@repo/eslint-config/solid-js';
/** @type {import("eslint").Linter.Config} */
export default config;

View file

@ -14,14 +14,9 @@
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"@turbo/gen": "^2.4.4",
"@types/node": "^22.13.9",
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
"eslint": "^9.21.0",
"typescript": "5.8.2"
"eslint": "^9.21.0"
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
"solid-js": "^1.9.5"
}
}

View file

@ -1,9 +1,9 @@
"use client";
'use client';
import { ReactNode } from "react";
import { JSX } from 'solid-js/jsx-runtime';
interface ButtonProps {
children: ReactNode;
children: JSX.Element;
className?: string;
appName: string;
}
@ -11,7 +11,7 @@ interface ButtonProps {
export const Button = ({ children, className, appName }: ButtonProps) => {
return (
<button
className={className}
class={className}
onClick={() => alert(`Hello from your ${appName} app!`)}
>
{children}

View file

@ -1,4 +1,4 @@
import { type JSX } from "react";
import { type JSX } from 'solid-js/jsx-runtime';
export function Card({
className,
@ -8,15 +8,15 @@ export function Card({
}: {
className?: string;
title: string;
children: React.ReactNode;
children: JSX.Element;
href: string;
}): JSX.Element {
return (
<a
className={className}
class={className}
href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`}
rel="noopener noreferrer"
target="_blank"
rel='noopener noreferrer'
target='_blank'
>
<h2>
{title} <span>-&gt;</span>

View file

@ -1,11 +1,11 @@
import { type JSX } from "react";
import { type JSX } from 'solid-js/jsx-runtime';
export function Code({
children,
className,
}: {
children: React.ReactNode;
children: JSX.Element;
className?: string;
}): JSX.Element {
return <code className={className}>{children}</code>;
return <code class={className}>{children}</code>;
}

View file

@ -1,8 +1,7 @@
{
"extends": "@repo/typescript-config/react-library.json",
"extends": "@repo/typescript-config/solid.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
"include": ["src"]
}

View file

@ -1,27 +1,27 @@
import type { PlopTypes } from "@turbo/gen";
import type { PlopTypes } from '@turbo/gen';
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
export default function generator(plop: PlopTypes.NodePlopAPI): void {
// A simple generator to add a new React component to the internal UI library
plop.setGenerator("react-component", {
description: "Adds a new react component",
plop.setGenerator('solid-component', {
description: 'Adds a new solid component',
prompts: [
{
type: "input",
name: "name",
message: "What is the name of the component?",
type: 'input',
name: 'name',
message: 'What is the name of the component?',
},
],
actions: [
{
type: "add",
path: "src/{{kebabCase name}}.tsx",
templateFile: "templates/component.hbs",
type: 'add',
path: 'src/{{kebabCase name}}.tsx',
templateFile: 'templates/component.hbs',
},
{
type: "append",
path: "package.json",
type: 'append',
path: 'package.json',
pattern: /"exports": {(?<insertion>)/g,
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
},

View file

@ -1,4 +1,4 @@
export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => {
export const {{ pascalCase name }} = ({ children }: { children: JSX.Element }) => {
return (
<div>
<h1>{{ pascalCase name }} Component</h1>