Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Nodebestpractices | 89,600 | 4 days ago | 47 | cc-by-sa-4.0 | Dockerfile | |||||
:white_check_mark: The Node.js best practices list (May 2023) | ||||||||||
Hoppscotch | 51,809 | 1 | 21 hours ago | 1 | March 22, 2022 | 150 | mit | TypeScript | ||
👽 Open source API development ecosystem - https://hoppscotch.io | ||||||||||
Rest Assured | 6,401 | 7,364 | 395 | a day ago | 29 | September 09, 2022 | 511 | apache-2.0 | Java | |
Java DSL for easy testing of REST services | ||||||||||
Nodejs Integration Tests Best Practices | 2,906 | a month ago | 42 | JavaScript | ||||||
✅ Beyond the basics of Node.js testing. Including a super-comprehensive best practices list and an example app (April 2022) | ||||||||||
Awesome Http Benchmark | 2,697 | 4 months ago | 10 | mit | ||||||
HTTP(S) benchmark tools, testing/debugging, & restAPI (RESTful) | ||||||||||
Testing Nestjs | 2,421 | 7 days ago | 23 | mit | TypeScript | |||||
A repository to show off to the community methods of testing NestJS including Unit Tests, Integration Tests, E2E Tests, pipes, filters, interceptors, GraphQL, Mongo, TypeORM, and more! | ||||||||||
Httpexpect | 2,202 | 70 | 110 | 7 days ago | 23 | July 20, 2021 | 34 | mit | Go | |
End-to-end HTTP and REST API testing for Go. | ||||||||||
Hitchhiker | 2,113 | 4 years ago | 96 | gpl-2.0 | TypeScript | |||||
a Restful Api test tool | ||||||||||
Mongooseim | 1,548 | 8 days ago | 88 | other | Erlang | |||||
MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines. | ||||||||||
Rest Client | 1,187 | 2 years ago | 5 | apache-2.0 | Java | |||||
A tool for automated testing REST API, generating exquisite testing report and REST API documentation. |
Piece of my thoughts about Node.js architecture.
supra-api-nodejs: A little bit about Node.js RESTful APIs Architecture (RU)
Supra-api-nodejs its about monolith first approach. But this does not prevent you from using it in a microservice architecture as well.
Each entity have own controller class it slim layer representing resource mapping(routing)
class PostsController extends BaseController {
static get router () {
router.get('/', this.actionRunner(actions.ListAction))
router.get('/:id', this.actionRunner(actions.GetByIdAction))
router.post('/', this.actionRunner(actions.CreateAction))
router.patch('/:id', this.actionRunner(actions.UpdateAction))
router.delete('/:id', this.actionRunner(actions.RemoveAction))
return router
}
}
For example PostsController
implements post
entity routes. Each route fires own action
.
It's a class encapsulated request validation, permission verification and business logic. One file, one class, one REST operation, one use case.
Implement data access methods.
Represent models schemas and validation rules. There is no other logic only model fields and validation rules.
npm i -g knex nodemon
cd /supra-api-nodejs
cp .env.example .env
.env
Run migration to set base SQL schema
knex migrate:latest
Run server
npm run start // prod mode
npm run dev // dev mode
Path | Method | Description |
---|---|---|
/auth/login | POST | LoginAction |
/auth/logout | POST | LogoutAction |
/auth/refresh-tokens | POST | RefreshTokensAction |
Path | Method | Description |
---|---|---|
/users | GET | ListUsersAction |
/users/current | GET | GetCurrentUserAction |
/users/:id | GET | GetUserByIdAction |
/users | POST | CreateUserAction |
/users | PATCH | UpdateUserAction |
/users/:id | DELETE | RemoveUserAction |
/users/change-password | POST | ChangePasswordAction |
/users/send-reset-password-email | POST | SendResetPasswordEmailAction |
/users/reset-password | POST | ResetPasswordAction |
/users/confirm-registration | POST | ConfirmRegistrationAction |
/users/change-email | POST | ChangeEmailAction |
/users/confirm-email | POST | ConfirmEmailAction |
/users/resend-confirm-new-email-token | POST | ResendConfirmNewEmailTokenAction |
/users/cancel-email-changing | POST | CancelEmailChangingAction |
Path | Method | Description |
---|---|---|
/posts | GET | ListPostsAction |
/posts | POST | CreatePostAction |
/posts/:id | GET | GetPostByIdAction |
/posts/:id | PATCH | UpdatePostAction |
/posts/:id | DELETE | RemovePostAction |
!!! Project still in progress !!!
2017 - 2018 - 2019 - 2020 ...