The evolution of a component-based architecture
See Git tags for step-by-step notes.
git tag -ln
v1 First commit
v2 Functional groups
v3 Feature groups (Bounded Context)
v4 Components
v5 Applications
v6 Services
v7 Databases
v8 Versioning
v9 Service Discovery
v10 Circuit Breaker
-
Install Redis
sudo apt update sudo apt install redis-server -y sudo systemctl enable redis-server sudo systemctl start redis-server -
Modify
/etc/redis/redis.confUncomment
requirepass foobaredand set your passwordsudo vim /etc/redis/redis.conf sudo systemctl restart redis-server -
Install MySQL
sudo apt update sudo apt install mysql-server -y sudo systemctl enable mysql sudo systemctl start mysql -
Modify
/etc/mysql/mysql.conf.d/mysqld.cnf(or create a custom config file)default-time-zone='+00:00' sudo systemctl restart mysql -
Database Setup
sudo mysql -v -uroot --execute="drop user 'uservices'@'localhost'" sudo mysql -v -uroot --execute="create user 'uservices'@'localhost' identified by 'uservices';" for database_name in 'anime' 'poll'; do sudo mysql -v -uroot --execute="drop database if exists test_${database_name}" sudo mysql -v -uroot --execute="create database test_${database_name}" sudo mysql -v -uroot --execute="grant all on test_${database_name}.* to 'uservices'@'localhost';" sudo mysql -v -uroot --execute="grant select on performance_schema.* to 'uservices'@'localhost';" sudo mysql -v -uroot --execute="drop database if exists dev_${database_name}" sudo mysql -v -uroot --execute="create database dev_${database_name}" sudo mysql -v -uroot --execute="grant all on dev_${database_name}.* to 'uservices'@'localhost';" sudo mysql -v -uroot --execute="grant select on performance_schema.* to 'uservices'@'localhost';" done sudo mysql -v -uuservices -puservices test_anime --execute="select now();"
-
Schema Migrations
flyway -cleanDisabled=false -user=uservices -password=uservices -url="jdbc:mysql://localhost:3306/test_anime" -locations=filesystem:databases/anime-database clean migrate flyway -cleanDisabled=false -user=uservices -password=uservices -url="jdbc:mysql://localhost:3306/test_poll" -locations=filesystem:databases/poll-database clean migrate flyway -cleanDisabled=false -user=uservices -password=uservices -url="jdbc:mysql://localhost:3306/dev_anime" -locations=filesystem:databases/anime-database clean migrate flyway -cleanDisabled=false -user=uservices -password=uservices -url="jdbc:mysql://localhost:3306/dev_poll" -locations=filesystem:databases/poll-database clean migrate
This project provides a Makefile for convenient server management and testing.
| Command | Description |
|---|---|
make (or make all) |
Build the project and run all backend servers + frontend |
make build |
Run Gradle build and install/build the frontend (frontend/) |
make start |
Run all services and frontend in the background (logs saved to logs/) |
make stop |
Safely terminate all running servers and port processes |
make status |
Check ports and PID status for all running instances |
make restart |
Restart all servers (stop followed by start) |
| Service Name | Port (Default) | Instance Count | Description |
|---|---|---|---|
discovery-server |
8888 |
1 | Redis-based service registry |
gateway-server |
8880 |
1 | API gateway |
anime-server |
8881 |
2 (8881, 8882) |
Anime data management service |
poll-server |
8883 |
2 (8883, 8884) |
Poll data management service |
mal-server |
8885 |
1 | MyAnimeList integration and collection service |
frontend |
3000 |
1 | React frontend application |
You can easily test API operations from your terminal using the provided Makefile. (jq is recommended for nicely formatted JSON output).
- Get anime with no poll:
make test-no-poll
- Get anime by ID:
make test-anime-by-id id=12345
- Get anime by year and season:
make test-anime-by-season year=2026 season=summer
- Collect by ID list:
make test-collect-anime-by-ids ids="1,2,3" - Collect by specific season:
make test-collect-anime-by-season year=2026 season=spring
- Collect current season automatically:
make test-collect-anime-current-season
- Collect archive:
make test-collect-anime-archive
Reference list of environment variables used for manual execution or custom configuration:
| Variable | Used by | Description |
|---|---|---|
PORT |
all servers | Port the server listens on |
DATABASE_URL |
application servers | JDBC URL for the server's MySQL database |
REDIS_HOST / REDIS_PASSWORD |
discovery server | Redis connection used for the service registry |
DISCOVERY_SERVER_ENDPOINT |
application servers | Base URL of the discovery server for heartbeats and lookups |
MAL_CLIENT_ID |
mal-server | MyAnimeList API Client ID |
MAL_COLLECTOR_GATEWAY_URL |
frontend | URL of the API Gateway for frontend requests |
This project is licensed under the GNU General Public License v2.0 (GPL-2.0) due to the usage of the Mal4J library wrapper.
It is a derivative work based on application-continuum by initialcapacity.
The original architecture and source files have been modified and adapted for the mal-collector project, with the
original commit history fully preserved.