{"id":28545188,"url":"https://github.com/playframework/play-scala-react-seed","last_synced_at":"2025-07-07T04:32:06.438Z","repository":{"id":37788665,"uuid":"113740781","full_name":"playframework/play-scala-react-seed","owner":"playframework","description":":snowflake: Scala Play + React seed project with full-fledged build process","archived":false,"fork":false,"pushed_at":"2025-03-13T22:39:37.000Z","size":2173,"stargazers_count":203,"open_issues_count":15,"forks_count":99,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-07-01T09:31:34.458Z","etag":null,"topics":["play-framework","reactjs","sbt","scala","seed-project"],"latest_commit_sha":null,"homepage":"http://bit.ly/2A1AzEq","language":"Shell","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/playframework.png","metadata":{"funding":{"github":["playframework"],"open_collective":"playframework"},"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,"zenodo":null}},"created_at":"2017-12-10T10:22:55.000Z","updated_at":"2025-07-01T08:30:48.000Z","dependencies_parsed_at":"2023-02-15T00:17:00.509Z","dependency_job_id":"427f9366-783b-4e18-9829-0b707ede03f4","html_url":"https://github.com/playframework/play-scala-react-seed","commit_stats":{"total_commits":161,"total_committers":17,"mean_commits":9.470588235294118,"dds":0.7080745341614907,"last_synced_commit":"897d615f7ae49c3fa15f86870e1633dd7feec439"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/playframework/play-scala-react-seed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playframework%2Fplay-scala-react-seed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playframework%2Fplay-scala-react-seed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playframework%2Fplay-scala-react-seed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playframework%2Fplay-scala-react-seed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playframework","download_url":"https://codeload.github.com/playframework/play-scala-react-seed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playframework%2Fplay-scala-react-seed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263047660,"owners_count":23405280,"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":["play-framework","reactjs","sbt","scala","seed-project"],"created_at":"2025-06-09T23:06:49.263Z","updated_at":"2025-07-07T04:32:06.432Z","avatar_url":"https://github.com/playframework.png","language":"Shell","readme":"[![MIT License][license-badge]][LICENSE]\n\n# Scala Play React Seed\n\n\u003e Use play framework to develop the web application backend/services and frontend using React Create App, all in a totally integrated workflow and single unified console. This approach will deliver perfect development experience without CORS hassle.\n\n\nRead more @ http://bit.ly/2A1AzEq\n\n[![Scala Play React Seed](https://github.com/playframework/play-scala-react-seed/blob/main/react.png)](http://bit.ly/2A1AzEq)\n\n## Version Summary\n\n* [Play Framework: 2.8.19](https://www.playframework.com/documentation/2.8.19/Home)\n* [React: 18.2.0](https://reactjs.org/)\n* [Create React App: 5.0.1](https://github.com/facebookincubator/create-react-app)\n\n## How to use it?\n\n### Prerequisites\n\n* [Node.js](https://nodejs.org/)\n* [scala](https://www.scala-lang.org/download/)\n\n### Let's get started,\n\n* Fork or clone this repository.\n\n* Used any of the following [SBT](http://www.scala-sbt.org/) commands which will intern trigger frontend associated npm scripts.\n\n```\n    sbt clean           # Clean existing build artifacts\n\n    sbt stage           # Build your application from your project’s source directory\n\n    sbt run             # Run both backend and frontend builds in watch mode\n\n    sbt dist            # Build both backend and frontend sources into a single distribution artifact\n\n    sbt test            # Run both backend and frontend unit tests\n```\n\n* This seed is not using [scala play views](https://www.playframework.com/documentation/2.6.x/ScalaTemplates). All the views and frontend associated routes are served via [React](https://reactjs.org/) code base under `ui` directory.\n\n## Complete Directory Layout\n\n```\n├── /app/                                 # The backend (scala play) sources (controllers, models, services)\n│     └── /controllers/                   # Backend controllers\n│           └── FrontendController.scala  # Asset controller wrapper serving frontend assets and artifacts\n├── /conf/                                # Configurations files and other non-compiled resources (on classpath)\n│     ├── application.conf                # Play application configuratiion file.\n│     ├── logback.xml                     # Logging configuration\n│     └── routes                          # Routes definition file\n├── /logs/                                # Log directory\n│     └── application.log                 # Application log file\n├── /project/                             # Contains project build configuration and plugins\n│     ├── FrontendCommands.scala          # Frontend build command mapping configuration\n│     ├── FrontendRunHook.scala           # Forntend build PlayRunHook (trigger frontend serve on sbt run)\n│     ├── build.properties                # Marker for sbt project\n│     └── plugins.sbt                     # SBT plugins declaration\n├── /public/                              # Frontend build artifacts will be copied to this directory\n├── /target/                              # Play project build artifact directory\n│     ├── /universal/                     # Application packaging\n│     └── /web/                           # Compiled web assets\n├── /test/                                # Contains unit tests of backend sources\n├── /ui/                                  # React frontend source (based on Create React App)\n│     ├── /public/                        # Contains the index.html file\n│     ├── /node_modules/                  # 3rd-party frontend libraries and utilities\n│     ├── /src/                           # The frontend source codebase of the application\n│     ├── .editorconfig                   # Define and maintain consistent coding styles between different editors and IDEs\n│     ├── .gitignore                      # Contains ui files to be ignored when pushing to git\n│     ├── package.json                    # NPM configuration of frontend source\n│     ├── README.md                       # Contains all user guide details for the ui\n│     └── yarn.lock                       # Yarn lock file\n├── .gitignore                            # Contains files to be ignored when pushing to git\n├── build.sbt                             # Play application SBT configuration\n├── LICENSE                               # License Agreement file\n├── README.md                             # Application user guide\n└── ui-build.sbt                          # SBT command hooks associated with frontend npm scripts \n```\n\n## What is new in here?\n\n### FrontendCommands.scala\n\n* Frontend build command mapping configuration.\n\n```\n    ├── /project/\n    │     ├── FrontendCommands.scala\n```\n\n\n### FrontendRunHook.scala\n\n* PlayRunHook implementation to trigger ``npm run start`` on ``sbt run``.\n\n```\n    ├── /project/\n    │     ├── FrontendRunHook.scala\n```\n\n### FrontendController.scala\n\n* Asset controller wrapper serving frontend assets and artifacts.\n\n```\n    ├── /app/                                 \n    │     └── /controllers/                   \n    │           └── FrontendController.scala\n```\n\n### ui-build.sbt\n\n* This file contains the build task hooks to trigger frontend npm scripts on sbt command execution.\n\n### npm run commands\n\n* New and modified npm scripts of [Create React App](https://github.com/facebookincubator/create-react-app) generated package.json.\n* Check [UI README.md](./ui/README.md) to see all available frontend build tasks.\n\n```\n├── /ui/                       \n│     ├── package.json          \n```\n\n## Routes\n\n```\n├── /conf/      \n│     ├── routes\n```\n\n* The following route configuration map index.html to entry route (root). This should be placed as the initial route.\n\n```\nGET        /             controllers.FrontendController.index()\n```\n\n* All API routes should be prefixed with API prefix defined under ``application.conf`` (Default prefix ``apiPrefix = \"api\"``)\n\nExample API route:\n\n```\nGET        /api/summary  controllers.HomeController.appSummary\n```\n\n* The following route is being used to serve frontend associated build artifacts (css, js) and static assets (images, etc.). This should be placed as the final route.\n\n```\nGET        /*file        controllers.FrontendController.assetOrDefault(file)\n```\n\n**Note: _On production build all the front end React build artifacts will be copied to the `public` folder._**\n\n## Can be used to implement any front end/ui build!\n\n* Simply replace the ui directory with the build of your choice\n* Make output directory ROOT/public/\n* Implement a proxy to localhost:9000\n\n## Looking for some other frontend framework or language choice\n\n* [Play Java React Seed](https://github.com/playframework/play-java-react-seed)\n* [Play Scala Angular Seed](https://github.com/playframework/play-scala-angular-seed)\n* [Play Java Angular Seed](https://github.com/playframework/play-java-angular-seed)\n* [Scala Play Vuejs Seed](https://github.com/duncannevin/scala-play-vue-seed) by [Duncan Nevin](https://github.com/duncannevin)\n* [Java Play Vuejs Seed](https://github.com/duncannevin/java-play-vue-seed) by [Duncan Nevin](https://github.com/duncannevin)\n\n## License\n\nThis software is licensed under the MIT license\n\n[license-badge]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license]: https://github.com/playframework/play-java-react-seed/blob/main/README.md\n","funding_links":["https://github.com/sponsors/playframework","https://opencollective.com/playframework"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplayframework%2Fplay-scala-react-seed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplayframework%2Fplay-scala-react-seed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplayframework%2Fplay-scala-react-seed/lists"}