Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Mentor-mentee and jobseeker-company matchmaking platform used by ReDI School of Digital Integration, in Berlin, Munich and Düsseldorf, Germany.

NotificationsYou must be signed in to change notification settings

ReDI-School/connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

You'll find two sister products in this repository:

Both are created, run and managed byReDI School of Digital Integration. We're a non-profit school in Germany (in Berlin, Hamburg, Munich and NRW) with a community of hundreds of professionals from the digital industry volunteering to teach and mentor students. Our students are tech-interested locals and newcomers to Germany.

Getting started for designers

See theOnboarding Checklist andWorkflow for design tasks in our Wiki.

Getting started for developers

First of all, ReDI Connect and ReDI Talent Pool connect to aSalesforce instance via theNestJS API app. You'll need to set a number of environment variables in your.env and.env.development files to make various connections and features work. Reach out to @helloanil, @katamatata or @ericbolikowski to get set up.

After you've set up.env, make sure to updateNX_DEV_MODE_EMAIL_RECIPIENT to your own email address to receive emails from the platform.

  1. Make sure you're running thev20 version of Node locally. To do this, you can installnvm, which allows you to select different versions of Node via the command line. Alternatively, we have added support forVolta. So, if you choose, you can use Volta, which sets project-defined tools automatically.
  2. We are usingyarn as a package manager in our repository. If you don't have it on your machine yet,install it.
  3. Go to the root folder and runyarn to install the project dependencies (node_modules).
  4. Runyarn start:all to boot all apps,or a subset of apps using thestart:x commands listed in thepackage.json file.
  5. Read theOnboarding Checklist in our Wiki.

You can open these in your browser:

  1. If you're usingVS Code, make sure you:

    • Enable file nesting (settingexplorer.fileNesting.enabled) to collapse React component.graphql,.generated.ts and.scss files. This makes it easier to use the file explorer.
    • Install theRun on Save extension to automatically generate react-query hooks when saving .graphql files. This will speed up your development so you don't need to manually runyarn graphql:codegen.

We useNx Dev Tools to manage this monorepo. Find all the apps/products underapps/ and all libraries they consume underlibs/.

Use trunk-based branching: create feature/bugfix/docs/refactor/blabla branches directly offmaster and file PRs to merge back intomaster. Name branches<type>/short-hyphenated-title, wheretype isfeat,fix,docs,style,refactor,test orchore.

Note on how to use the GraphiQL playground

TheGraphiQL playground is a tool that allows you to test theGraphQL API. It is available athttp://localhost:3333/graphql.

The playground is a great tool to test the API, but it is not meant to be used in production. It is a development tool only.

Use it to view all the availableGraphQL queries and mutations. Most queries and mutations require authentication. To authenticate, you need to provide a validJWT token. You can get a validJWT token by logging in to the ReDI Connect application. Use your browser's developer tools to view network requests. Once you are logged in, find thePOST /api/redUsers/login request. There, copy thejwtToken. Then, in theGraphiQL playground, click on theHTTP HEADERS tab. Paste the following:

{  "Authorization": "Bearer <your-jwt-token>"}

Alternatively, use Loopback's Swagger (http://localhost:3003) to manually send a login request, and copy the JWT token from the response.

See this Loom video for a demo:https://www.loom.com/share/b2328a7ec6054afebb8249ea59ef2f18

More about GraphQL & data models

Code generation

We useGraphQL code generation to generate/updatereact-query hooks (queries and mutations). To enable code generation after changingNestJS entity models or any.graphql file, first, ensure theNestJS API is running, then executeyarn graphql:codegen.

To automatize the codegen after changes to.graphql files, install thisVS Code “Run on Save” extension. The repository’sVS Code config (in.vscode/settings.json) is already set up to enable this.

Note: If code generation doesn’t work, it might be because theNestJS API app is not running. Make sure that it is in a running state.

Visualize the entire GraphQL schema

  1. Copy the contents ofschema.graphql in the project root folder. If you want to ensure it’s 100% up to date, first startNestJS API (yarn start:alone:nestjs-api), then runyarn graphql:codegen
  2. OpenGraphQL Voyager:https://ivangoncharov.github.io/graphql-voyager/
  3. Click Change Schema > SDL > paste the file in > Display.

Where and how are data model schemas defined?

Schemas for data models (e.g.ConProfile,ConMentoringSession,TpJobseekerProfile andTpJobListing) are defined in two places:

  1. Visually, in Salesforce: Salesforce provides anObject Manager to set up Objects and their properties (e.g.firstName,birthDate, etc.), through a web admin interface. Talk to Eric/Anil/Manu for access.
  2. In code, in thecommon-types library: see the repository folderlibs/common-types/src/lib

Each data model in thecommon-types folder is represented by aTypeScript class. Every data model has two representations:

  1. As represented in thesalesforce domain: when the file name or class name ends withRecord, the model’s structure, property names and property types reflect how the data model is. The termRecord is chosen since it’s standard terminology in Salesforce.Record is just Salesforce’s way of sayingrow orinstance.
  2. As represented in thecore domain: when the file name or class name ends withEntity, the model follows a simpler and flatter structure, the same one that was used for years before CON and TP data were migrated to Salesforce. We use the termEntity as it implies a “thing”, such as a jobseeker’s profile, a mentor<>mentee match, a logged mentoring session, and so forth.

There are two important reasons why data models have two representations:

  1. Salesforce enforces a certain complexity in its data models. For instance, the suffix__c is automatically added to the name of any property we define on a model/object. There are also nested objects within objects.
  2. For years, CON and TP data lived in aMongoDB database, with a simple and effective data model structure that suited our needs. After migrating all the data to Salesforce, we essentially had two choices: update all code to access data using Salesforce’s names for objects and properties, or create a wrapper / abstraction to maintain our “core” domain models as they’ve been. We chose the latter.

To convert data from one domain representation to another, we useMapper classes. Look for file names ending in.mapper.

OurNestJS API thereafter usesGraphQL and code generation (codegen) to define types (both TS types and GraphQL object types) in various places. You can think of this as the data models “bubbling up” from the backend:

  1. All our data models, or entities, start in thelibs/common-types/src/lib folder asTypeScript classes
  2. NestJS analyzes all classes with the decorator@ObjectType()
  3. NestJS generates aGraphQL schema, containing all our entities in the shape of object types
  4. The commandyarn graphql:codegen uses thegraphql-codegen tool to read the schema. It then generates Typescript types (seelibs/data-access/src/lib/types/types.ts). It also scans all.graphql files for queries and mutations, and createsreact-query queries and mutations stored in.generated.ts files right next to the.graphql file.

What responsibilities are still carried by Loopback?

  • Authenticate users
  • Store credentials in its linked MongoDB database
  • Create signed URLs for uploading assets to S3

Good to know

We integratedTailwindCSS into theredi-connect andredi-talent-pool applications to enhance styling capabilities and to enable a new UI components library -shadcn/ui.

A newly createdshared-shadcn-ui-components library aims to replaceBulma in our codebase. Check the usage instructions for theshared-shadcn-ui-components library in thisREADME file.

About the Nx monorepo

Main benefits:

  • code sharing between apps (NestJS backend, ReDI Connect, ReDI Talent Pool) - great for components, types, utilities, and much more
  • one linter to rule them all - no more crazy pull requests with style changes
  • one command to start it all - no more four terminal windows to start all the apps
  • overall easier to extend & scale - there’s future work in the pipeline for whichNx is a great match (Storybook, hint hint)

System Architecture

ReDI Connect and ReDI Talent Pool are two React front-ends that use a Express/Loopback/NodeJS back-end to access data stored in a MongoDB database. The backend is hosted on a virtual machine, whereas the React front-ends are compiled into static assets stored on AWS S3 / CloudFront. Emails to users are sent via AWS SES. Some other static assets plus user uploads are hosted in AWS S3 buckets.

This diagram shows the current system architecture of both platforms:Architecture

Production server administration

We usepm2 on the production servers to manage our twoNodeJS servers -Loopback API andNestJS API.

  • Runpm2 monit for an overview of the two servers and their logs. Runpm2 status for a quick status of the servers.
  • NOTE: pm2 will automatically bootNestJS API andLoopback API on server restart.
  • To start/stop servers, runpm2 start <server-name> orpm2 stop <server-name>. To restart, runpm2 restart <server-name>. You don't need to include environment variables or various other flags,pm2 has this configuration "saved" since the first boot.

If you ever need to configure/start the servers from "scratch", here's how to do it:

  • [All the environment variables] pm2 restart --name loopback --log /home/ubuntu/loopback.log --max-memory-restart 250M /home/ubuntu/connect/apps/api/server/server.js
  • [All the environment variables] pm2 start --name nestjs-api --log /home/ubuntu/nestjs-api.log --max-memory-restart 500M connect/dist/apps/nestjs-api/main.js

If you need toupdate the environment variables, run the above command withrestart instead ofstart, and also add the--update-env flag.

Nx out-of-the-box docs

All the below is written by Nx.

This project was generated usingNx.

🔎Powerful, Extensible Dev Tools

Adding capabilities to your workspace

Nx supports many plugins which add capabilities for developing different types of applications and different tools.

These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.

Below are our core plugins:

  • React
    • npm install --save-dev @nrwl/react
  • Web (no framework frontends)
    • npm install --save-dev @nrwl/web
  • Angular
    • npm install --save-dev @nrwl/angular
  • Nest
    • npm install --save-dev @nrwl/nest
  • Express
    • npm install --save-dev @nrwl/express
  • Node
    • npm install --save-dev @nrwl/node

There are also manycommunity plugins you could add.

Generate an application

Runnx g @nrwl/react:app my-app to generate an application.

You can use any of the plugins above to generate applications as well.

When using Nx, you can create multiple applications and libraries in the same workspace.

Generate a library

Runnx g @nrwl/react:lib my-lib to generate a library.

You can also use any of the plugins above to generate libraries as well.

Libraries are shareable across libraries and applications. They can be imported from@talent-connect/mylib.

Development server

Runnx serve my-app for a dev server. Navigate tohttp://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Runnx g @nrwl/react:component my-component --project=my-app to generate a new component.

Build

Runnx build my-app to build the project. The build artifacts will be stored in thedist/ directory. Use the--prod flag for a production build.

Running unit tests

Runnx test my-app to execute the unit tests viaJest.

Runnx affected:test to execute the unit tests affected by a change.

Running end-to-end tests

Runng e2e my-app to execute the end-to-end tests viaCypress.

Runnx affected:e2e to execute the end-to-end tests affected by a change.

Understand your workspace

Runnx dep-graph to see a diagram of the dependencies of your projects.

Further help

Visit theNx Documentation to learn more.

☁ Nx Cloud

Computation Memoization in the Cloud

Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly.

Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nx’s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers.

VisitNx Cloud to learn more.

About

Mentor-mentee and jobseeker-company matchmaking platform used by ReDI School of Digital Integration, in Berlin, Munich and Düsseldorf, Germany.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp