{"id":15430127,"url":"https://github.com/sophiaso/moments","last_synced_at":"2025-10-28T22:04:44.748Z","repository":{"id":68475248,"uuid":"126150090","full_name":"sophiaso/moments","owner":"sophiaso","description":"Spring Cloud structured Single Page Application","archived":false,"fork":false,"pushed_at":"2018-06-22T09:07:11.000Z","size":262,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-18T05:56:17.517Z","etag":null,"topics":["spring-cloud","spring-cloud-config","spring-cloud-eureka","spring-cloud-gateway","vuejs"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sophiaso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-21T08:54:43.000Z","updated_at":"2019-04-22T11:24:39.000Z","dependencies_parsed_at":"2023-03-24T22:42:44.677Z","dependency_job_id":null,"html_url":"https://github.com/sophiaso/moments","commit_stats":{"total_commits":92,"total_committers":3,"mean_commits":"30.666666666666668","dds":0.05434782608695654,"last_synced_commit":"9c2ec9d6e47fc18af2dad3e95ac670951b66778b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiaso%2Fmoments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiaso%2Fmoments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiaso%2Fmoments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiaso%2Fmoments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sophiaso","download_url":"https://codeload.github.com/sophiaso/moments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249743310,"owners_count":21319093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["spring-cloud","spring-cloud-config","spring-cloud-eureka","spring-cloud-gateway","vuejs"],"created_at":"2024-10-01T18:14:03.554Z","updated_at":"2025-10-28T22:04:44.678Z","avatar_url":"https://github.com/sophiaso.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project uses [Spring Cloud](http://projects.spring.io/spring-cloud/) to build a microservice structured [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application).\n\n## Table of contents\n\n* [Project strucutre](#project-structure)\n* [How to run](#how-to-run)\n* [How to develop](#how-to-develop)\n* [FAQ](#faq)\n\n## Project Structure\n\n### Description\n\nThis project uses several Spring Cloud modules to construct a simple microservice structured web application.\n\n* [config-server](config-server) uses `Spring Cloud Config Server` to manage configurations\n* [eureka-server](eureka-server) uses `Spring Cloud Netflix Eureka` to support service registry and discovery\n* [gateway-server](gateway-server) uses `Spring Cloud Gateway` to support gateway, authentication and web portal are also included in this module\n* [message-service](message-service) is a `Spring Boot Application` microservice which registers to eureka-server and requests can be routed from gateway-server\n\nFor the front end under [gateway-server](gateway-server/src/main/webapp), it's developed with [Vue.js](https://vuejs.org/).\n\n### Detailed structure tree\n\n```\n    moments\n    ├── config-server\n    │   └── src\n    │       └── main\n    │           ├── java\n    │           └── resources\n    │               ├── shared         // configuration files\n    │               └── bootstrap.yml \n    │\n    ├── eureka-server                  // eureka server for service registry and discovery\n    │   └── src\n    │       └── main\n    │           ├── java\n    │           └── resources\n    │               └── bootstrap.yml \n    │\n    ├── gateway-server\n    │   └── src\n    │       └── main\n    │           ├── java\n    │           ├── resources\n    │           │   ├── static\n    │           │   │    └── dist      // webpack bundled resources after npm build\n    │           │   └── bootstrap.yml \n    │           └── webapp             // front end resources\n    │               └── src\n    │                   ├── api\n    │                   ├── components // Vue components\n    │                   └── lib\n    │\n    ├── message-service\n    │   └── src\n    │       └── main\n    │           ├── java\n    │           └── resources\n    │               └── bootstrap.yml \n    │\n    └── moments-parent                // parent maven pom for other modules mainly for dependency management\n```\n\n## How to run\n\n### Run with maven\n\n1. Package the gateway-server front end resources.\n\n    ```bash\n    $ cd gateway-server\n    $ npm install\n    $ npm run build\n    \n    $ cd .. \u0026\u0026 mvn clean install\n    ```\n\n2. Start servers one after another under each module folder:\n\n    config-server, eureka-server, message-service, gateway-server\n\n    ```bash\n    $ cd config-server\n    $ mvn spring-boot:run\n    \n    $ cd eureka-server\n    $ mvn spring-boot:run\n    \n    $ cd message-service\n    $ mvn spring-boot:run\n    \n    $ cd gateway-server\n    $ mvn spring-boot:run\n    ```\n\n3. Dockerize your microservice\n\n    config-server:\n\n    ```bash\n    $ cd config-server\n    $ docker build . -t configserver --build-arg PACKAGENAME=config-server-0.0.1-SNAPSHOT.jar\n    $ docker run -h config-server -p 8888:8888 -it configserver:latest\n    ```\n\n\n### How to access\n\n1. Gateway:\n \n   http://localhost:8080/\n   \n   Log in with user/password or admin/password\n   \n   \n2. Message service through gateway\n\n   http://localhost:8080/message/get\n   \n   http://localhost:8080/message/admin/get // Only accessible by admin\n   \n\n## How to develop\n\nModules beside [gateway-server](gateway-server) are normal Spring Boot applications, no special configurations are configured for development.\n\n### Develop gateway front end\n\nIn the gateway-server module, webpack is used to bundle the web resources. In order to develop without frequently re-packaging the web resources and restart Spring Boot application server, this project uses [webpack dev server](https://webpack.js.org/configuration/dev-server/) for local development and auto refresh. \n\nUnder gateway-server module root, start gateway server:\n\n```bash\n$ mvn spring-boot:run\n```\n\nStart webpack dev server:\n\n```bash\n$ npm run start\n\n```\n\nAccess http://localhost:9090.\n\n## FAQ\n\n#### Why Spring Webflux is used in gateway-server but not Spring MVC?\n\nIn this project, websocket is used, Spring Netflix Zuul does not support websocket, so Spring Cloud Gateway is used to support websocket. But Spring Cloud Gateway cannot work well with Spring MVC with warning message `Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency`. So Spring Webflux is used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsophiaso%2Fmoments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsophiaso%2Fmoments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsophiaso%2Fmoments/lists"}