posthog plus previews adress

This commit is contained in:
dimitar 2025-04-01 02:18:26 +02:00
parent 78c22ab7c2
commit 0e1b12a035
8 changed files with 981 additions and 453 deletions

View File

@ -56,6 +56,7 @@ export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) { configure(consumer: MiddlewareConsumer) {
const allowedOrigins = [ const allowedOrigins = [
"http://localhost:5173", "http://localhost:5173",
"http://localhost:4173",
"https://www.placebo.mk", "https://www.placebo.mk",
"https://placebo.mk", "https://placebo.mk",
"https://imkapi.oblak.solutions", "https://imkapi.oblak.solutions",

3
frontend/.env Normal file
View File

@ -0,0 +1,3 @@
VITE_API_URL=https://imkapi.oblak.solutions
REACT_APP_PUBLIC_POSTHOG_KEY=phc_dLQV3ZMDaqyRw0j71BcLwuKCq9CkmKxpKxj3pJwgX7x
REACT_APP_PUBLIC_POSTHOG_HOST=https://eu.i.posthog.com

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"framer-motion": "^11.18.2", "framer-motion": "^11.18.2",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"posthog-js": "^1.234.4",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-icons": "^5.5.0", "react-icons": "^5.5.0",
@ -35,6 +36,6 @@
"eslint-plugin-react-refresh": "^0.4.3", "eslint-plugin-react-refresh": "^0.4.3",
"postcss": "^8.4.47", "postcss": "^8.4.47",
"tailwindcss": "^3.4.14", "tailwindcss": "^3.4.14",
"vite": "^4.4.5" "vite": "^6.2.4"
} }
} }

View File

@ -0,0 +1,6 @@
export const config = {
apiUrl: "https://imkapi.oblak.solutions",
REACT_APP_PUBLIC_POSTHOG_KEY:
"phc_dLQV3ZMDaqyRw0j71BcLwuKCq9CkmKxpKxj3pJwgX7x",
REACT_APP_PUBLIC_POSTHOG_HOST: "https://eu.i.posthog.com",
};

View File

@ -1,10 +1,21 @@
import React from 'react' import { PostHogProvider } from "posthog-js/react";
import ReactDOM from 'react-dom/client' import React from "react";
import App from './App.jsx' import ReactDOM from "react-dom/client";
import './index.css' import App from "./App.jsx";
import { config } from "./config/env";
import "./index.css";
ReactDOM.createRoot(document.getElementById('root')).render( const options = {
api_host: config.REACT_APP_PUBLIC_POSTHOG_HOST,
};
ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode> <React.StrictMode>
<App /> <PostHogProvider
apiKey={config.REACT_APP_PUBLIC_POSTHOG_KEY}
options={options}
>
<App />
</PostHogProvider>
</React.StrictMode>, </React.StrictMode>,
) );

View File

@ -1,10 +1,6 @@
import axios from "axios"; import axios from "axios";
const API_URL = const API_URL = "https://imkapi.oblak.solutions";
// process.env.NODE_ENV === "production"
"https://imkapi.oblak.solutions";
// "http://localhost:3000";
const api = axios.create({ const api = axios.create({
baseURL: API_URL, baseURL: API_URL,
withCredentials: true, withCredentials: true,

View File

@ -1,4 +1,3 @@
// vite.config.js
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";