diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..38925a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea/ +.dcignore \ No newline at end of file diff --git a/README.md b/README.md index f87e88a..a4e63d9 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ - [Assignment](assignments/remote-control/assignment.md) - [Scoring](assignments/remote-control/score.md) +## GraphQL service +- [Assignment](assignments/graphql-service/assignment.md) +- [Scoring](assignments/graphql-service/score.md) + ## REST Service: Basic - [Assignment](assignments/rest-service/assignment.md) - [Scoring](assignments/rest-service/score.md) diff --git a/assignments/graphql-service/assignment.md b/assignments/graphql-service/assignment.md new file mode 100644 index 0000000..65037c2 --- /dev/null +++ b/assignments/graphql-service/assignment.md @@ -0,0 +1,200 @@ +# Assignment: Graphql Service + +## Description + +Imagine we have a couple of microservices that is created for the service Musicify, a new wikipedia for Music. We need to provide a confortable and convinient service for our users for managing and retrieving data for different entities. + +The following entities exists: + +```typescript +interface Artist { + _id: string; + firstName: string; + secondName: string; + middleName: string; + birthDate: string; + birthPlace: string; + deathDate: string; + deathPlace: string; + country: string; + bandsIds: string[] + instruments: string[]; + pseudonims: string[] + labels: string[]; +} +``` + +```typescript +interface User { + _id: string; + firstName: string; + secondName: string; + middleName: string; + password: string; + email: string; +} +``` + +```typescript +interface Band { + _id: string; + name: string; + origin: string; + yearsActive: string[]; + labels: string[]; + membersIds: string[]; + pastMembers: string; + website: string; + genresIds: string[]; + logo: string; +} +``` + +```typescript +interface Genre { + _id: string; + name: string; + description: string; + country: string; + year: string; + subGenresIds: string[]; +} +``` + +```typescript +interface Track { + _id: string; + artists: Artist[]; + bands: Band[]; + year: number; + albumId: string; + name: string; + description: string; + lyrics: string; + length: number; + authorsIds: number; +} +``` + + +**Details:** + +1. For each entity there is a separate microservice, you can find all microservices in corresponding repositories: + + - Artists service + - Users service + - Bands service + - Genres service + - Tracks service + - Favourites service + +The instruction how to launch it you can find in service readme.md. + +2. The Following types should be created: + +```graphql +type Artist { + id: ID! + firstName: String + secondName: String + middleName: String + birthDate: String + birthPlace: String + deathDate: String + deathPlace: String + country: String + bands: String + instruments: String + pseudonims: String + labels: String +} + +``` +```graphql +type Artist { + id: ID! + name: String + origin: String + yearsActive: String + labels: String + members: [Member] + pastMembers: String + website: String + genres: String + logo: String +} + +``` +```graphql +type Genre { + id: ID! + name: String + description: String + country: String + year: Int + subGenres: [Genre] +} + +``` + +type Favourites { +id: ID! +name: String +description: String +country: String +year: Int +subGenres: [Genre] +} + +3. The following queries ahould be created: + +- artist +- artists +- genre +- genres +- track +- tracks +- band +- bands +- favourites (available only for logged in user) + +The following mutation should be created: + +- createArtist +- deleteArtist +- updateArtist +- createGenre +- deleteGenre +- updateGenre +- createBand +- deleteBand +- updateBand +- createTrack +- deleteTrack +- updateTrack +- addTrackToFavourites +- addBandToFavourites +- addArtistToFavourites +- addGenreToFavourites + +**Mutation requests must be available only for logged in users.** + +4. Service port should be configured through env variable. + +5. Each entity must have a separate module. + +``` +- app + -modules + - bands + - artists + - tracks + - genres + - favourites +``` + + + + + + diff --git a/assignments/graphql-service/score.md b/assignments/graphql-service/score.md new file mode 100644 index 0000000..2a2ecf2 --- /dev/null +++ b/assignments/graphql-service/score.md @@ -0,0 +1,21 @@ +# Scoring: Graphql Service + +## Basic Scope + +- **+20** The repository with the application contains a `Readme.md` file containing detailed instructions for installing, running and using the application +- **+20** The application code that worked with `Users` instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) +- **+20** The application code that worked with `Tracks` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) +- **+20** The application code that worked with `Albums` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) +- **+20** The application code that worked with `Artists` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) +- **+20** The application code that worked with `Favorites` instance instance divided into modules according to to its purpose and Nest.js architecture conventions (work with request and response in controller, business logic in service, etc.) + +## Forfeits + +- **-200** Changes in tests +- **-150** Full link to repository differs from https://github.com/%your-gihub-id%/nodejs2022Q2-service +- **-30% of max task score** Commits after deadline (except commits that affect only Readme.md, .gitignore, etc.) +- **-20** No separate development branch +- **-20** No Pull Request +- **-10** Pull Request description is incorrect +- **-10** Every lint error after npm run lint using local config (errors, not warnings) +- **-20** Less than 3 commits in the development branch, not including commits that make changes only to `Readme.md` or similar files (`tsconfig.json`, `.gitignore`, `.prettierrc.json`, etc.) \ No newline at end of file