# Hellohub
<p align="center">
<img src="./docs/images/hh-logo.png" />
</p>
This is the mono repo of HelloHub, a short-range social network connecting users in venues.
# Table of Contents
- [Architecture 📐](#architecture----)
* [External Services](#external-services)
- [Products description 📦](#products-description---)
* [Frontends](#frontends)
- [Guidelines](#guidelines)
* [Setup](#setup)
* [Scopes](#scopes)
+ [Develop](#develop)
* [Generate an application](#generate-an-application)
* [Generate a library](#generate-a-library)
* [Development server](#development-server)
* [Code scaffolding](#code-scaffolding)
* [Build](#build)
* [Running unit tests](#running-unit-tests)
# Architecture 📐
| Applications | Tools | Hosting |
| -------------------------------- | ------------- | ---------------- |
| 3 Frontend Web apps | React | Firebase hosting |
| 3 Backend (API + Cosmo Database) | Azure service | Azure |
> 👉 Frontends or API are hosted in different instances of Firebase (frontend) or Azure App Services (backend).
>
> - 1 frontend = 1 azure hosting instance
>
> - 1 API = 1 azure app service instance
## External Services
Services that we integrate in our apps / APIs
| Applications | Tools | Hosting |
| --------------------- | -------- | ------- |
| Chat management | Twilio | - |
| Authorization service | Firebase | - |

# Products description 📦
## Frontends
We have 3 **apps** in HelloHub, so we can also say 3 **frontends**
> 👉 Frontends are hosted in Firebase Hosting services.
| Application | Description | URL |
| ---------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| **Web Chat** | Chat used by the venues customers, this app also integrates the .com site. | example: https://hellohub.com/hackney .com url: https://hellohub.com/ |
| **Venue admin dashboard** | Used by admin to manage the content of their chat app | https://admin.hellohub.com/ |
| **Internal admin dashboard** | Used by HelloHub workers, essentialy our CEO, to validate venues registrations | - |
# Guidelines
## Setup
apps names, you can also check "workspace.json" file
- chat-webapp
- venue-admin-webapp
- internal-admin-webapp
to run commands like build, test, lint use the following pattern:
- yarn start [app-name]
- yarn build [app-name]
- yarn test [app-name]
Read each README.md of each app (on apps/ folder)
## Scopes
3 main scopes:
- chat: for the venue customer
- venue: for the admin/owner of a venue
- internal: for internal/hellohub admins
### Develop
- Follow good commit converntions: https://dev.to/chrissiemhrk/git-commit-message-5e21
- use the scope on each commit. eg
```
feat(chat): add logo on ...page..
fix(venue): login redirection ...
chore(internal): ....
```
## 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 `@hellohub/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](https://jestjs.io).
Run `nx affected:test` to execute the unit tests affected by a change.