Connect
You'll find two sister products in this repository:
- ReDI Connect, a tool to connect mentees to mentors, deployed to https://connect.redi-school.org
- ReDI Talent Pool, a tool to connect jobseekers to companies and get jobs, deployed to https://talent-pool.redi-school.org
Both are created, run and managed by ReDI 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 developers
-
Make sure MongoDB is installed on your computer.
-
Make sure you're running the v14.17.6 version of Node locally when you're running the backend server and checkout to a new branch. To do this, you can use nvm, which allows you to select different versions of Node via the command line. Alternatively, we have added support for Volta. So if you choose, you can use Volta, which sets project-defined tools automatically.
-
Request information for environment variables from @ericbolikowski.
-
Run
yarn
in project root to install dependencies. -
If you're re-seeding, drop the database files:
rm -rf mongodb-data/*
and runyarn seed
to seed the database.Alternatively, you can drop the database in the MongoDB Shell - mongo or mongosh. In a new terminal window run the following:
$ mongo $ use mongodb $ db.dropDatabase()
Then run
yarn seed
in project root to seed the database. -
Run
yarn start:all
to boot all apps, or a subset of apps using thestart:x
commands in package.json.It'll take a while and lots of warnings will show until everything's booted.
-
See the Onboarding Checklist in our Wiki.
You can open these in your browser:
- ReDI Talent Pool: http://localhost:2999
- ReDI Connect: http://localhost:3000
- Admin panel: http://localhost:3001
- ReDI Connect Location Picker: http://localhost:3002
- API/backend: http://localhost:3003, Swagger: http://localhost:3003/explorer
Set environment variable [email protected]
and it'll override the default recipient and send to that instead (e.g. [email protected] yarn start:all
).
All features will run correctly locally with two exceptions:
- AWS SES (Simple Email Service) used for transactional emails (sign-up confirmation, verification, event notifications etc)
- AWS S3 to store avatar images uploaded by users.
You need an AWS access/secret key for the above - write to @ericbolikowski to get these, then put them into your environment file (apps/api/.env
).
We use Nx Dev Tools to manage this monorepo. Find all the apps/products under apps/
and all libraries they consume under libs/
.
Use trunk-based branching - create feature/bugfix/docs/refactor/blabla branches directly off master
and file PRs to merge back into master
. Name branches <type>/short-hyphenated-title
, where type
is feat
, fix
, docs
, style
, refactor
, test
or chore
.
Getting started for designers
See the Onboarding Checklist and Workflow for design tasks in our Wiki.
Getting started in depth
Guide to the repo and working on it
Editor setup
Good to know
We send out automated reminder emails to ReDI Connect mentor and mentee users, for things like "you've both been in an active mentorship for 10 days, no mentoring sessions have been logged yet, please start logging them". See Daily job to send notification emails to users for a full list of automated reminder emails.
Manual testing
About the Nx monorepo
Main benefits:
- code sharing between apps (admin, 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 which Nx is a great match (NestJS, 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:
Nx out-of-the-box docs
All the below is written by Nx.
This project was generated using Nx.
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 many community plugins you could add.
Generate an application
Run nx 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
Run nx 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
Run nx serve my-app
for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Code scaffolding
Run nx g @nrwl/react:component my-component --project=my-app
to generate a new component.
Build
Run nx build my-app
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Running unit tests
Run nx test my-app
to execute the unit tests via Jest.
Run nx affected:test
to execute the unit tests affected by a change.
Running end-to-end tests
Run ng e2e my-app
to execute the end-to-end tests via Cypress.
Run nx affected:e2e
to execute the end-to-end tests affected by a change.
Understand your workspace
Run nx dep-graph
to see a diagram of the dependencies of your projects.
Further help
Visit the Nx 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.
Visit Nx Cloud to learn more.