because I got bored of customising my CV for every job
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(client): configure proper routing for SPA

- Add historyApiFallback to Vite dev server configuration
- Add preview server configuration with historyApiFallback
- Create nginx.conf with try_files directive for client-side routing
- Update Dockerfile to use custom nginx configuration
- Fix page reload issues on client-side routes like /profile and /job-experience

This ensures that when users reload the page on any route, they get the correct page instead of a 404 error.

+29
+1
apps/client/Dockerfile
··· 6 6 FROM nginx:alpine AS runner 7 7 WORKDIR /usr/share/nginx/html 8 8 COPY --from=builder /app/apps/client/dist . 9 + COPY nginx.conf /etc/nginx/conf.d/default.conf 9 10 EXPOSE 80 10 11 CMD ["nginx", "-g", "daemon off;"] 11 12
+22
apps/client/nginx.conf
··· 1 + server { 2 + listen 80; 3 + server_name localhost; 4 + root /usr/share/nginx/html; 5 + index index.html; 6 + 7 + # Handle client-side routing 8 + location / { 9 + try_files $uri $uri/ /index.html; 10 + } 11 + 12 + # Cache static assets 13 + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { 14 + expires 1y; 15 + add_header Cache-Control "public, immutable"; 16 + } 17 + 18 + # Security headers 19 + add_header X-Frame-Options "SAMEORIGIN" always; 20 + add_header X-Content-Type-Options "nosniff" always; 21 + add_header X-XSS-Protection "1; mode=block" always; 22 + }
+6
apps/client/vite.config.ts
··· 7 7 server: { 8 8 port: 5173, 9 9 host: true, 10 + historyApiFallback: true, 11 + }, 12 + preview: { 13 + port: 5173, 14 + host: true, 15 + historyApiFallback: true, 10 16 }, 11 17 assetsInclude: ["**/*.graphql"], 12 18 resolve: {