All Projects → ita-social-projects → horondi_client_be

ita-social-projects / horondi_client_be

Licence: MIT license
No description, website, or topics provided.

Programming Languages

javascript
184084 projects - #8 most used programming language
Pug
443 projects

SoftServe IT Academy

Horondi project

HORONDI project is an e-commerce online shop that provides hand-made backpacks, bags, purses and other accessories.

GitHub issues Pending Pull-Requests GitHub stars Quality Gate Status Build Status GitHub license Coverage GitHub release (latest by date) Build Status



Installation

Required to install

  • NodeJS (14.15.4)

Clone

  • Clone this repo to your local machine using https://github.com/ita-social-projects/horondi_client_be.git

Setup

install npm packages

$ npm install

How to run local

  1. Open terminal.
  2. Run npm run start to start application.*
  3. Open http://localhost:5000/graphql to view it in the browser.
* - to run the project you need an .env file in root folder

How to run Docker

download and install Docker Desktop

open terminal and run npm run docker-db-start

next launch Docker Desktop and ensure your container is there and it is running

now you can use docker

command npm run test-server - will connect to test server

command npm run test-docker - will run docker and tests

Usage

How to run tests

To run unit test run Docker Desktop then open terminal and run npm run test in it.


Documentation

Rules and guidelines

  • File naming

    • Files should be name in format some-component.type.js
  • Architecture

    • Logic is separated in layers
      • resolver layer (handles graphql actions)
      • service layer (handles business logic, interactions with database)
      • model layer (mapping collections to mongoose models)
    • All business logic (any database operations or validation related to the business rules) and interaction with models is located inside service
    • Each model should live in its own folder
    • In each folder files should be named in format {model-name}.{type}.js (like {model-name}.service.js or {model-name}.resolver.js)
    • For each model we define class like {ModelName}Service in {model-name}.service.js and have separate methods for handling different types of operations
  • Configuration

    • All configuration is implemented via environment variable that is located inside .env file
  • Testing

    • Tests are implemented in the format of contract tests. We test actual Graphql operations like queries, mutations, or subscriptions on the running application. For testing, we should use a database that is running as a container locally. We should have a folder per entity with tests.

    • Test files:

      • {entityName}.queries.test.js - Testing the queries (if it exists)
      • {entityName}.mutations.test.js - Testing the mutations (if it exists)
      • {entityName}.subscriptions.test.js - Testing the subscriptions (if it exists)
    • Testing guides:

      1. All fields in data from the response from the backend should be checked for the appropriate value.
      2. If you cannot test some field for some particular value you should at least check its existence and its type.
      3. We should test the validation of the provided data to ensure that the backend performs validation by sending different combinations of valid and invalid data.
      4. Group tests for each operation (query, mutation, or subscription) to describe the statement. Content (base scenario, for some operations we can have additional scenarios):
        • describe(‘Validation’) with tests that validate a particular operation with combinations of valid and invalid data.
        • describe(‘Success business logic’) with tests that perform operations with valid data and ensures that valid flows work
      5. Tests should be executed before any commit and don’t allow to push code if tests are failing.
      6. We need to develop utility functions that we can reuse in many tests files for creating user and base authentication (obtaining JWT token) for future performing operations that require authorization
    • Libraries

      • jest - testing framework
      • apollo-boost - client for performing Graphql operations
  • Runtime work

    • Locally application is running in docker container. We have two docker containers: api container and database container.

Testing

Generator

Command npm run generate is used to run graphql code generator

  1. before using codegen you must run backend server horondi backend

  2. open terminal

  3. run npm run generate

  4. you should run npm run generate every time new unions or interfaces are created


Project Deploy

Deploy Сlient part: https://horondi-front.azurewebsites.net/

Deploy Admin Part: https://horondi-admin.azurewebsites.net/


Contributing

You're encouraged to contribute to our project if you've found any issues or missing functionality that you would want to see. Here you can see the list of issues and here you can create a new issue.

Before sending any pull request, please discuss requirements/changes to be implemented using an existing issue or by creating a new one. All pull requests should be done into development branch.

There are three GitHub projects: horondi_client_fe for frontend part, horondi_client_be for backend part and horondi_admin. Every project has it's own issues.

Every pull request should be linked to an issue. So if you make changes on frontend, backend or admin parts you should create an issue with a link to corresponding requirement (story, task or epic).

All Pull Requests should start from prefix #xxx-yyy where xxx - task number and and yyy - short description e.g. #020-createAdminPanel


Git flow

We have master , development and feature branches.
All feature branches must be merged into development branch!!! Only the release should merge into the main branch!!!

Github flow

Step 1

  • Option 1

    • 👯 Clone this repo to your local machine using https://github.com/ita-social-projects/horondi_client_be.git
  • Option 2

    • create new branch from development branch

Step 2

  • add some commits to your new branch

Step 3


Issue flow

Step 1

-go to issues and click New issue button

Step 2

when creating issue you should add name of the issue, description, choose assignee, label, project. If issue is a User Story you should link it with corresponding tasks, and corresponding tasks should be linked to issue.

Step 3

if issue is in work it should be placed in proper column on dashboard according to its status.


Teams

Development team

@VolodymyrTrach @bandvov @YarkoSumyk @INR4GE @Crash1212 @DmytroDidukh @yaroslavbilokin @ecl1pseo @TarasKun @TorskyM @maksym-strus @nadiyafomenko @vasylshpak @Iryna-Bzdyr @moran711 @VitalikVoicix @koropalov @dieie32 @kapoliub @NikitaDenysenko @ivan-bonk @Kiyooooko @M1ndForce @AndriyLymych @jul4ajka @MMashivskij @Haytham1337 @RevylaV @dmytro07 @yuliiakucher @fulljsdev @IlyaBelik @grebiniuk @AnastasiiaKolodiazhna @twihell @ostgit12 @100vbaSasha @Walleriy @AndronShermeta @YuriiDubnytskyi @Renfort @sergklukvin @mvmoshchovskyi @Vlodkojr @Elugormo @Mabonik @NetkachovaAnastasiya @Serhii-Ahafonov @Palidovych @halaburdataras @chortex @TanyaTop @oni-hash @Hai-Vasyl @Wasya1212 @BohdanShchur @VasylLymych @martagorpinchuk @olga-gchak @AnastasiaKhukhra @ElitKondor @Skrekliam @domnelkin @bohdanst1914 @filiczini @AlexanderBil @ZaitsevaEvelina @mrjnmzk @boris-giga

Quality control team

@HrytsykOlya @LiliiK @IrynaVakhula @MartaZyhmund @asIgnat @rrarock @olesmack @NataliaAndriiets @xfightr

ISTQB team

@olya011 @Vika-Bodnar @chelochev @Mary-Red @GalyaGirnyak @kirkchernyshkov @runner-on-waves Serhii Datsiuk @MariyaRashkevych @MarianaZemba @anastas184 @OleksiySverdlov @MariiaHnatiuk @Nikcoll-in @Evgeniya-Volkova @nadiya17 YevgeniiSt

Database team

@YukiAmeka @yaremich @Meamzy

DevOps team

@SofiaDemyanovska @ikoblyk @vitaliy-pavlyshyn @rholovchak

Designer team

@Nikadsgn

FAQ

  • How do I do specifically so and so?
    • No problem! Just do this.

Support


License

MIT

License

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].