Directus is an open-source, instant headless CMS and API platform that connects directly to any new or existing SQL database. It provides an intuitive administrative app for managing content and users, along with automatically generated REST and GraphQL APIs for accessing that data from any application. Directus offers features like granular permissions, flexible data modeling, custom extensions, webhooks, and a modular architecture designed for extensibility. It empowers developers to build digital experiences on top of their preferred database without tedious API development or vendor lock-in.
This blog post explores using a Backend for Frontend (BFF) pattern with Keycloak to secure an Angular application. It advocates for abstracting Keycloak's complexities from the frontend by placing a Node.js BFF between the Angular application and Keycloak. The BFF handles authentication and authorization, retrieving user roles and access tokens from Keycloak and forwarding them to the Angular client. This simplifies the Angular application's logic and improves security by keeping Keycloak configuration details on the server-side. The post demonstrates how the BFF can obtain an access token using a client credential flow and how the Angular application can then utilize this token for secure communication with backend services, promoting a cleaner separation of concerns and enhanced security.
Hacker News users discuss the complexity and potential overhead introduced by using Keycloak and a Backend-for-Frontend (BFF) pattern with Angular. Several commenters question the necessity of a BFF in simpler applications, suggesting Keycloak could integrate directly with the Angular frontend. Others highlight the benefits of a BFF for abstracting backend services and handling complex authorization logic, especially in larger or microservice-based architectures. The discussion also touches on alternative authentication solutions like Auth0 and FusionAuth, with some users preferring their perceived simplicity. Overall, the comments suggest a balanced view, acknowledging the trade-offs between simplicity and scalability when choosing an architecture involving authentication and authorization.
Summary of Comments ( 30 )
https://news.ycombinator.com/item?id=43150116
Hacker News users discussed Directus's potential, particularly its ability to quickly create APIs for existing SQL databases. Some praised its open-source nature and ease of use, suggesting it's a good alternative to writing custom APIs. Others questioned its performance and scalability compared to purpose-built APIs, especially for complex or high-traffic applications. A few users mentioned potential security concerns and the importance of proper database configuration. Some brought up past experiences with Directus, citing both positive and negative aspects. The discussion also touched upon alternatives like PostgREST and Hasura, comparing their features and use cases.
The Hacker News post discussing Directus, a real-time REST and GraphQL API for SQL databases, has generated a moderate number of comments, exploring various aspects of the project.
Several commenters express interest in Directus and its potential applications, some specifically mentioning its suitability for hobby projects or internal tooling. One commenter shares their positive experience using Directus for a production application and praises its user-friendly interface. Another commenter points out Directus's utility for quickly creating admin panels, which eliminates the need for tedious manual development. A few users inquire about its capabilities and limitations compared to similar tools like PostgREST.
A recurring theme in the comments is the discussion of Directus's architecture and its reliance on a Node.js middleware layer. Some commenters express concerns about potential performance bottlenecks or security implications introduced by this intermediary layer. They question whether the benefits of this architecture outweigh the overhead compared to solutions directly interacting with the database. One commenter suggests exploring alternatives that minimize latency, such as compiling queries to native SQL. Another commenter asks whether Directus can be used with a read-only database user for enhanced security.
Further discussion revolves around Directus's features, including its support for various SQL databases, its real-time capabilities, and its extensibility. Commenters inquire about the platform's support for specific features, such as row-level security or horizontal scaling. They also discuss the challenges of maintaining compatibility across different SQL dialects. One user questions the suitability of using Directus for complex data models.
Overall, the comments reflect a mixture of curiosity, enthusiasm, and cautious consideration. While many acknowledge Directus's potential and user-friendliness, some also raise valid concerns regarding its architecture, performance, and security, prompting a deeper exploration of its strengths and weaknesses. The discussion provides valuable insights for potential users considering Directus for their projects.