The Hexagonal Architecture URL Shortener project is a tool designed to reduce the length of long URLs, converting them into shorter and more shareable links. It follows the principles of hexagonal architecture to achieve separation of concerns and maintainability.
The Hexagonal Architecture URL Shortener is implemented using the hexagonal architecture pattern, separating the core business logic from the external dependencies. It consists of multiple layers, including the domain layer, application layer, and infrastructure layer. Each layer is designed to be independent and interchangeable, allowing for easy testing and maintenance.
Modularity: The hexagonal architecture pattern promotes modularity and flexibility, allowing for easy modification and extension of the system's components.
Testability: By decoupling the core business logic from external dependencies, the project is highly testable, with the ability to easily mock external dependencies for testing purposes.
Scalability: The modular and flexible nature of the hexagonal architecture makes it easy to scale the system as needed, allowing for future growth and expansion.
NodeJs, Express, TypeScript, Jest
Clone the project
git clone https://github.com/jcmexdev/url-shortenerGo to the project directory
cd url-shortenerInstall dependencies
npm installStart the server
npm run startStart development server
npm run devTo run tests, run the following command
npm run testTO run test with coverage run the following command
npm run test:coverageIf you have any feedback, please open a discussion
POST /api/v1/short| Attribute | Type | Description |
|---|---|---|
url |
string |
Required. Long url to short |
GET /:key| Parameter | Type | Description |
|---|---|---|
key |
string |
Required. url shortcode |