All Projects → doppelganger9 → babyfoot

doppelganger9 / babyfoot

Licence: MIT license
Simple CQRS/ES Node+Express+TypeScript REST API

Programming Languages

typescript
32286 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to babyfoot

Lib4dev
Find awesome libraries and make your development fast.
Stars: ✭ 165 (+1078.57%)
Mutual labels:  node-js, express-js
HIMS
Hospital Information Management System create using Node Js
Stars: ✭ 41 (+192.86%)
Mutual labels:  node-js, express-js
Nodejs Master Class
🛠 This repository contains the homework assignment for Node.js Master Class that is focused on building a RESTful API, web app GUI, and a CLI in plain Node JS with no NPM or 3rd-party libraries
Stars: ✭ 182 (+1200%)
Mutual labels:  node-js, restful-api
Swag Bot
My first ever discord bot using discord.js. The bot has a total of 77 commands, and it is capable of manipulating texts and images, analyzing data, searching information, and playing music. It has high level features like xp system, coins database, and spam detector.
Stars: ✭ 86 (+514.29%)
Mutual labels:  node-js, restful-api
content-moderation-image-api
An NSFW Image Classification REST API for effortless Content Moderation built with Node.js, Tensorflow, and Parse Server
Stars: ✭ 50 (+257.14%)
Mutual labels:  node-js, express-js
Blueprint
solid framework for building APIs and backend services
Stars: ✭ 87 (+521.43%)
Mutual labels:  node-js, express-js
Bootstrap3 Pug Former jade Node Express Grunt
Bootstrap 3 templated by Jade
Stars: ✭ 242 (+1628.57%)
Mutual labels:  node-js, express-js
Nodepress
😎 RESTful API service for Blog/CMS, powered by @nestjs
Stars: ✭ 829 (+5821.43%)
Mutual labels:  node-js, restful-api
teaching-nodejs-expressjs-framework-spring-2019-2020
Complete Node-Express Application
Stars: ✭ 16 (+14.29%)
Mutual labels:  node-js, express-js
dhan-gaadi
A complete online bus reservation system (Node, React, Mongo, NextJS, ReactNative)
Stars: ✭ 207 (+1378.57%)
Mutual labels:  node-js, restful-api
Tinyhttp
🦄 0-legacy, tiny & fast web framework as a replacement of Express
Stars: ✭ 1,259 (+8892.86%)
Mutual labels:  node-js, express-js
express-file-upload
Node.js Express Upload/Download File Rest APIs example with Multer
Stars: ✭ 64 (+357.14%)
Mutual labels:  node-js, express-js
Node Express Postgresql Server
Basic Node with Express + PostgreSQL Server
Stars: ✭ 74 (+428.57%)
Mutual labels:  node-js, express-js
Expressjs K8s
Express.js microservice with a Dockerfile, Kubernetes YAMLs and a non-root user
Stars: ✭ 148 (+957.14%)
Mutual labels:  node-js, express-js
Node Production
Take Your Node.js Project to The Production Environment (VPS/Dedicated Server).
Stars: ✭ 35 (+150%)
Mutual labels:  node-js, express-js
Focus Budget Manager
Budget Manager application built with Vue.js, Node.js, Express.js and MongoDB
Stars: ✭ 189 (+1250%)
Mutual labels:  node-js, express-js
Serverless Express
Run Node.js web applications and APIs using existing application frameworks on AWS #serverless technologies such as Lambda, API Gateway, Lambda@Edge, and ALB.
Stars: ✭ 4,265 (+30364.29%)
Mutual labels:  node-js, express-js
Wechatbynode
Use the Node.js development WeChat(使用Node.js 开发微信公众号)【 博客地址:https://cnodejs.org/user/SilenceHVK 】
Stars: ✭ 642 (+4485.71%)
Mutual labels:  node-js, express-js
Middleman-NPM
Middleman is an intuitive Express performance monitor for all your middleware 🎉
Stars: ✭ 13 (-7.14%)
Mutual labels:  node-js, express-js
Registration-and-Login-using-MERN-stack
Simple Registration and Login component with MERN stack
Stars: ✭ 210 (+1400%)
Mutual labels:  node-js, express-js

BabyFoot

Table Football picture

Build Status Coverage Status Mutation testing badge Known Vulnerabilities BCH compliance FOSSA Status Maintainability

Goals

  • Applying simple CQRS/ES and DDD.
  • Creating a REST API based on Node + Express + TypeScript.
  • Unit Testing with coverage > 80%
  • REST API documentation, samples & testing with PostMan + NewMan (CLI automation)
  • Exploring GitHub platform possibilites & integrations (CI/CD, NPM dependencies update Automation, etc.)

Usage

  • clone this repository somewhere on your local environment with git clone https://github.com/doppelganger9/babyfoot.git (or the SSH URL if you prefer)

  • install all dependencies with npm install

  • you can check the unit tests with npm test

  • then you can run the server API with npm start, just keep the process running and in another shell:

    • run the API tests with npm newman which will use PostMan on the CLI
    • OR : open localhost:3000
    • OR : use PostMan and import collection + environment and start manually exploring the API
    • then, CTRL+C on the npm start process to stop the local development server.

Unit Testing

npm test

Unit Testing was done by leveraging Chai, Mocha and TypeScript.

It definitely helped me:

  • see my Domain in action without a UI layer on top (manual testing);
  • find a ton of errors, and fix them! even before using the API "for real";
  • debug in vscode to go step-by-step and inspect variable contents;
  • refactor blindly once everything was covered, that's the real deal 😎!

Mutation testing

Code coverage is nice, but it only really tells you which part of your code is not yet covered.

What it does not tell you is if the current coverage is really testing or just passing over code.

Enters mutation testing! By changing parts of the tested code, it checks that related unit tests covering it should fail. If not, then the test does not really test anything, it just passes over the code.

Run npm run test:mutations and check the generated Stryker Mutator in the reports directory.

Look for surviving mutants, and test them one by one by replicating the mutation on our code and then if necessary, fix it.

Fixing means either adding meaningful assertions, or removing code that is not really useful.

PostMan collection & automated REST API testing

npm run newman

I also added a Postman collection to give you something to test the API with.

I find it great for APIs because:

  • you can play with it,
  • you can run automated tests,
  • you can provide sample calls
  • you can document your API
  • and you can export cURL shell commands (or any HTTP call code you want).

Also my goal is to automate this with Newman.

Future plans

  • Use Jest for Unit Testing? Well, as we use Stryker Mutator for mutation testing, keeping Mocha make it faster as it is able to only run tests for mutants as required; Jest runner is not yet capable of doing that.
  • have Continuous Deployment, etc.
  • add more API endpoints/features.
  • add a PWA client for the API.

Thanks

Code of Conduct

See CODE_OF_CONDUCT.md

Contributing

Well, I'm honored you are even thinking about contributing to this project 🤗

This is one of many side project, made for fun, and to explore some concepts and technology I was not using on my daily job.

I will not be actively maintaining it, just looking from afar, coldly, waiting for your contributions (issues, comments, questions, PRs..), or for my curiosity to arise again.

I do not have set up a proper CONTRIBUTING.md guide 🤭 so let's just say all contributions are welcomed 😉. You should follow our Code of Conduct 🤝. Use the GitHub platform 😎:

  • open an issue for discussion
  • create a Pull Request
  • do your best for the automated checks to pass before merging is possible

Anyway, I will review any PRs and do my best to provide answers and make merging happen, and clarify the CONTRIBUTING rules using a test & learn approach as the need arise.

You can of course message me on Twitter @doppelganger9.

License

MIT License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].