2.0.2-SNAPSHOT • Published 2 years ago

marketfeed v2.0.2-SNAPSHOT

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
2 years ago

MarketFeed Backend

Features:

  • TypeScript
  • ESLint
  • GitLab CI/CD - build -> lint -> test -> deploy-staging (develop) | deploy-production (master)
  • Firestore - Storage Abstraction, Repository Pattern, Factory Pattern
  • Dependency Injection: Storage -> Repositories -> Service -> Controller
  • Testing with Mocha

Development Setup:

  1. Install dependencies: npm i
  2. Build project: npm run build
  3. Run express server: npm run serve

Contributing

Development Workflow

Gitflow branching model is used to build and release the project, Hubflow can be used to implement this model.

Integration

GitLab CI runners have been configured to set up integration, a 3 stage pipeline with build, lint and test have been set. The pipeline is set up to ensure proper linting and automated tests are passing before committing to the develop/master branch.

Deployment

  • Every time a commit is made to develop, staging environment on Cloud Functions automatically deploys develop branch.
  • Every time a commit is made to master, production environment on Cloud Functions automatically deploys master branch.

Appendix

  1. controllers: This layer contains the basic handler to process a given function. This represents the C aspect of MVC design pattern.
  2. repositories: This layer helps us interacts with the storage layer, implements repository pattern and factory pattern.
  3. services: This layer contains business logic, wrappers around third party services, DTO and HTTP clients.
  4. storage: This layer contains all abstractions to read/write with to database.
    1. getOne
    2. getMany
    3. save
    4. update
    5. delete
  5. model: This folder contains all the domain models (DAO and DTO).
  6. typings: This folder contains all type definitions used through out the project.