This repository contains the source code for an e-mobility charging solutions platform. The project provides a REST API and an Angular App capable of managing Charge Data Records (CDR) in real time for a network of Charge Point Operators (CPO).
- User authentication (login/register) for both Admin and User roles
- Real-time display of charging records
- Ability to add new charging records (admin only)
- Sorting and filtering of charging data
- Offline functionality with local storage
- Server status monitoring
- Run independently with seeded mock JSON depending on whether the backend service is running or not - same for login & signup
- Angular 18
- NgRx Signals for state management
- Angular Material for UI components
- RxJS for reactive programming
- Docker for containerization
- Kotlin and Spring Boot for the backend
- Node.js (v18.19.1 or later - use nvm to toggle)
- npm (v6 or later)
- Docker (optional, for containerized deployment)
- Java 17 or later (for backend)
- Gradle 6.x or later (for backend)
cd client
npm install && npm start
Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Run the backend using Docker:
cd api
docker compose up -d --build
or
Run the backend using Gradle:
cd api
chmod +x run.sh && ./run.sh
Note: Additional documentation is available in the
api
andclient
directories.
- Repository Pattern: The application uses the Repository pattern to abstract the data layer. This is implemented in the
ChargeDataService
which acts as a mediator between the data source (API or local storage) and the rest of the application. - Observable Pattern: RxJS Observables are used extensively for handling asynchronous operations and data streams, providing a reactive approach to managing state and user interactions.
- Dependency Injection: Angular's built-in dependency injection system is used throughout the application to manage component and service dependencies, promoting loose coupling and easier testing.
- Repository Pattern: The
ChargeDataRecordRepository
interface and its implementation separate the data access logic from the business logic, promoting code reusability and testability. - Service Layer Pattern: The
ChargeDataRecordService
encapsulates the business logic related to charge data records, providing a clear separation of concerns. - Controller Layer Pattern: The
ChargeDataRecordController
handles HTTP requests and delegates the processing to the service layer, following the principles of the Model-View-Controller (MVC) pattern. - Dependency Injection: Spring's dependency injection mechanism is used to manage the dependencies between components, promoting loose coupling and easier testability.
- Offline mode may not sync properly with the server when connection is restored.
- Some UI elements may not be fully responsive on smaller screen sizes.
- Error handling for network issues could be improved.
- There is a known issue with the authentication mechanism where the token expiration is not properly handled.
- The error handling and validation mechanisms are currently basic and need to be improved for better user experience and security.
- The database seeding mechanism is currently basic and needs to be improved for better user experience and security.
- Testing is currently limited to manual testing ... would add test case with JUnit or Mockito.
- Document API Using Swagger (OpenAPI)
- Implement data synchronization for offline mode.
- Enhance error handling and user feedback.
- Add more comprehensive e2e tests.
- Improve accessibility features.
- Improve database seeding mechanism.
- Add automated tests using JUnit or Mockito.
- Document API using Swagger (OpenAPI).
This project is licensed under the MIT License - see the LICENSE.md file for details.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
We welcome contributions! Please read our Contributing Guidelines before submitting a pull request.