Skip to content

Welcome to the Trade Lens repository! This web application is designed to showcase backend API endpoint creation, security features such as authentication, and frontend aspects like page routing.

Notifications You must be signed in to change notification settings

AndreiE91/Trade-Lens

Repository files navigation

Trade Lens - the Future of Trade Analytics

Welcome to the Trade Lens repository! This web application is designed to showcase backend API endpoint creation, security features such as authentication, and frontend aspects like page routing.

Table of Contents

  1. Introduction
  2. Features
  3. Use Case Diagram
  4. Architecture
  5. Frontend - Angular 14
  6. Backend - Java 17 with Spring Boot
  7. Class Diagram
  8. Database Schema
  9. Database Diagram
  10. Security
  11. Setup and Installation
  12. Usage
  13. Contributing
  14. License

Introduction

Trade Lens is a web application that offers a comprehensive view of trade analytics. It features user and trade management with a secure login system. The slogan of the app, visible on the main page logo, is "Trade Lens - the Future of Trade Analytics".

Features

  • User Management: CRUD operations for users.
  • Trade Management: CRUD operations for trades.
  • Authentication: JWT-based authentication with role-based access control (USER and ADMIN).
  • Frontend: Developed using Angular 14, with intuitive page routing and a responsive design.
  • Security: Password hashing and secure API endpoints.

Use Case Diagram

Usecase Diagram

Architecture

Trade Lens is divided into two main parts:

  1. Frontend: Built with Angular 14.
  2. Backend: Powered by Java 17 and the Spring Boot framework.

Frontend - Angular 14

The frontend of Trade Lens is developed using Angular 14. It includes:

  • Page Routing: Easy navigation between different views.
  • User Interface: Forms for login, registration, and managing trades.
  • HTTP Interceptors: For handling JWT tokens and making authenticated requests.

Backend - Java 17 with Spring Boot

The backend is built with Java 17 and Spring Boot. It handles all API requests, user authentication, and data management.

Class Diagram

Class Diagram

Database Schema

The database consists of two main entities: User and Trade, with a one-to-many relationship.

  • User: Represents an application user with fields for ID, username, password (hashed), and roles.
  • Trade: Represents a trade entry with fields for ID, trade details, and a foreign key to the user.

Database Diagram

Database Diagram

Security

  • JWT Authentication: Ensures that API endpoints are accessible only to authenticated users.
  • Role-Based Access Control: Differentiates permissions between USER and ADMIN roles.
  • Password Hashing: User passwords are securely hashed in the database.

Setup and Installation

Prerequisites

  • Node.js and npm
  • Angular CLI
  • Java 17
  • Maven
  • MySQL or any compatible database

Frontend Setup

  1. Navigate to the frontend directory:
    cd frontend
  2. Install dependencies:
    npm install
  3. Start the Angular development server:
    ng serve

Backend Setup

Maven Installation

  1. Navigate to the backend directory:
    cd backend
  2. Install dependencies and build the project:
    mvn clean install
  3. Configure the database connection in application.properties:
    spring.datasource.url=jdbc:mysql://localhost:3306/tradelens
    spring.datasource.username=root
    spring.datasource.password=yourpassword
    spring.jpa.hibernate.ddl-auto=update
  4. Run the Spring Boot application:
    mvn spring-boot:run

IntelliJ Installation

  1. Open folder as project in IntelliJ
  2. Configure the database connection in application.properties:
    spring.datasource.url=jdbc:mysql://localhost:3306/tradelens
    spring.datasource.username=root
    spring.datasource.password=yourpassword
    spring.jpa.hibernate.ddl-auto=update
  3. Run TradelensApplication.java and wait for IntelliJ to automatically install dependencies and build the project

Usage

  1. Register a new user via the registration page.

    Register

  2. Log in with your credentials to receive a JWT token.

    Login

  3. Use the token to access protected API endpoints and manage trades.

    Home Add User Update User Delete User View Users Find User by ID Add Trade Update Trade Delete Trade View Trades Find Trade by ID

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

This project is licensed under the MIT License.

About

Welcome to the Trade Lens repository! This web application is designed to showcase backend API endpoint creation, security features such as authentication, and frontend aspects like page routing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published