GithubHelp home page GithubHelp logo

anihalaney / rwa-trivia Goto Github PK

View Code? Open in Web Editor NEW
253.0 21.0 121.0 105.3 MB

Trivia App - Real World Angular series

TypeScript 69.19% JavaScript 3.03% HTML 16.07% CSS 3.09% SCSS 8.62%
angular material-design redux ngrx firebase angular-2 angular-material angular-cli cloud-function-for-firebase elasticsearch

rwa-trivia's People

Contributors

angular-cli avatar anihalaney avatar chaoranxie avatar heena-1993 avatar jitendraashutec avatar jitendrap-ashutec avatar milansar avatar niravgohil avatar piya99 avatar saloniss1345 avatar tejasdatarainx avatar yugank1991 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rwa-trivia's Issues

BACKEND

what is your mongoose structure to manage the surveys ?

ng test Type errors

Attempted to run tests using npm test or directly running ng test but both on master result in type errors related to NGRX Store Payload and some additional errors related to exports.

ERROR in rwa-trivia/src/app/core/components/login/login.component.spec.ts (7,23): Module '"rwa-trivia/node_modules/angularfire2/index"' has no exported member 'AuthProviders'.

ERROR in rwa-trivia/src/app/core/components/login/login.component.spec.ts (7,38): Module '"rwa-trivia/node_modules/angularfire2/index"' has no exported member 'AuthMethods'.

ERROR in rwa-trivia/src/app/core/components/login/login.component.spec.ts (7,51): Module '"rwa-trivia/node_modules/angularfire2/index"' has no exported member 'FirebaseAuthConfig'.
.
.
.
ERROR in rwa-trivia/src/app/core/store/reducers/questions.reducer.spec.ts (135,27): Argument of type '{ "id": number; "questionText": string; "answers": { "id": number; "answerText": string; "correct...' is not assignable to parameter of type 'Expected<ArrayLike<Question>>'.
  Type '{ "id": number; "questionText": string; "answers": { "id": number; "answerText": string; "correct...' is not assignable to type 'ObjectContaining<ArrayLike<Question>>'.

ERROR in rwa-trivia/src/app/core/store/reducers/questions.reducer.spec.ts (151,44): Argument of type '{ type: string; }' is not assignable to parameter of type 'ActionWithPayload<string>'.
  Property 'payload' is missing in type '{ type: string; }'.

ERROR in rwa-trivia/src/app/core/store/reducers/questions.reducer.spec.ts (154,56): Argument of type '{ type: string; }' is not assignable to parameter of type 'ActionWithPayload<string>'.
  Property 'payload' is missing in type '{ type: string; }'.

ERROR in rwa-trivia/src/app/core/store/reducers/user.reducer.spec.ts (35,35): Argument of type '{ type: string; }' is not assignable to parameter of type 'ActionWithPayload<User>'.
  Property 'payload' is missing in type '{ type: string; }'.

ERROR in rwa-trivia/src/app/shared/components/questions/questions.component.spec.ts (38,5): Type '{ "id": number; "questionText": string; "answers": { "id": number; "answerText": string; "correct...' is not assignable to type 'Question[]'.

ERROR in rwa-trivia/src/app/shared/components/questions/questions.component.spec.ts (50,9): Type '{ "id": number; "questionText": string; "answers": { "id": number; "answerText": string; "correct...' is not assignable to type 'Question'.

ERROR in rwa-trivia/src/app/shared/components/questions/questions.component.spec.ts (52,5): Type '{ "id": number; "questionText": string; "answers": { "id": number; "answerText": string; "correct...' is not assignable to type 'Question[]'.

ERROR in rwa-trivia/src/app/shared/components/questions/questions.component.spec.ts (143,3): Type '{ "id": number; "questionText": string; "answers": { "id": number; "answerText": string; "correct...' is not assignable to type 'Question[]'.
.
.
.

firebase serve function : Failed to emulate app

Hi,
I try to serve locally the functions bit I get this error, could anyone give me a hand ?
Thx!

sudo firebase serve --only hosting,functions
=== Serving from '/Users/xxx/PROJECT/rwa-trivia-master'...
i functions: Preparing to emulate functions.
⚠ functions: Failed to emulate app

Automated tests

As an addition to the real world application series, it could be useful to include CI as part of a future article as it's a fairly common practice in many organizations today. CircleCI is a great option that integrates flawlessly with GitHub and has a free tier as well.

https://circleci.com/pricing/

errors with gcloud functions

Hi Ashkay,

Thank you for your help so far, your project is exactly what I'am trying to do.
I finally succeed to set up the Elasticsearch & Nginx part... and I am now trying to run the master version, I followed the getting started, but I have several problems, maybe could you help me to solve some of them?

In my gcloud console I can see several errors and among them these ones:

  • No Firebase ID token was passed as a Bearer token in the Authorization header. Make sure you authorize your request by providing the following HTTP header: Authorization: Bearer or by passing a "__session" cookie.

*Trace: [index_not_found_exception] no such index, with { resource.type="index_or_alias" & resource.id="questions" & index_uuid="na" & index="questions" } at /user_code/server/functions/ESUtils.js:238:21 at process._tickDomainCallback (internal/process/next_tick.js:135:7)

And in my web client (chrome)

Slow performace

Hi,
Very nice app and very well explained.
I have the feeling that the app is moving slow, for example when I switch tabs or when I press a button.
Is this because the NativeScript framework or is because of the app implementation?
Fox example a tab panel in ionic or even in Sencha Touch implemented in a hybrid app works much faster.
I tested this app with iPhone XS MAX 512 GB.

Test issue

let x = 1; x = x * x; console.log(x);

Users et roles

Hi,
It seems that users are not stored in rtdb nor firestore, but we have a
getUserRoles method that fetch in users collection in authentication.service.
Maybe is it planned in the futur to add users in this collection when they sign up ?

Regards,

Wrong names and duplication of services in question.component.ts (Branch: part-1)

There is:

constructor(private questionService: QuestionService,
private categoryService: QuestionService) {
}

Should be:

constructor(private questionService: QuestionService) {
  }

There is:

ngOnInit() {
    this.sub = this.questionService.getQuestions()
      .subscribe(questions => this.questions = questions);

    this.sub = this.questionService.getQuestions()
      .subscribe(questions => this.questions = questions);
  }

Should be:

  ngOnInit() {
    this.sub = this.questionService.getQuestions()
      .subscribe(questions => this.questions = questions);
  }

error TS2322: Type 'Observable<{}[]>' is not assignable to type 'Observable<Question[]>'

I'm new to all the technologies on this project, so likely doing something silly. Running

`ng serve` 

I'm getting the error

`error TS2322: Type 'Observable<{}[]>' is not assignable to type 'Observable<Question[]>'`

I'm guessing I have a configuration wrong? Below are my versions and the error message.

`PS C:\files\projects\rwa-trivia-master-bitbucket\projects\trivia> ng v

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/

Angular CLI: 7.1.4
Node: 10.16.2
OS: win32 x64
Angular: 7.1.4
... cli, common, compiler, compiler-cli, core, forms, http
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker, upgrade

Package Version

@angular-devkit/architect 0.11.4
@angular-devkit/build-angular 0.11.4
@angular-devkit/build-ng-packagr 0.11.4
@angular-devkit/build-optimizer 0.11.4
@angular-devkit/build-webpack 0.11.4
@angular-devkit/core 7.1.4
@angular-devkit/schematics 7.1.4
@angular/animations 7.2.15
@angular/cdk 7.2.2
@angular/fire 5.2.1
@angular/flex-layout 7.0.0-beta.24
@angular/material 7.2.2
@angular/pwa 0.11.4
@ngtools/json-schema 1.1.0
@ngtools/webpack 7.1.4
@schematics/angular 7.1.4
@schematics/update 0.11.4
ng-packagr 4.7.1
rxjs 6.5.2
typescript 3.1.6
webpack 4.23.1

PS C:\files\projects\rwa-trivia-master-bitbucket\projects\trivia> ng serve
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
11% building modules 15/20 modules 5 active ...jects\trivia\src\styles\dark.theme.scssBrowserslist: caniuse-lite is outdated. Please run next command npm update caniuse-lite browserslist
Date: 2019-08-12T16:57:30.779Z
Hash: 1b4220ca6a423442e401
Time: 11077ms
chunk {main} main.js, main.js.map (main) 1.91 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 104 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 706 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 324 kB [initial] [rendered]

ERROR in ../shared-library/src/lib/core/services/game.service.ts(247,5): error TS2322: Type 'Observable<{}[]>' is not assignable to type 'Observable<Question[]>'.
Type '{}[]' is not assignable to type 'Question[]'.
Type '{}' is not assignable to type 'Question'.
Property 'id' is missing in type '{}'.

i 「wdm」: Failed to compile.`

error when deploying functions

Hi Anihalaney and TY for your great job,

I have en error when I try to deploy cloud functions:
Error parsing triggers: Cannot find module './server/functions/app'

Do you have any idea ?
Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.