Code Monkey home page Code Monkey logo

banner-api's Introduction

Banner-API

Russian version

Description

This service is to show specific banner for user depends on its feature and tag parameters. Also it is provided interface to manage banners, its content, tags and features.

Arcitecture

The web application architecture include two main layers: Core and Infrastructure. Core is lower than Infrastructure, so code from Infrastructure can call code of Core but not vice versa. This also applies to internal layers components located vertically. And this reflects directories tree inside src.
As it can be seen, the Repository pattern applied here. The repository package contains IRepository interface that is used by application package which is presented the main logic. model package contains structures representing banners, features, tags and users. storage package includes PostgreSQL connector and implements IRepository interface to make possible its injection into application as a database. controllers package is API implementation which contains the logic for processing requests.

Arch

Run

Application deploying is made with docker-compose. So it is necessary to have it installed before running. The service starting requires environment variables defined in .env file. The example of all necessary variables is in env-example file. It is reccomend to create file with these variables manualy. In case the .env is missing it will be created from env-example automatically at startup.
As it can be seen from env-example file, application will start on localhost:8080 and web adminer to manage PostgreSQL database on localhost:8888.
There are the next commands for Makefile allows to steer service running.

# run service and testing
make

# run testing (totally failed in case service is down)
make test

# run service
make run

# stop service
make stop

# stop and remove containers data (do not removes docker volume)
make clean

Examples

Examples of requests represented as Postman collection

banner-api's People

Stargazers

Dilmurod avatar

Watchers

hhullen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.