Welcome to Hex, a Ruby web application designed using the Hexagonal Architecture. This architecture, also known as Ports and Adapters, emphasizes the separation of concerns by dividing an application into distinct layers. This approach increases modularity and maintainability, making Hex an ideal choice for scalable web applications.
- Decoupling Core Logic from External Concerns: Core application logic is decoupled from external interfaces like web frameworks and databases.
- Flexibility and Maintainability: Changes in one part of the system (e.g., UI, database) have minimal impact on others, particularly the business logic.
- Ease of Testing: Core logic can be tested in isolation from external elements.
- Adaptability: Easily adapt to different technologies and frameworks.
- Admin and Web Adapters: Separate adapters for admin and web interfaces, allowing for clear segregation and easier maintenance.
- GraphQL Integration: A modern approach to API design, offering flexible and efficient data loading.
- RESTful Interface: Traditional REST interface for straightforward CRUD operations.
- Domain-Driven Design: Business logic encapsulated in the domain layer for clarity and cohesion.
- SQLite Database: Lightweight and serverless database ideal for development and testing.
app/
: Main application directory.adapters/
: Adapters for different interfaces.admin/
: Admin interface.graphql/
: GraphQL API.rest/
: RESTful API.web/
: Web interface.
domain/
: Core business logic.models/
: Domain models (Author, Post).repositories/
: Data access logic.
ports/
: Ports connecting adapters to the domain.
config/
: Application configuration files.db/
: Database files.public/
: Public assets.spec/
: Test specifications.
- Ruby (version specified in
.ruby-version
) - Bundler (
gem install bundler
) - SQLite3
-
Clone the repository:
shCopy code
git clone [repository-url]
-
Navigate to the project directory:
shCopy code
cd hex
-
Install dependencies:
shCopy code
bundle install
-
Web Adapter:
Copy command
ruby app/adapters/web/adapter.rb
Access at
http://localhost:4567
. -
Admin Adapter:
Copy command
ruby app/adapters/admin/adapter.rb
Access at
http://localhost:[port]
. -
GraphQL Adapter:
Copy command
ruby app/adapters/graphql/adapter.rb
Use GraphQL client at
http://localhost:[port]/graphql
.
- Web Interface: A user-friendly web interface for viewing and managing blog posts. (in progress)
- Admin Interface: An administrative dashboard for advanced management tasks. (in progress)
- GraphQL API: An interactive GraphQL interface to query and mutate data. (done)
- REST API: Standard RESTful endpoints for CRUD operations. (not started)
For detailed usage and API documentation, refer to the docs/
directory (if available) or inline code comments throughout the application. (not started yet)
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
This product is created and maintained by Flakërim Ismani.