commit
79a004ea9b
|
|
@ -1,3 +1,4 @@
|
||||||
|
import React from "react";
|
||||||
import { Switch, Route } from "wouter";
|
import { Switch, Route } from "wouter";
|
||||||
import { queryClient } from "./lib/queryClient";
|
import { queryClient } from "./lib/queryClient";
|
||||||
import { QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClientProvider } from "@tanstack/react-query";
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,17 @@ import { ClassCard } from "./class-card";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { Class } from "@/lib/schema";
|
import { Class } from "@/lib/schema";
|
||||||
import { Skeleton } from "@/components/ui/skeleton";
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
|
import { apiRequest } from "@/lib/queryClient";
|
||||||
import FadiaClassImage from "../../assets/Fadia-156.jpg";
|
import FadiaClassImage from "../../assets/Fadia-156.jpg";
|
||||||
|
|
||||||
|
|
||||||
export function ClassesSection() {
|
export function ClassesSection() {
|
||||||
const { data: classes, isLoading, error } = useQuery<Class[]>({
|
const { data: classes, isLoading, error } = useQuery<Class[]>({
|
||||||
queryKey: ["/api/classes"],
|
queryKey: ["/api/classes"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const res = await apiRequest("GET", "/api/classes");
|
||||||
|
return await res.json();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,11 @@
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
* {
|
* {
|
||||||
@apply border-border;
|
@apply border-gray-200;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@apply font-sans antialiased bg-background text-foreground;
|
@apply font-sans antialiased bg-white text-gray-900;
|
||||||
font-family: 'Khula', sans-serif;
|
font-family: 'Khula', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,11 @@ export const getQueryFn: <T>(options: {
|
||||||
export const queryClient = new QueryClient({
|
export const queryClient = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
queries: {
|
queries: {
|
||||||
queryFn: getQueryFn({ on401: "throw" }),
|
retry: false,
|
||||||
refetchInterval: false,
|
refetchInterval: false,
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
staleTime: Infinity,
|
staleTime: Infinity,
|
||||||
retry: false,
|
gcTime: 5 * 60 * 1000, // 5 minutes
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
retry: false,
|
retry: false,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import React from "react";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
import type { Config } from "tailwindcss";
|
import type { Config } from "tailwindcss";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
darkMode: ["class"],
|
darkMode: ["class"],
|
||||||
content: ["./client/index.html", "./client/src/**/*.{js,jsx,ts,tsx}"],
|
content: [
|
||||||
|
path.resolve(__dirname, "index.html"),
|
||||||
|
path.resolve(__dirname, "src/**/*.{js,jsx,ts,tsx}")
|
||||||
|
],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {
|
extend: {
|
||||||
borderRadius: {
|
borderRadius: {
|
||||||
|
|
@ -92,5 +96,5 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")],
|
plugins: [require("tailwindcss-animate")],
|
||||||
} satisfies Config;
|
} satisfies Config;
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
import { defineConfig } from "vite";
|
||||||
|
import react from "@vitejs/plugin-react";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
react(),
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(__dirname, "src"),
|
||||||
|
"@shared": path.resolve(__dirname, "../shared"),
|
||||||
|
"@assets": path.resolve(__dirname, "../attached_assets"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
outDir: "dist",
|
||||||
|
emptyOutDir: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -5,8 +5,8 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_ENV=development tsx server/index.ts",
|
"dev": "NODE_ENV=development tsx server/index.ts",
|
||||||
"build": "npm run build:client",
|
"build": "cd client && npm install && npm run build",
|
||||||
"build:client": "cd client && vite build",
|
"build:client": "cd client && npm run build",
|
||||||
"build:server": "esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist",
|
"build:server": "esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist",
|
||||||
"start": "NODE_ENV=production node dist/index.js",
|
"start": "NODE_ENV=production node dist/index.js",
|
||||||
"check": "tsc"
|
"check": "tsc"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { createServer as createViteServer, createLogger } from "vite";
|
import { createServer as createViteServer, createLogger } from "vite";
|
||||||
import { type Server } from "http";
|
import { type Server } from "http";
|
||||||
import viteConfig from "../vite.config";
|
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
|
|
||||||
const viteLogger = createLogger();
|
const viteLogger = createLogger();
|
||||||
|
|
@ -20,15 +19,23 @@ export function log(message: string, source = "express") {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setupVite(app: Express, server: Server) {
|
export async function setupVite(app: Express, server: Server) {
|
||||||
const serverOptions = {
|
|
||||||
middlewareMode: true,
|
|
||||||
hmr: { server },
|
|
||||||
allowedHosts: true as true,
|
|
||||||
};
|
|
||||||
|
|
||||||
const vite = await createViteServer({
|
const vite = await createViteServer({
|
||||||
...viteConfig,
|
|
||||||
configFile: false,
|
configFile: false,
|
||||||
|
root: path.resolve(import.meta.dirname, "..", "client"),
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(import.meta.dirname, "..", "client", "src"),
|
||||||
|
"@shared": path.resolve(import.meta.dirname, "..", "shared"),
|
||||||
|
"@assets": path.resolve(import.meta.dirname, "..", "attached_assets"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
hmr: false,
|
||||||
|
middlewareMode: true
|
||||||
|
},
|
||||||
|
optimizeDeps: {
|
||||||
|
exclude: ['@vite/client']
|
||||||
|
},
|
||||||
customLogger: {
|
customLogger: {
|
||||||
...viteLogger,
|
...viteLogger,
|
||||||
error: (msg, options) => {
|
error: (msg, options) => {
|
||||||
|
|
@ -36,7 +43,6 @@ export async function setupVite(app: Express, server: Server) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: serverOptions,
|
|
||||||
appType: "custom",
|
appType: "custom",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"version": 2,
|
"version": 2,
|
||||||
"buildCommand": "npm run build",
|
"buildCommand": "cd client && npm install && npm run build",
|
||||||
|
"outputDirectory": "client/dist",
|
||||||
"builds": [
|
"builds": [
|
||||||
{
|
{
|
||||||
"src": "server/index.ts",
|
"src": "server/index.ts",
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
import { defineConfig } from "vite";
|
|
||||||
import react from "@vitejs/plugin-react";
|
|
||||||
import path from "path";
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [
|
|
||||||
react(),
|
|
||||||
],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
"@": path.resolve(import.meta.dirname, "client", "src"),
|
|
||||||
"@shared": path.resolve(import.meta.dirname, "shared"),
|
|
||||||
"@assets": path.resolve(import.meta.dirname, "attached_assets"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
root: path.resolve(import.meta.dirname, "client"),
|
|
||||||
build: {
|
|
||||||
outDir: path.resolve(import.meta.dirname, "client", "dist"),
|
|
||||||
emptyOutDir: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Loading…
Reference in New Issue