Giter Site home page Giter Site logo

policeman's Introduction

Policeman Service

Read this in other languages: English, Русский

This service is designed to obtain a random or sequential vehicle registration number in the format A000AA 116 RUS, where A can be any character from the list [A, E, T, O, P, H, Y, K, X, C, B, M], 1 can be any digit, and 116 RUS is a constant.

MongoDB was chosen as the database system because it typically provides high performance for insertion and retrieval operations.

Local launch of the service

  1. Before running the service, you need to build the JAR file first using the following command:
mvn package
  1. The service utilizes Docker, so to launch it, simply execute the command below.
docker-compose up --build -d

Two containers will be raised (application and MongoDB database) as described in the docker-compose.yml file located at the project root. To confirm that the containers have been successfully brought up, you can use the command below and check the status (Up).

docker ps
  1. You can stop the service using the following command:
docker-compose stop

Main functionality:

  1. Obtaining a random number
    • url: /api/v1/numbers/random GET
    • incoming value: The authentication token must be provided in the request header
    • return value: A string with the content type of text/plain (for example, A000AA 116 RUS)
  2. Obtaining the next number
    • url: /api/v1/numbers/next GET
    • incoming value: The authentication token must be provided in the request header
    • return value: A string with the content type of text/plain (for example, A000AA 116 RUS)

More detailed description can be found in the Swagger documentation, where you can also test the requests. Swagger URL: http://localhost:8080/swagger-ui/index.html.

Additionally, in the requests.http file located at the project root, examples of requests have been provided, which you can execute within a development environment of your choice or using any other method.

List of libraries and technologies used for building the service

  • spring boot as the primary web framework
  • jjwt for JWT authentication
  • modelmapper for entity mapping
  • swagger-v3 Swagger for API documentation
  • testcontainers library providing the ability to run test containers for integration testing
  • СУБД MongoDb
  • Docker, docker-compose

Running tests

Integration tests have been written for CarNumberController.java, which can be found in the src/test folder.

mvn test

Tests can also be run through the development environment interface, for example Intellij Idea.

Build Framework

policeman's People

Contributors

romo4ka-bot avatar

Watchers

 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.