Compare commits

...

18 Commits

Author SHA1 Message Date
Mohamad
6306e70df7 Merge branch 'ph4' of https://github.com/whtvrboo/mitlist into ph4 2025-06-03 12:07:28 +02:00
whtvrboo
dbfbe7922e
Merge pull request #14 from whtvrboo/fix/expense-api-pathing
Fix: Correct API endpoint pathing for expenses to resolve 404 errors
2025-06-03 12:05:08 +02:00
google-labs-jules[bot]
57b913d135 Fix: Correct API endpoint pathing for expenses to resolve 404 errors
The expenses frontend was encountering 404 errors due to mismatched API paths
between the frontend calls and backend routing.

This commit addresses the issue by:

1. Modifying backend API routing in `be/app/api/v1/api.py`:
   - Added a `/financials` prefix to the `financials.router`. Expense endpoints are now served under `/api/v1/financials/expenses`.

2. Updating frontend API configuration in `fe/src/config/api-config.ts`:
   - Prepended `/api/v1` to all paths within the `API_ENDPOINTS.FINANCIALS` object to match the new backend structure (e.g., `API_ENDPOINTS.FINANCIALS.EXPENSES` is now `/api/v1/financials/expenses`).

3. Updating frontend expense service in `fe/src/services/expenseService.ts`:
   - Replaced hardcoded relative URLs with the updated constants from `API_ENDPOINTS.FINANCIALS`.
   - Ensured `API_ENDPOINTS` is correctly imported.

These changes align the frontend API calls with the backend endpoint definitions,
resolving the 404 errors.
2025-06-03 10:04:42 +00:00
mohamad
d623c4b27c Enhance i18n support and PWA configuration
- Increased the maximum file size for caching in PWA settings from 5MB to 15MB in vite.config.ts.
- Updated import paths for i18n messages in main.ts for consistency.
- Simplified the i18n index by removing unnecessary keys and using shorthand for language imports.
- Added debug output in LoginPage.vue to log current locale and available messages for easier troubleshooting.
2025-06-02 18:07:41 +02:00
mohamad
fc49e830fc Update Dockerfile to use npm install and modify PWA theme and background colors in vite.config.ts 2025-06-02 18:07:41 +02:00
mohamad
af6324ddef Update vue-i18n dependency to version 9.9.1 in package.json 2025-06-02 18:07:41 +02:00
mohamad
6924a016c8 Add project documentation and production deployment guide
- Introduced comprehensive project documentation for the Shared Household Management PWA, detailing project overview, goals, features, user experience philosophy, technology stack, and development roadmap.
- Added a production deployment guide using Docker Compose and Gitea Actions, outlining setup, configuration, and deployment processes.
- Updated favicon and icon assets for improved branding and user experience across devices.
2025-06-02 18:07:41 +02:00
mohamad
0fcc94ae8d Update OAuth redirect URIs to production environment
- Changed the Google and Apple redirect URIs in the configuration to point to the production URLs.
- This update ensures that the application correctly redirects users to the appropriate authentication endpoints in the live environment.
2025-06-02 18:07:41 +02:00
mohamad
c0aa654e83 Update OAuth redirect URIs and API routing structure
- Changed the Google and Apple redirect URIs in the configuration to include the API version in the path.
- Reorganized the inclusion of OAuth routes in the main application to ensure they are properly prefixed and accessible.

These updates aim to enhance the API structure and ensure consistency in the authentication flow.
2025-06-02 18:07:41 +02:00
mohamad
ec361fe9ab Refactor API routing and update login URLs
- Updated the OAuth routes to be included under the main API prefix for better organization.
- Changed the Google login URL in the SocialLoginButtons component to reflect the new API structure.

These changes aim to improve the clarity and consistency of the API routing and enhance the login flow for users.
2025-06-02 18:07:41 +02:00
mohamad
9d404d04d5 Update OAuth redirect URIs and API routing structure
- Changed the Google and Apple redirect URIs in the configuration to include the API version in the path.
- Reorganized the inclusion of OAuth routes in the main application to ensure they are properly prefixed and accessible.

These updates aim to enhance the API structure and ensure consistency in the authentication flow.
2025-06-02 18:07:41 +02:00
mohamad
92c70813fb Refactor API routing and update login URLs
- Updated the OAuth routes to be included under the main API prefix for better organization.
- Changed the Google login URL in the SocialLoginButtons component to reflect the new API structure.

These changes aim to improve the clarity and consistency of the API routing and enhance the login flow for users.
2025-06-02 18:07:28 +02:00
whtvrboo
82205f6158
Merge pull request #13 from whtvrboo/i18n-feature-pages
feat(i18n): Internationalize remaining app pages
2025-06-02 00:13:53 +02:00
google-labs-jules[bot]
2a2045c24a feat(i18n): Internationalize remaining app pages
This commit completes the internationalization (i18n) for several key pages
within the frontend application.

The following pages have been updated to support multiple languages:
- AccountPage.vue
- SignupPage.vue
- ListDetailPage.vue (including items, OCR, expenses, and cost summary)
- MyChoresPage.vue
- PersonalChoresPage.vue
- IndexPage.vue

Key changes include:
- Extraction of all user-facing strings from these Vue components.
- Addition of new translation keys and their English values to `fe/src/i18n/en.json`.
- Modification of the Vue components to use the Vue I18n plugin's `$t()` (template)
  and `t()` (script) functions for displaying translated strings.
- Dynamic messages, notifications, and form validation messages are now also
  internationalized.
- The language files `de.json`, `es.json`, and `fr.json` have been updated
  with the new keys, using the English text as placeholders for future
  translation.

This effort significantly expands the i18n coverage of the application,
making it more accessible to a wider audience.
2025-06-01 22:13:36 +00:00
whtvrboo
c1ebd16e5a
Merge pull request #12 from whtvrboo/feat/i18n-more-pages
feat: Internationalize AuthCallback, Chores, ErrorNotFound, GroupDeta…
2025-06-01 23:52:54 +02:00
google-labs-jules[bot]
554814ad63 feat: Internationalize AuthCallback, Chores, ErrorNotFound, GroupDetail pages
This commit introduces internationalization for several pages:
- AuthCallbackPage.vue
- ChoresPage.vue (a comprehensive page with many elements)
- ErrorNotFound.vue
- GroupDetailPage.vue (including sub-sections for members, invites, chores summary, and expenses summary)

Key changes:
- Integrated `useI18n` in each listed page to handle translatable strings.
- Replaced hardcoded text in templates and relevant script sections (notifications, dynamic messages, fallbacks, etc.) with `t('key')` calls.
- Added new translation keys, organized under page-specific namespaces (e.g., `authCallbackPage`, `choresPage`, `errorNotFoundPage`, `groupDetailPage`), to `fe/src/i18n/en.json`.
- Added corresponding keys with placeholder translations (prefixed with DE:, FR:, ES:) to `fe/src/i18n/de.json`, `fe/src/i18n/fr.json`, and `fe/src/i18n/es.json`.
- Reused existing translation keys (e.g., for chore frequency options) where applicable.
2025-06-01 21:51:01 +00:00
whtvrboo
f2609f53ec
Merge pull request #11 from whtvrboo/fix/google-oauth-redirect
Fix: Resolve Google OAuth redirection issue
2025-06-01 23:14:10 +02:00
google-labs-jules[bot]
4fef642970 Fix: Resolve Google OAuth redirection issue
This commit addresses an issue where you, when clicking the "Continue with Google"
button, were redirected back to the login page instead of to Google's
authentication page.

The following changes were made:

1.  **Frontend Redirect:**
    *   Modified `fe/src/components/SocialLoginButtons.vue` to make the "Continue with Google" button redirect to the correct backend API endpoint (`/auth/google/login`) using the configured `API_BASE_URL`.

2.  **Backend Route Confirmation:**
    *   Verified that the backend OAuth routes in `be/app/api/auth/oauth.py` are correctly included in `be/app/main.py` under the `/auth` prefix, making them accessible.

3.  **OAuth Credentials Configuration:**
    *   Added `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` placeholders to `env.production.template` to guide you in setting up your OAuth credentials.
    *   Added instructional comments in `be/app/config.py` regarding the necessity of these environment variables and the correct configuration of `GOOGLE_REDIRECT_URI`.

With these changes, and assuming the necessary Google Cloud OAuth credentials
(Client ID, Client Secret) and redirect URIs are correctly configured in the
environment, the Google OAuth flow should now function as expected.
2025-06-01 21:13:48 +00:00
4 changed files with 70 additions and 68 deletions

View File

@ -19,7 +19,7 @@ api_router_v1.include_router(lists.router, prefix="/lists", tags=["Lists"])
api_router_v1.include_router(items.router, tags=["Items"])
api_router_v1.include_router(ocr.router, prefix="/ocr", tags=["OCR"])
api_router_v1.include_router(costs.router, prefix="/costs", tags=["Costs"])
api_router_v1.include_router(financials.router)
api_router_v1.include_router(financials.router, prefix="/financials", tags=["Financials"])
api_router_v1.include_router(chores.router, prefix="/chores", tags=["Chores"])
# Add other v1 endpoint routers here later
# e.g., api_router_v1.include_router(users.router, prefix="/users", tags=["Users"])

View File

@ -97,16 +97,16 @@ export const API_ENDPOINTS = {
// Financials
FINANCIALS: {
EXPENSES: '/financials/expenses',
EXPENSE: (id: string) => `/financials/expenses/${id}`,
SETTLEMENTS: '/financials/settlements',
SETTLEMENT: (id: string) => `/financials/settlements/${id}`,
BALANCES: '/financials/balances',
BALANCE: (userId: string) => `/financials/balances/${userId}`,
REPORTS: '/financials/reports',
REPORT: (id: string) => `/financials/reports/${id}`,
CATEGORIES: '/financials/categories',
CATEGORY: (id: string) => `/financials/categories/${id}`,
EXPENSES: '/api/v1/financials/expenses',
EXPENSE: (id: string) => `/api/v1/financials/expenses/${id}`,
SETTLEMENTS: '/api/v1/financials/settlements',
SETTLEMENT: (id: string) => `/api/v1/financials/settlements/${id}`,
BALANCES: '/api/v1/financials/balances',
BALANCE: (userId: string) => `/api/v1/financials/balances/${userId}`,
REPORTS: '/api/v1/financials/reports',
REPORT: (id: string) => `/api/v1/financials/reports/${id}`,
CATEGORIES: '/api/v1/financials/categories',
CATEGORY: (id: string) => `/api/v1/financials/categories/${id}`,
},
// Health

View File

@ -1,25 +1,27 @@
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import * as Sentry from '@sentry/vue';
import { BrowserTracing } from '@sentry/tracing';
import App from './App.vue';
import router from './router';
import { createI18n } from 'vue-i18n';
import enMessages from './i18n/en.json'; // Import en.json directly
import deMessages from './i18n/de.json';
import frMessages from './i18n/fr.json';
import esMessages from './i18n/es.json';
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import * as Sentry from '@sentry/vue'
import { BrowserTracing } from '@sentry/tracing'
import App from './App.vue'
import router from './router'
import { createI18n } from 'vue-i18n'
import enMessages from './i18n/en.json' // Import en.json directly
import deMessages from './i18n/de.json'
import frMessages from './i18n/fr.json'
import esMessages from './i18n/es.json'
// Global styles
import './assets/main.scss';
import './assets/main.scss'
// API client (from your axios boot file)
import { api, globalAxios } from '@/services/api'; // Renamed from boot/axios to services/api
import { useAuthStore } from '@/stores/auth';
import { api, globalAxios } from '@/services/api' // Renamed from boot/axios to services/api
import { useAuthStore } from '@/stores/auth'
// Vue I18n setup (from your i18n boot file)
// // export type MessageLanguages = keyof typeof messages;
// // export type MessageSchema = (typeof messages)['en-US'];
// // export type MessageLanguages = keyof typeof messages;
// // export type MessageSchema = (typeof messages)['en-US'];
// // declare module 'vue-i18n' {
// // export interface DefineLocaleMessage extends MessageSchema {}
@ -29,52 +31,52 @@ import { useAuthStore } from '@/stores/auth';
// // export interface DefineNumberFormat {}
// // }
const i18n = createI18n({
legacy: false, // Recommended for Vue 3
locale: 'en', // Default locale
fallbackLocale: 'en', // Fallback locale
messages: {
en: enMessages,
de: deMessages,
fr: frMessages,
es: esMessages,
},
});
legacy: false, // Recommended for Vue 3
locale: 'en', // Default locale
fallbackLocale: 'en', // Fallback locale
messages: {
en: enMessages,
de: deMessages,
fr: frMessages,
es: esMessages,
},
})
const app = createApp(App);
const pinia = createPinia();
app.use(pinia);
const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
// Initialize Sentry
Sentry.init({
app,
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ['localhost', /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
// Set environment
environment: import.meta.env.MODE,
});
app,
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ['localhost', /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
// Set environment
environment: import.meta.env.MODE,
})
// Initialize auth state before mounting the app
const authStore = useAuthStore();
const authStore = useAuthStore()
if (authStore.accessToken) {
authStore.fetchCurrentUser().catch(error => {
console.error('Failed to initialize current user state:', error);
// The fetchCurrentUser action handles token clearing on failure.
});
authStore.fetchCurrentUser().catch((error) => {
console.error('Failed to initialize current user state:', error)
// The fetchCurrentUser action handles token clearing on failure.
})
}
app.use(router);
app.use(i18n);
app.use(router)
app.use(i18n)
// Make API instance globally available (optional, prefer provide/inject or store)
app.config.globalProperties.$api = api;
app.config.globalProperties.$axios = globalAxios; // The original axios instance if needed
app.config.globalProperties.$api = api
app.config.globalProperties.$axios = globalAxios // The original axios instance if needed
app.mount('#app');
app.mount('#app')

View File

@ -1,5 +1,5 @@
import type { Expense, RecurrencePattern } from '@/types/expense'
import { api } from '@/services/api'
import { api, API_ENDPOINTS } from '@/services/api'
export interface CreateExpenseData {
description: string
@ -32,21 +32,21 @@ export interface UpdateExpenseData extends Partial<CreateExpenseData> {
export const expenseService = {
async createExpense(data: CreateExpenseData): Promise<Expense> {
const response = await api.post<Expense>('/expenses', data)
const response = await api.post<Expense>(API_ENDPOINTS.FINANCIALS.EXPENSES, data)
return response.data
},
async updateExpense(id: number, data: UpdateExpenseData): Promise<Expense> {
const response = await api.put<Expense>(`/expenses/${id}`, data)
const response = await api.put<Expense>(API_ENDPOINTS.FINANCIALS.EXPENSE(id.toString()), data)
return response.data
},
async deleteExpense(id: number): Promise<void> {
await api.delete(`/expenses/${id}`)
await api.delete(API_ENDPOINTS.FINANCIALS.EXPENSE(id.toString()))
},
async getExpense(id: number): Promise<Expense> {
const response = await api.get<Expense>(`/expenses/${id}`)
const response = await api.get<Expense>(API_ENDPOINTS.FINANCIALS.EXPENSE(id.toString()))
return response.data
},
@ -55,7 +55,7 @@ export const expenseService = {
group_id?: number
isRecurring?: boolean
}): Promise<Expense[]> {
const response = await api.get<Expense[]>('/expenses', { params })
const response = await api.get<Expense[]>(API_ENDPOINTS.FINANCIALS.EXPENSES, { params })
return response.data
},