Skip to content

Modern Docker Management, Designed for Everyone

chore: enable hot reloading for backend

Kyle Mendelld0b8f672f38e
diff --git a/backend/.air.toml b/backend/.air.toml
new file mode 100644
index 000000000..c9e6fcdae
--- /dev/null
+++ b/backend/.air.toml
@@ -0,0 +1,11 @@
+root = "."
+tmp_dir = ".bin"
+
+[build]
+ bin = "./.bin/arcane"
+ cmd = "CGO_ENABLED=1 go build -o ./.bin/arcane ./cmd"
+ exclude_dir = [".bin", "data"]
+ stop_on_error = true
+
+[misc]
+ clean_on_exit = true
\ No newline at end of file
diff --git a/docs/docs/development/contributing.md b/docs/docs/development/contributing.md
index 0287ce13e..e4211a443 100644
--- a/docs/docs/development/contributing.md
+++ b/docs/docs/development/contributing.md
@@ -35,9 +35,24 @@ Thank you for your interest in contributing to Arcane! We welcome contributions
4. **Set Up Development Environment:** Follow the instructions in the [**Building from Source**](./building.md) guide to set up your development environment:
- ```bash
- ./build.sh
- ```
+### Backend
+
+For the backend you can use `air` for hot reloading for quick development:
+
+```bash
+go install github.com/air-verse/air@latest
+```
+
+Then just run `air` in arcane/backend folder.
+
+### Frontend
+
+The frontend uses vite for development:
+
+```bash
+cd frontend
+npm run dev
+```
5. **Make Changes:** Implement your feature or bug fix. Write clear, concise code.
diff --git a/frontend/src/lib/stores/client-init.ts b/frontend/src/lib/stores/client-init.ts
deleted file mode 100644
index 1cb8fdcaf..000000000
--- a/frontend/src/lib/stores/client-init.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { browser } from '$app/environment';
-import settingsStore from './config-store';
-import { goto } from '$app/navigation';
-import { settingsAPI } from '$lib/services/api';
-
-let isInitialized = false;
-
-export async function initializeClientStores() {
- if (!browser || isInitialized) {
- return;
- }
-
- try {
- const settings = await settingsAPI.getSettings();
- settingsStore.set(settings);
- console.log('Settings store initialized successfully');
- isInitialized = true;
- } catch (error) {
- console.error('Failed to initialize client stores:', error);
-
- if (error instanceof Error && error.message.includes('401')) {
- goto('/auth/login');
- }
- }
-}
-
-export async function checkAuthStatus(): Promise<boolean> {
- if (!browser) {
- return false;
- }
-
- try {
- const response = await fetch('/api/auth/me', {
- credentials: 'include'
- });
-
- return response.ok;
- } catch (error) {
- console.error('Authentication check failed:', error);
- return false;
- }
-}
-
-if (browser) {
- initializeClientStores();
-}