The server part for the marketplace.
You can organize your own platform.
! Project in development
-
Statistics (mp-stats)
MongoDB reactive, Webflix, Mapstruct, Junit, Mockito, Swagger- The service has been tested by JUnit tests, working with the 'mp-stats-test' database, which is automatically cleared after the tests.
- A collection of Postman tests is attached. Run on an empty database. I recommend starting the service with the 'test' profile, the work will be carried out with the 'mp-stats-test' test database, which you can delete before / after the tests to clear the data. Otherwise, the work will take place with the real base of 'mp-stats', then after the tests do not forget to clear the database.
-
Security (mp-security)
JPA/Hibernate, Spring Security, PostgreSql, Redis, H2, Mapstruct, Swagger- Checking user registration and access rights by JWT.
- A collection of Postman tests is attached. Run on an empty database with the 'test' profile. You can add marker profiles: test-confirmation-code-reading and test-mail-sender-bypassing to automatically read the registration confirmation code and to bypass the error if MAIL_SENDER is not specified yet, respectively.
-
Profile (mp-profile)
JPA/Hibernate, Liquibase, PostgreSql, H2, Mapstruct, Swagger-
The user profile service provides work with data: from the date of registration to the avatar.
-
It contains the
Geoservice — working with addresses. -
Loading a preliminary set of geo-data: all countries; regions, districts, and cities of Russia; streets of Moscow, St. Petersburg, Balakovo.
-
Geo-data administration: Ability to import data from a CSV file with a loading report.
Example of the uploaded file and the generated report, also in CSV format (see sample-file-to-import-geo.csv and sample-geo-data-load-report.csv).
For convenience, a tabular representation is provided.
The process ensures that duplicate entries are excluded, and the data is sorted sequentially by the following fields:Country,Region,District,City,Street,House.By placing the file for testing the upload functionality in the correct local directory, the collection will operate as expected both locally and in the GitHub Workflow. This is recommended for convenient local testing. Alternatively, you can manually select the file for local testing directly within the test itself.
root └── postman ├── MyPlace-mp-profile.postman_collection.json ├── MyPlace-mp-security.postman_collection.json ├── MyPlace-mp-stats.postman_collection.json └── data └── sample-file-to-import-geo.csv~/Postman └── files └── postman └── data └── sample-file-to-import-geo.csv~/Postman/files — Postman working directory.
~/Postman/files/postman/data — Directory for files used to test API uploads.
You can view or change the Postman working directory in Postman → Settings → General → Working Directory → Location.
-
-
Gateway (mp-gateway)
Thegatewayservice acts as the central entry point for routing requests to other microservices. Integrated services:securityprofile/geoprofile/profile
Additional integrations will follow in future Pull Requests.
Key Features:
- Standardized Responses: Wraps all responses in
ApiResponse<T>viaResponseHandlerfor consistent error/success formats (e.g.,ResponseEntity<ApiResponse<UserDto>>). - Validation Shift: Input DTO validation is now centralized in the gateway, reducing redundancy in target services.
Testing:
- Includes
Postmantest collection covering all gateway endpoints. - Security service tests updated to reflect:
- New versioned paths (
/api/v1/) - Migrated
GET→POSTmethods where applicable - Gateway-level validation changes
- New versioned paths (
! The Gateway service is currently being migrated to a reactive stack. Once the migration is complete, the Servlet-based code will be removed
- Microservice architecture
- Maven
- Spring Boot
- Spring Data
- Spring Cloud
- Spring Security
- Tomcat, Netty
- Kafka
- JDBC, Hibernate
- Liquibase
- Postgresql, H2, MongoDB (reactive), Redis, Elasticsearch
- Junit, Mockito
- Docker-compose
- Kubernetes
To visualize the specification, paste it into any Swagger editor. For example this one: https://editor.swagger.io
| Service | Swagger UI URL | OpenAPI Docs URL | Specification |
|---|---|---|---|
| mp-test | localhost:9090/docs/swagger-ui.html | localhost:9090/docs | mp-stats-v-1-0-0.json |
| mp-security | localhost:8078/docs/swagger-ui.html | localhost:8078/docs | mp-security-v-1-0-0.json |
| mp-profile | localhost:8076/docs/swagger-ui.html | localhost:8076/docs | mp-profile-v-1-0-0.json |
| mp-gateway | localhost:8080/docs/swagger-ui.html | localhost:8080/docs | mp-gateway-v-1-0-0.json |
- JDK 11
- Apache Maven
- Docker (version 19.03.0 or higher)
- Docker Compose (version 1.28.0 or higher)
Note: Execute all commands from the project root.
For ease of use, a standard and an alternative option are provided using themanage.shscript. This script is designed for use on Linux-based systems, including but not limited to Ubuntu, CentOS, Debian, and other distributions. The script is not intended to run on Windows or MacOS without additional tools, such as WSL (Windows Subsystem for Linux) or proper environment configuration.When running manually (not via scripts), use the appropriate command for your Docker Compose version:
- Docker Compose V1:
docker-compose- Docker Compose V2:
docker composeContainer names are labeled by adding a suffix. By default, the suffix is
'std'. When running via a script, the suffix will be changed to'prod','dev', or'test', depending on the environment you are running. For manual execution, you can override the default label ('std') by specifying a value for theCONTAINER_MARKenvironment variable. Here is an example:
CONTAINER_MARK=my_label docker-compose -f docker/docker-compose-test.yml --profile full up
Build with tests before packaging. The following services must be installed and running:
- Redis
- MongoDB
- PostgreSQL
mvn clean packageBuild without running tests
mvn clean package -DskipTestsIf you want to completely skip the test compilation and not include them in the build, you can use:
mvn clean package -Dmaven.test.skip=trueFor the production profile, fill in the corresponding environment variable files:
- docker/stats/.env.stats.prod
- docker/security/.env.security.prod
- docker/profile/.env.profile.prod
To run each profile, execute the following commands:
(including the healthcheck, so please wait)
Run with the `test` profile
test profile
docker-compose -f docker/docker-compose-test.yml --profile full upor
docker/manage.sh test upRun with the `develop` profile
develop profile
docker-compose -f docker/docker-compose-dev.yml --profile full upor
docker/manage.sh dev upRun with the `production` profile
production profile
docker-compose -f docker/docker-compose-prod.yml --profile full upor
docker/manage.sh prod upNOTE: In the standard setup (without using a script), you can specify an override file for docker-compose to set different values for services. This is useful for testing in a 'production' environment.
Example:docker-compose -f docker/docker-compose-prod.yml -f docker/docker-compose-prod.override.yml --profile full up
Running services individually (examples with different profiles)
Run the `mp-stats` service
mp-stats service
test profile
docker-compose -f docker/docker-compose-test.yml --profile stats upor
docker/manage.sh test up statsdevelop profile
docker-compose -f docker/docker-compose-dev.yml --profile stats upor
docker/manage.sh dev up statsproduction profile
docker-compose -f docker/docker-compose-prod.yml --profile stats upor
docker/manage.sh prod up statsRun the `mp-security` service`
mp-security service
test profile
docker-compose -f docker/docker-compose-test.yml --profile security upor
docker/manage.sh test up securitydevelop profile
docker-compose -f docker/docker-compose-dev.yml --profile security upor
docker/manage.sh dev up securityproduction profile
docker-compose -f docker/docker-compose-prod.yml --profile security upor
docker/manage.sh prod up securityRun the `mp-profile` service`
mp-profile service
test profile
docker-compose -f docker/docker-compose-test.yml --profile profile upor
docker/manage.sh test up profiledevelop profile
docker-compose -f docker/docker-compose-dev.yml --profile profile upor
docker/manage.sh dev up profileproduction profile
docker-compose -f docker/docker-compose-prod.yml --profile profile upor
docker/manage.sh prod up profile

