Update dashboard community links to use env vars, add deploy configs

- Dashboard community links now use .env values like community page
- Removed hardcoded social media URLs from dashboard
- Added deploy folder with nginx and systemd service configs
- Moved linktree page to public route
- Various backend and auth context updates
This commit is contained in:
root
2026-01-29 20:59:25 +00:00
parent 651a10dc9c
commit 0190a0497c
11 changed files with 302 additions and 49 deletions

View File

@@ -2,6 +2,8 @@
import React, { createContext, useContext, useState, useEffect, ReactNode, useCallback } from 'react';
const API_BASE = process.env.NEXT_PUBLIC_API_URL || '';
interface User {
id: string;
email: string;
@@ -66,7 +68,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
}, []);
const login = async (email: string, password: string) => {
const res = await fetch('/api/auth/login', {
const res = await fetch(`${API_BASE}/api/auth/login`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password }),
@@ -82,7 +84,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
};
const loginWithGoogle = async (credential: string) => {
const res = await fetch('/api/auth/google', {
const res = await fetch(`${API_BASE}/api/auth/google`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ credential }),
@@ -98,7 +100,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
};
const loginWithMagicLink = async (magicToken: string) => {
const res = await fetch('/api/auth/magic-link/verify', {
const res = await fetch(`${API_BASE}/api/auth/magic-link/verify`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ token: magicToken }),
@@ -114,7 +116,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
};
const register = async (registerData: RegisterData) => {
const res = await fetch('/api/auth/register', {
const res = await fetch(`${API_BASE}/api/auth/register`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(registerData),