Fix today race condition (#75)

* Move frontend to root

* Fix backend issues

* Remove old routes

* Setup Dockerfile

* Fix today /tags multiplt requests issue

* Fix race condition on today's inbox widget

* Fix cors development issue

* Fix CORS for Dockerfile

* Fix dockerised settings for infinite loop

* Fix translation issues

* fixup! Fix translation issues

---------

Co-authored-by: Your Name <you@example.com>
This commit is contained in:
Chris 2025-06-13 14:20:24 +03:00 committed by GitHub
parent 9b1e465b83
commit f9b21dff0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
106 changed files with 2435 additions and 1451 deletions

View file

@ -1,37 +1,44 @@
const path = require('path');
const webpack = require('webpack');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const isDevelopment = process.env.NODE_ENV !== 'production';
// Force development mode for hot reloading
process.env.NODE_ENV = 'development';
module.exports = {
entry: './app/frontend/index.tsx',
entry: './frontend/index.tsx',
output: {
path: path.resolve(__dirname, 'public/js'),
filename: 'bundle.js',
publicPath: '/js/',
path: path.resolve(__dirname, 'dist'),
filename: '[name].[contenthash].js',
publicPath: '/',
clean: true
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
devServer: {
static: [
{
directory: path.join(__dirname, 'public'),
publicPath: '/'
},
{
directory: path.join(__dirname),
publicPath: '/'
}
],
hot: true,
watchFiles: ['app/frontend/**/*'],
static: {
directory: path.join(__dirname, 'public'),
},
hot: isDevelopment,
watchFiles: isDevelopment ? ['frontend/**/*'] : [],
port: 8080,
host: '0.0.0.0',
historyApiFallback: true,
proxy: [{
context: ['/api', '/locales'],
target: 'http://localhost:9292',
changeOrigin: true,
secure: false,
cookieDomainRewrite: 'localhost',
headers: {
'Access-Control-Allow-Origin': '*'
},
onProxyRes: function(proxyRes, req, res) {
proxyRes.headers['Access-Control-Allow-Origin'] = 'http://localhost:8080';
proxyRes.headers['Access-Control-Allow-Credentials'] = 'true';
}
}],
// Add middleware to log requests for translation files to help with debugging
setupMiddlewares: (middlewares, devServer) => {
if (!devServer) {
@ -48,7 +55,12 @@ module.exports = {
},
plugins: [
isDevelopment && new ReactRefreshWebpackPlugin(),
new webpack.HotModuleReplacementPlugin(),
isDevelopment && new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
title: 'Tududi',
filename: 'index.html',
template: 'public/index.html'
}),
].filter(Boolean),
module: {
rules: [