carlosazaustre/next-hexagonal-starter
关于
This is a simple webapp that uses the Hexagonal Architecture in the frontend.
其他项目实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Hexagonal (Next) Frontend WebApp
This is a simple webapp that uses the Hexagonal Architecture in the frontend.
The API used is JSONPlaceholder, a fake online REST API for testing and prototyping.Using Post and Users entities mainly.
Technologies
- TypeScript as language
- Next.js as React Front/Back Framework
- TailwindCSS for styling
- DaisyUI for TailwindCSS components
- Cypress for E2E testing
- Jest for Unit testing
- Testing Library for React Components testing
- ESLint for linting
- Prettier for code formatting
- Husky for pre-commit hooks
- Commitlint for commit message linting
Structure
The project is structured following "Screaming Architecture" approach. The structure is the following:
src/
|-- modules/
|-- posts/
|-- domain/
|-- application/
|-- infra/
|-- users/
|-- domain/
|-- application/
|-- infra/
|-- comments/
|-- domain/
|-- application/
|-- infra/
|-- components/
|-- hooks/
|-- sections/
|-- pages/
|-- styles/
The modules folder contains the different modules of the application. Each module has its own domain, application and infra layers.
The components folder contains the different UI shared components of the application.
The hooks folder contains the different hooks of the application.
The sections folder contains specific components and utils functions related with a module.
The pages folder contains the different pages (or Next.js routes) of the application
The styles folder contains the base styles using TailwindCSS.
Modules
Each module follows the same structure, with its own domain, application and infra layers.
modules/
|-- posts/
|-- domain/
|-- Post.ts
|-- PostRepository.ts
|-- application/
|-- get/
|-- getPostById.ts
|-- get-all/
|-- getAllPosts.ts
|-- getAllPostsByUser.ts
|-- getPaginatedPosts.ts
|-- create/
|-- createPost.ts
|-- mappers/
|-- PostMapper.ts
|-- infra/
|-- ApiPostRepository.ts
Testing
The project has unit and E2E testing. The unit testing is done using Jest and Testing Library. The E2E testing is done using Cypress.
Unit tests and Component tests are in the __tests__ folder.
The E2E tests are in the cypress folder.
License
MIT License
探索相关项目
加载中…