8000 GitHub - jhana-app/jhana-app
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jhana-app/jhana-app

Repository files navigation

jhana-app

We use taskfile to manage tasks.

Installation (other platforms and completion info here):

brew install go-task

To see the available tasks, run:

task

Development

We use Docker to run infrastructure and sever locally in docker compose.

Please install docker:

  1. Docker Desktop: https://docs.docker.com/desktop/
  2. Or use colima, container runtimes on macOS (and Linux) with minimal setup - https://github.com/abiosoft/colima

Run server and required infrastructure (postgres, directus) locally in docker:

task compose:up

You can see the next logs if service has started successfully:


Default user credentials (based on .envs/.local/.directus.env):

When you change the .envs/.local/*.env files or update Dockerfile or compose files, you need to rebuild the service:

task compose:rebuild

It just runs: task compose:down && task compose:build && task compose:up

Backend

To run the backend API, run:

task run:api

Code generation

The code generation is done using entgo.io. To generate the code, run:

task go:generate

Migrations

To sync the schema generated by ent with the database, run:

task migrate:schema-diff -- <name>

Where <name> is the name of the migration.

In case the generated file was edited, the migration directory integrity file needs to be updated with the following command:

task migrate:update-hash

Apply the migrations to the database:

task migrate:apply

When you run the migrations first time, you may need to run the following command to ignore directus tables:

task migrate:apply -- --allow-dirty

Note, Atlas should be installed for this to work. When you run migrations, it will be installed automatically.

You can also use atlas directly with the following command:

task migrate -- <atlas command>

or :

atlas <atlas command>

User Authorization

We support authorization with firebase at the moment:

  • firebase

Firebase

This is our production method of authorization. It uses Firebase Authentication to authenticate users.

JHANA_AUTH_METHOD=firebase
JHANA_FIREBASE_ENABLED=true
JHANA_FIREBASE_PROJECT_ID=<project_id>
JHANA_FIREBASE_CREDENTIALS_FILE=<path_to_credentials_file>

To generate a private key file for your service account (read more here:

  • In the Firebase console, open Settings > Service Accounts.
  • Click Generate New Private Key, then confirm by clicking Generate Key.
  • Securely store the JSON file containing the key.
  • Set the JHANA_FIREBASE_CREDENTIALS_FILE to the path of the JSON file.

Warning: Use extra caution when handling service account credentials in your code. Do not commit them to a public repository, deploy them in a client app, or expose them in any way that could compromise the security of your Firebase project.

This file is only generated once. If you lose or leak the key, you can repeat the instructions above to create a new JSON key for the service account.

App

We use Flutter for the app.

Installation instructions

flutterfire is used for firebase integration read more.

cd app
dart pub global activate flutterfire_cli

Issues

Different environments and configs for firebase https://www.reddit.com/r/flutterhelp/comments/188g20c/does_firebase_optionsdart_completely_replace/

Support for multiple environments: https://medium.com/capyba/setting-flutter-environments-the-capybas-way-cb7d085b3b74

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 
0