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.
- Introduction
- Features
- Use Case Diagram
- Architecture
- Frontend - Angular 14
- Backend - Java 17 with Spring Boot
- Class Diagram
- Database Schema
- Database Diagram
- Security
- Setup and Installation
- Usage
- Contributing
- License
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".
- 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.
Trade Lens is divided into two main parts:
- Frontend: Built with Angular 14.
- Backend: Powered by Java 17 and the Spring Boot framework.
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.
The backend is built with Java 17 and Spring Boot. It handles all API requests, user authentication, and data management.
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.
- 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.
- Node.js and npm
- Angular CLI
- Java 17
- Maven
- MySQL or any compatible database
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the Angular development server:
ng serve
- Navigate to the backend directory:
cd backend
- Install dependencies and build the project:
mvn clean install
- 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
- Run the Spring Boot application:
mvn spring-boot:run
- Open folder as project in IntelliJ
- 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
- Run TradelensApplication.java and wait for IntelliJ to automatically install dependencies and build the project
-
Register a new user via the registration page.
-
Log in with your credentials to receive a JWT token.
-
Use the token to access protected API endpoints and manage trades.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License.