Changeset 8c01a1f


Ignore:
Timestamp:
02/10/26 18:31:21 (5 months ago)
Author:
Andrej <asumanovski@…>
Branches:
master
Children:
6fa5831
Parents:
ff01f66
Message:

Made investing tab and adding assets, starting training tracking and adding training sessions

Files:
50 added
9 edited

Legend:

Unmodified
Added
Removed
  • backend/pom.xml

    rff01f66 r8c01a1f  
    5151            <groupId>org.springframework.boot</groupId>
    5252            <artifactId>spring-boot-starter-webmvc</artifactId>
     53        </dependency>
     54
     55        <dependency>
     56            <groupId>com.fasterxml.jackson.core</groupId>
     57            <artifactId>jackson-databind</artifactId>
    5358        </dependency>
    5459        <dependency>
  • backend/src/main/java/com/trekr/backend/config/SecurityConfig.java

    rff01f66 r8c01a1f  
    11package com.trekr.backend.config;
    22
     3import com.trekr.backend.security.JwtAuthenticationFilter;
    34import org.springframework.context.annotation.Bean;
    45import org.springframework.context.annotation.Configuration;
     
    78import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
    89import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
     10import org.springframework.security.config.http.SessionCreationPolicy;
    911import org.springframework.security.crypto.password.PasswordEncoder;
    1012import org.springframework.security.web.SecurityFilterChain;
     13import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
    1114import org.springframework.web.cors.CorsConfiguration;
    1215import org.springframework.web.cors.CorsConfigurationSource;
     
    1922public class SecurityConfig {
    2023
     24    private final JwtAuthenticationFilter jwtAuthenticationFilter;
     25
     26    public SecurityConfig(JwtAuthenticationFilter jwtAuthenticationFilter) {
     27        this.jwtAuthenticationFilter = jwtAuthenticationFilter;
     28    }
     29
    2130    @Bean
    2231    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
     
    2433                .csrf(AbstractHttpConfigurer::disable)
    2534                .cors(Customizer.withDefaults())
     35                .sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
     36                .httpBasic(AbstractHttpConfigurer::disable)
     37                .formLogin(AbstractHttpConfigurer::disable)
    2638                .authorizeHttpRequests(auth -> auth
    2739                        .requestMatchers("/api/auth/**").permitAll()
    2840                        .anyRequest().authenticated());
     41
     42        http.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
    2943        return http.build();
    3044    }
  • backend/src/main/java/com/trekr/backend/security/UserPrincipal.java

    rff01f66 r8c01a1f  
    11package com.trekr.backend.security;
    2 
    3 import lombok.Getter;
    42
    53import java.io.Serializable;
     
    97 * Controllers can inject this or get it from SecurityContextHolder.
    108 */
    11 @Getter
    129public class UserPrincipal implements Serializable {
    1310    private static final long serialVersionUID = 1L;
     
    2219        this.email = email;
    2320    }
     21
     22    public Long getUserId() {
     23        return userId;
     24    }
     25
     26    public String getUsername() {
     27        return username;
     28    }
     29
     30    public String getEmail() {
     31        return email;
     32    }
    2433}
  • backend/src/main/java/com/trekr/backend/service/JwtService.java

    rff01f66 r8c01a1f  
    11package com.trekr.backend.service;
    22
     3import com.trekr.backend.security.UserPrincipal;
    34import io.jsonwebtoken.Jwts;
     5import io.jsonwebtoken.JwtException;
     6import io.jsonwebtoken.Claims;
    47import io.jsonwebtoken.security.Keys;
    58import org.springframework.beans.factory.annotation.Value;
     
    3437                .compact();
    3538    }
     39
     40    public boolean isTokenValid(String token) {
     41        try {
     42            parseClaims(token);
     43            return true;
     44        } catch (JwtException | IllegalArgumentException ex) {
     45            return false;
     46        }
     47    }
     48
     49    public UserPrincipal parseUserPrincipal(String token) {
     50        Claims claims = parseClaims(token);
     51        Long userId = Long.valueOf(claims.getSubject());
     52        String username = (String) claims.get("username");
     53        String email = (String) claims.get("email");
     54        return new UserPrincipal(userId, username, email);
     55    }
     56
     57    private Claims parseClaims(String token) {
     58        return Jwts.parser()
     59                .verifyWith(signingKey)
     60                .build()
     61                .parseSignedClaims(token)
     62                .getPayload();
     63    }
    3664}
  • frontend/.gitignore

    rff01f66 r8c01a1f  
    1212dist-ssr
    1313*.local
     14.env.local
    1415
    1516# Editor directories and files
  • frontend/package-lock.json

    rff01f66 r8c01a1f  
    1616        "react": "^19.2.0",
    1717        "react-dom": "^19.2.0",
     18        "react-icons": "^5.5.0",
    1819        "react-router-dom": "^7.13.0"
    1920      },
     
    343344        "ppc64"
    344345      ],
     346      "dev": true,
    345347      "license": "MIT",
    346348      "optional": true,
     
    359361        "arm"
    360362      ],
     363      "dev": true,
    361364      "license": "MIT",
    362365      "optional": true,
     
    375378        "arm64"
    376379      ],
     380      "dev": true,
    377381      "license": "MIT",
    378382      "optional": true,
     
    391395        "x64"
    392396      ],
     397      "dev": true,
    393398      "license": "MIT",
    394399      "optional": true,
     
    407412        "arm64"
    408413      ],
     414      "dev": true,
    409415      "license": "MIT",
    410416      "optional": true,
     
    423429        "x64"
    424430      ],
     431      "dev": true,
    425432      "license": "MIT",
    426433      "optional": true,
     
    439446        "arm64"
    440447      ],
     448      "dev": true,
    441449      "license": "MIT",
    442450      "optional": true,
     
    455463        "x64"
    456464      ],
     465      "dev": true,
    457466      "license": "MIT",
    458467      "optional": true,
     
    471480        "arm"
    472481      ],
     482      "dev": true,
    473483      "license": "MIT",
    474484      "optional": true,
     
    487497        "arm64"
    488498      ],
     499      "dev": true,
    489500      "license": "MIT",
    490501      "optional": true,
     
    503514        "ia32"
    504515      ],
     516      "dev": true,
    505517      "license": "MIT",
    506518      "optional": true,
     
    519531        "loong64"
    520532      ],
     533      "dev": true,
    521534      "license": "MIT",
    522535      "optional": true,
     
    535548        "mips64el"
    536549      ],
     550      "dev": true,
    537551      "license": "MIT",
    538552      "optional": true,
     
    551565        "ppc64"
    552566      ],
     567      "dev": true,
    553568      "license": "MIT",
    554569      "optional": true,
     
    567582        "riscv64"
    568583      ],
     584      "dev": true,
    569585      "license": "MIT",
    570586      "optional": true,
     
    583599        "s390x"
    584600      ],
     601      "dev": true,
    585602      "license": "MIT",
    586603      "optional": true,
     
    599616        "x64"
    600617      ],
     618      "dev": true,
    601619      "license": "MIT",
    602620      "optional": true,
     
    615633        "arm64"
    616634      ],
     635      "dev": true,
    617636      "license": "MIT",
    618637      "optional": true,
     
    631650        "x64"
    632651      ],
     652      "dev": true,
    633653      "license": "MIT",
    634654      "optional": true,
     
    647667        "arm64"
    648668      ],
     669      "dev": true,
    649670      "license": "MIT",
    650671      "optional": true,
     
    663684        "x64"
    664685      ],
     686      "dev": true,
    665687      "license": "MIT",
    666688      "optional": true,
     
    679701        "arm64"
    680702      ],
     703      "dev": true,
    681704      "license": "MIT",
    682705      "optional": true,
     
    695718        "x64"
    696719      ],
     720      "dev": true,
    697721      "license": "MIT",
    698722      "optional": true,
     
    711735        "arm64"
    712736      ],
     737      "dev": true,
    713738      "license": "MIT",
    714739      "optional": true,
     
    727752        "ia32"
    728753      ],
     754      "dev": true,
    729755      "license": "MIT",
    730756      "optional": true,
     
    743769        "x64"
    744770      ],
     771      "dev": true,
    745772      "license": "MIT",
    746773      "optional": true,
     
    48054832      }
    48064833    },
     4834    "node_modules/@relume_io/relume-ui/node_modules/react-icons": {
     4835      "version": "5.4.0",
     4836      "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.4.0.tgz",
     4837      "integrity": "sha512-7eltJxgVt7X64oHh6wSWNwwbKTCtMfK35hcjvJS0yxEAhPM8oUKdS3+kqaW1vicIltw+kR2unHaa12S9pPALoQ==",
     4838      "license": "MIT",
     4839      "peerDependencies": {
     4840        "react": "*"
     4841      }
     4842    },
    48074843    "node_modules/@relume_io/relume-ui/node_modules/zod": {
    48084844      "version": "3.25.76",
     
    48284864        "arm"
    48294865      ],
     4866      "dev": true,
    48304867      "license": "MIT",
    48314868      "optional": true,
     
    48414878        "arm64"
    48424879      ],
     4880      "dev": true,
    48434881      "license": "MIT",
    48444882      "optional": true,
     
    48544892        "arm64"
    48554893      ],
     4894      "dev": true,
    48564895      "license": "MIT",
    48574896      "optional": true,
     
    48674906        "x64"
    48684907      ],
     4908      "dev": true,
    48694909      "license": "MIT",
    48704910      "optional": true,
     
    48804920        "arm64"
    48814921      ],
     4922      "dev": true,
    48824923      "license": "MIT",
    48834924      "optional": true,
     
    48934934        "x64"
    48944935      ],
     4936      "dev": true,
    48954937      "license": "MIT",
    48964938      "optional": true,
     
    49064948        "arm"
    49074949      ],
     4950      "dev": true,
    49084951      "license": "MIT",
    49094952      "optional": true,
     
    49194962        "arm"
    49204963      ],
     4964      "dev": true,
    49214965      "license": "MIT",
    49224966      "optional": true,
     
    49324976        "arm64"
    49334977      ],
     4978      "dev": true,
    49344979      "license": "MIT",
    49354980      "optional": true,
     
    49454990        "arm64"
    49464991      ],
     4992      "dev": true,
    49474993      "license": "MIT",
    49484994      "optional": true,
     
    49585004        "loong64"
    49595005      ],
     5006      "dev": true,
    49605007      "license": "MIT",
    49615008      "optional": true,
     
    49715018        "loong64"
    49725019      ],
     5020      "dev": true,
    49735021      "license": "MIT",
    49745022      "optional": true,
     
    49845032        "ppc64"
    49855033      ],
     5034      "dev": true,
    49865035      "license": "MIT",
    49875036      "optional": true,
     
    49975046        "ppc64"
    49985047      ],
     5048      "dev": true,
    49995049      "license": "MIT",
    50005050      "optional": true,
     
    50105060        "riscv64"
    50115061      ],
     5062      "dev": true,
    50125063      "license": "MIT",
    50135064      "optional": true,
     
    50235074        "riscv64"
    50245075      ],
     5076      "dev": true,
    50255077      "license": "MIT",
    50265078      "optional": true,
     
    50365088        "s390x"
    50375089      ],
     5090      "dev": true,
    50385091      "license": "MIT",
    50395092      "optional": true,
     
    50495102        "x64"
    50505103      ],
     5104      "dev": true,
    50515105      "license": "MIT",
    50525106      "optional": true,
     
    50625116        "x64"
    50635117      ],
     5118      "dev": true,
    50645119      "license": "MIT",
    50655120      "optional": true,
     
    50755130        "x64"
    50765131      ],
     5132      "dev": true,
    50775133      "license": "MIT",
    50785134      "optional": true,
     
    50885144        "arm64"
    50895145      ],
     5146      "dev": true,
    50905147      "license": "MIT",
    50915148      "optional": true,
     
    51015158        "arm64"
    51025159      ],
     5160      "dev": true,
    51035161      "license": "MIT",
    51045162      "optional": true,
     
    51145172        "ia32"
    51155173      ],
     5174      "dev": true,
    51165175      "license": "MIT",
    51175176      "optional": true,
     
    51275186        "x64"
    51285187      ],
     5188      "dev": true,
    51295189      "license": "MIT",
    51305190      "optional": true,
     
    51405200        "x64"
    51415201      ],
     5202      "dev": true,
    51425203      "license": "MIT",
    51435204      "optional": true,
     
    55005561      "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
    55015562      "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
     5563      "dev": true,
    55025564      "license": "MIT"
    55035565    },
     
    55135575      "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.13.tgz",
    55145576      "integrity": "sha512-KkiJeU6VbYbUOp5ITMIc7kBfqlYkKA5KhEHVrGMmUUMt7NeaZg65ojdPk+FtNrBAOXNVM5QM72jnADjM+XVRAQ==",
    5515       "devOptional": true,
     5577      "dev": true,
    55165578      "license": "MIT",
    55175579      "dependencies": {
     
    55235585      "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",
    55245586      "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
    5525       "devOptional": true,
     5587      "dev": true,
    55265588      "license": "MIT",
    55275589      "peerDependencies": {
     
    55945656      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
    55955657      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
     5658      "dev": true,
    55965659      "license": "MIT",
    55975660      "dependencies": {
     
    56825745      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
    56835746      "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
     5747      "dev": true,
    56845748      "license": "MIT"
    56855749    },
     
    56985762      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
    56995763      "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
     5764      "dev": true,
    57005765      "license": "MIT",
    57015766      "dependencies": {
     
    57865851      "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
    57875852      "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
     5853      "dev": true,
    57885854      "license": "MIT",
    57895855      "dependencies": {
     
    58235889      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
    58245890      "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
     5891      "dev": true,
    58255892      "license": "MIT",
    58265893      "dependencies": {
     
    58355902      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
    58365903      "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
     5904      "dev": true,
    58375905      "license": "MIT"
    58385906    },
     
    58535921      "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
    58545922      "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
     5923      "dev": true,
    58555924      "license": "MIT"
    58565925    },
     
    59065975      "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
    59075976      "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
    5908       "devOptional": true,
     5977      "dev": true,
    59095978      "license": "MIT"
    59105979    },
     
    60946163      "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
    60956164      "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
     6165      "dev": true,
    60966166      "hasInstallScript": true,
    60976167      "license": "MIT",
     
    63636433      "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
    63646434      "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
     6435      "dev": true,
    63656436      "license": "MIT",
    63666437      "engines": {
     
    65086579      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
    65096580      "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
     6581      "dev": true,
    65106582      "hasInstallScript": true,
    65116583      "license": "MIT",
     
    66316703      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
    66326704      "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
     6705      "dev": true,
    66336706      "license": "MIT",
    66346707      "engines": {
     
    67656838      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
    67666839      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
     6840      "dev": true,
    67676841      "license": "ISC"
    67686842    },
     
    72127286      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
    72137287      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
     7288      "dev": true,
    72147289      "license": "ISC",
    72157290      "dependencies": {
     
    72497324      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
    72507325      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
     7326      "dev": true,
    72517327      "license": "MIT"
    72527328    },
     
    72557331      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
    72567332      "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
     7333      "dev": true,
    72577334      "funding": [
    72587335        {
     
    93069383      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
    93079384      "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
     9385      "dev": true,
    93089386      "license": "ISC"
    93099387    },
     
    93129390      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
    93139391      "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
     9392      "dev": true,
    93149393      "license": "MIT",
    93159394      "engines": {
     
    93249403      "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
    93259404      "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
     9405      "dev": true,
    93269406      "funding": [
    93279407        {
     
    94539533    },
    94549534    "node_modules/react-icons": {
    9455       "version": "5.4.0",
    9456       "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.4.0.tgz",
    9457       "integrity": "sha512-7eltJxgVt7X64oHh6wSWNwwbKTCtMfK35hcjvJS0yxEAhPM8oUKdS3+kqaW1vicIltw+kR2unHaa12S9pPALoQ==",
     9535      "version": "5.5.0",
     9536      "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz",
     9537      "integrity": "sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==",
    94589538      "license": "MIT",
    94599539      "peerDependencies": {
     
    96029682      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz",
    96039683      "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==",
     9684      "dev": true,
    96049685      "license": "MIT",
    96059686      "dependencies": {
     
    96529733      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
    96539734      "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
     9735      "dev": true,
    96549736      "license": "ISC",
    96559737      "bin": {
     
    97129794      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
    97139795      "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
     9796      "dev": true,
    97149797      "license": "MIT",
    97159798      "dependencies": {
     
    97629845      "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
    97639846      "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
     9847      "dev": true,
    97649848      "license": "MIT",
    97659849      "dependencies": {
     
    98879971      "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",
    98889972      "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
     9973      "dev": true,
    98899974      "license": "MIT",
    98909975      "dependencies": {
     
    996110046      "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
    996210047      "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
     10048      "dev": true,
    996310049      "license": "ISC",
    996410050      "dependencies": {
  • frontend/package.json

    rff01f66 r8c01a1f  
    1818    "react": "^19.2.0",
    1919    "react-dom": "^19.2.0",
     20    "react-icons": "^5.5.0",
    2021    "react-router-dom": "^7.13.0"
    2122  },
  • frontend/src/App.jsx

    rff01f66 r8c01a1f  
    44import Login from "./pages/Login/Login.jsx";
    55import Register from "./pages/Register/Register.jsx";
    6 import Dashboard from "./pages/Dashboard.jsx";
     6import DashboardLayout from "./pages/Dashboard/DashboardLayout.jsx";
     7import ControlCenter from "./pages/Dashboard/pages/ControlCenter/ControlCenter.jsx";
     8import Training from "./pages/Dashboard/pages/Training/Training.jsx";
     9import TrainingTracking from "./pages/Dashboard/pages/Training/TrainingTracking.jsx";
     10import NewTrainingSession from "./pages/Dashboard/pages/Training/NewTrainingSession.jsx";
     11import Weight from "./pages/Dashboard/pages/Weight/Weight.jsx";
     12import Finance from "./pages/Dashboard/pages/Finance/Finance.jsx";
     13import Investing from "./pages/Dashboard/pages/Investing/Investing.jsx";
     14import InvestingTracking from "./pages/Dashboard/pages/Investing/InvestingTracking.jsx";
     15import NewInvestment from "./pages/Dashboard/pages/Investing/NewInvestment.jsx";
     16import Discipline from "./pages/Dashboard/pages/Discipline/Discipline.jsx";
    717
    818function RequireAuth({ children }) {
     
    2333          element={
    2434            <RequireAuth>
    25               <Dashboard />
     35              <DashboardLayout />
    2636            </RequireAuth>
    2737          }
    28         />
     38        >
     39          <Route index element={<Navigate to="control-center" replace />} />
     40          <Route path="control-center" element={<ControlCenter />} />
     41          <Route path="training" element={<Training />} />
     42          <Route path="training/tracking" element={<TrainingTracking />} />
     43          <Route
     44            path="training/sessions/new"
     45            element={<NewTrainingSession />}
     46          />
     47          <Route path="weight" element={<Weight />} />
     48          <Route path="finance" element={<Finance />} />
     49          <Route path="investing" element={<Investing />} />
     50          <Route path="investing/tracking" element={<InvestingTracking />} />
     51          <Route path="investing/assets/new" element={<NewInvestment />} />
     52          <Route path="discipline" element={<Discipline />} />
     53        </Route>
    2954        <Route path="*" element={<Navigate to="/" replace />} />
    3055      </Routes>
  • frontend/vite.config.js

    rff01f66 r8c01a1f  
    66export default defineConfig({
    77  plugins: [react(), tailwindcss()],
     8  server: {
     9    proxy: {
     10      // Dev-only Yahoo Finance proxy to avoid browser CORS.
     11      // Frontend can call `/yahoo/...` and `/yahoo2/...` as same-origin.
     12      '/yahoo': {
     13        target: 'https://query1.finance.yahoo.com',
     14        changeOrigin: true,
     15        secure: true,
     16        rewrite: (path) => path.replace(/^\/yahoo/, ''),
     17      },
     18      '/yahoo2': {
     19        target: 'https://query2.finance.yahoo.com',
     20        changeOrigin: true,
     21        secure: true,
     22        rewrite: (path) => path.replace(/^\/yahoo2/, ''),
     23      },
     24    },
     25  },
    826})
Note: See TracChangeset for help on using the changeset viewer.