Simple club management app with two functions: add and list clubs. Created for trying out Play + React and for playing around with Akka Reactive Streams.
Read more about the forked base project @ http://bit.ly/2A1AzEq -> Scala Play React Seed
-
Fork or clone this repository.
-
Used any of the following SBT commands which will intern trigger frontend associated npm scripts.
sbt clean # Clean existing build artifacts
sbt stage # Build your application from your project’s source directory
sbt run # Run both backend and frontend builds in watch mode
sbt dist # Build both backend and frontend sources into a single distribution artifact
sbt test # Run both backend and frontend unit tests
- This seed is not using scala play views. All the views and frontend associated routes are served via React code base under
ui
directory.
CREATE TABLE CLUB_MEMBERS (
CLUB VARCHAR(255) NOT NULL,
MEMBER VARCHAR(255) NOT NULL
);
- HTTP GET /api/clubs
- Get all clubs, returns an array of clubs
- HTTP POST /api/clubs
- Post a new club
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Club schema for HTTP payloads",
"type": "object",
"required": [ "name", "members" ],
"properties": {
"name": {
"description": "Name of the club",
"type": "string",
"minLength": 1
},
"members": {
"description": "List of members in the club",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [ "name" ]
}
}
}
}
{
"name": "Club Name",
"members": [
{ "name": "Club Member1" },
{ "name": "Club Member2" }
]
}
Data processing between application and database is enabled by creating a data management protocol by using stacked custom BidiFlows: codec and grouping.
+-------------------------------------------+
| stack |
| |
+-------------+ | +-------+ +----------+ | +----------+
| | ~> O~~o | ~> | o~~O ~> | |
| Application | Club | | codec | List[ClubMember] | grouping | | ClubMember | Database |
| | <~ O~~o | <~ | o~~O <~ | |
+-------------+ | +-------+ +----------+ | +----------+
+-------------------------------------------+