https://github.com/adriancrafter/todoapp
A practical blueprint for future projects and development kit
https://github.com/adriancrafter/todoapp
go golang micro-monolith microservice reference-implementation
Last synced: about 1 month ago
JSON representation
A practical blueprint for future projects and development kit
- Host: GitHub
- URL: https://github.com/adriancrafter/todoapp
- Owner: adriancrafter
- Created: 2023-12-31T15:14:24.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-31T13:41:03.000Z (over 1 year ago)
- Last Synced: 2024-06-20T23:36:29.144Z (over 1 year ago)
- Topics: go, golang, micro-monolith, microservice, reference-implementation
- Language: Go
- Homepage:
- Size: 8.28 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Todo List Reference Implementation
This project serves as a basic Todo list application designed to be a reference implementation for future multi-tenant capable applications. Whether built as microservices, micro-monoliths, or monolith apps, this project provides a foundation for integrating key features.
## Key Features:
- **Authentication and Authorization:** The application includes a robust session-based authentication and authorization system for web features. API endpoints use tokens for secure authentication.
- **Role-Based Access Control (RBAC):** A simple RBAC system is implemented to control access to different functions within the application. This allows for fine-grained control over user permissions.
- **Web Views with SSR Rendering:** The web views are designed to support Server-Side Rendering (SSR) for improved performance. Additionally, dynamic content is managed using htmx for a seamless user experience.
## Layered Architecture:
The project follows a layered architecture with an emphasis on the use of interfaces. The graph of dependencies is assembled in the `App` package, including:
- **Config:** Configuration settings for the application.
- **Logger:** Logging functionality for monitoring and debugging.
- **Database Access:** Support for SQL databases, with a current focus on PostgreSQL.
- **Repos:** Repositories for data storage and retrieval, implementing the repository pattern.
- **SQL Queries:** Externalized queries, easily editable in custom files, seamlessly embedded in the binary.
- **Services:** Business logic services.
- **Controllers (Web and API):** Handles HTTP requests and invokes the appropriate service layer functions.
- **Templates:** Streamlined loading from an embedded file system with implemented caching. Future plans include the flexibility to switch to an external filesystem.
## Project Structure:
The project follows a feature-based organization approach, where each feature is encapsulated within its own package. This promotes modularity, reduces import lists, and ensures a clear separation of concerns. The organization includes components such as routes definition, controllers, services, models, view models, data access, and conversion utilities.
### Feature Packages:
- `Todo List`: The core feature package containing components for managing todo lists, items, and associated functionality.
### Future Features:
As the project evolves, additional features will be added, each following a similar distribution of file types within its own package. The consistent structure facilitates maintainability and scalability.
## Notes
After the foundational structure of the project is established in this exploratory phase, a comprehensive set of tests will then be developed to ensure thorough coverage of the codebase.