A repository for all Naonair components
AIREAL/
├── api/ # NestJS API
├── app/ # React-Native + Paper
├── backoffice/ # CRA + React + Material-Ui
├── dtos/ # DTOs used for type between API and fronts app
You can find Graphhopper project here : https://github.com/lonestone/graphhopper
Don't forget to use the correct environnement before pushing your apps in production :
- Check
.env
files - "baseUrl" in
api/config.json
A new version is automatically deployed on Render when a commit is pushed on main branch.
Mobile apps must be manually deployed.
When a new version is deployed, please tag last main branch commit with :
git tag -a vX.Y.Z. -m "Small message to describe updates"
git push origin vX.Y.Z
# with :
# X : breaking change(s)
# Y : add new feature(s)
# Z : minor fix(s)
Warning : staging is the new prod
Please keep in mind that thee is two online environments.
For the application you must check what is the current env in config.json
For now, please change the url according to the wanted env :
- Prod => "baseUrl": "https://naonair-api-staging.onrender.com/"
- Preprod => "baseUrl": "https://naonair-api-preprod.onrender.com/"
- local => "baseUrl": "http://localhost:3001/"
Docker is used in dev to start databases :
- aireal-postgres
- aireal-postgres-tests
We using a PostgreSQL database in order to store main data of apps. Running at localhost:5432
Update your entities and use npx mikro-orm migration:create
to create migration.
For, you need to build your dtos :
$ cd dtos
$ yarn
$ yarn build
Next, go in api
, app
and backoffice
and run these commands :
$ yarn
$ npm link ../dtos # use dto package as dependency, see DTOs chapiter below
For nest, you need to install @nestjs/cli
in global (or locally, as you want)
You need docker, and run docker-compose up -d
for running database
# go in api folder
$ cd api
# copy example to right file (don't commit it!)
$ cp .env.example .env
Then, fill right properties
# API
$ yarn start // or start:dev to hot reload
# Backoffice
$ yarn start
# Mobile app - Metro server
$ yarn start
# Mobile app - Run on android
$ yarn android
# Mobile app - Run on ios
$ yarn ios
You have to log into API with /login, with payload { pass : secretKey }. This secret key must be configurated in .env.
This API will return a JWT token, which expire after 24 hours.
Don't forget to fill .env :
PASS_KEY : Token used to be connected on backoffice
JWT_KEY : Key to jwt token generation (Keep it secret)
DTOs, as (Data Transfer Object), are defined in /dtos. It permits typing between api and front app.
This projet is considered as package, and used as dependenbcy with npm link
You must build all dtos with yarn build
in dtos packages in order to use it in front apss
Fast refresh is enabled by default. If not actived:
- shake your phone
- select "Enable fast Refresh"
To enable debug mode :
- shake your phone
- select "Debug" item (warning, logs will appear not in browser console (see below))
- go to http://localhost:8081/debugger-ui/
Build with lots of love ❤, by Lonestone