Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:grezy-software/nango into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeannesson committed Nov 9, 2024
2 parents 862c1d3 + 43bbf2c commit 0ee1e1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 102 deletions.
103 changes: 4 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,110 +10,15 @@ The bridge contains:
- drf endpoints
- backend routes
- front types
- api call methods

The workflow is simple:

1. Create a model in your backend
2. Run the `make bridge` command
3. Import type and api call methods in your frontend
- api call methods (WIP)
- Tests (WIP)
- Scripts (for easy manual testing) (WIP)

## Activity

![Alt](https://repobeats.axiom.co/api/embed/3697d98ced5eddd922d97cdc1b47ecbc46b5f23c.svg "Repobeats analytics image")

##  Prerequisites

###  Env variables

Database:

- POSTGRES_USER
- POSTGRES_PASSWORD

Django:

- DJANGO_SECRET_KEY

Celery:

- CELERY_FLOWER_USER (optional)
- CELERY_FLOWER_PASSWORD (optional)

Stripe:

- STRIPE_PUBLISHABLE_KEY
- STRIPE_SECRET_KEY
- STRIPE_ENDPOINT_SECRET (optional)

Other:

- FRONTEND_URL (optional)

### Add node modules

To add a node module with `npx`, please ensure to add your module to the `./frontend`'s `package.json` file and not to the `/`'s `package.json`.

## Todo

### Blue print

- Django
- [x] Structure
- [x] Settings
- [x] envs files generator
- [x] Ruff
- [x] Requirements
- [x] Celery
- [ ] API
- [x] Structure
- [x] Libraries
- [ ] JWT
- NextJs
- [x] Structure
- [ ] Tailwind
- [ ] Typescript
- [ ] Eslint
- [ ] Shadcn

- Github
- [x] Dependabot (front & back)
- [ ] CI (Tests, Lint, Build, Coverage)
- [x] Pre-commit hook (ruff)

- Docker
- Development
- [ ] postgres
- [ ] litestream
- Production
- [ ] postgres
- [ ] litestream
(content: postgres / litestream, redis, traefik, celery (worker, beat), flower, django, mkdocs, nextjs)

- [x] Semantic release
- [x] Mkdocs

### Bridge

- Backend
- [ ] View Generator
- [x] Serializer Generator
- [x] Dynamic fields from models
- [ ] Detail serializer
- Handle nested models for detail serializer
- [ ] ForeignKey
- [ ] ManyToMany
- [ ] OneToOne
- [ ] Chirurgical edit on fields
- [ ] Dynamic routes
- [ ] Retrieve types from models
- [ ] Progress bar

- Frontend
- [ ] API call methods generator
- [ ] Types generator

### Setup a new git repo
## Setup a new git repo

Once you've created a new git repo from this template, we advise you enter the following command:

Expand Down
8 changes: 5 additions & 3 deletions setup/env_file_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def build_postgres_env(env_name: str) -> None:
folder: Path = make_folder(env_name)
path: Path = folder.joinpath(".postgres")
if path.exists():
print(f".{env_name}/.postgres already exists. Stop.") # noqa: T201
return

content: str = f"""# PostgreSQL\n
Expand All @@ -64,6 +65,7 @@ def build_django_secrets(env_name: str) -> None:
path: Path = folder.joinpath(".django")

if path.exists():
print(f".{env_name}/.django already exists. Stop.") # noqa: T201
return

content: str = f"""# General\n
Expand All @@ -79,9 +81,9 @@ def build_django_secrets(env_name: str) -> None:
STRIPE_ENDPOINT_SECRET = ""
# Django
# ------------------------------------------------------------------------------
DJANGO_SECRET_KEY="{get_or_generate_key(name="DJANGO_SECRET_KEY", multiplier=2)}" # noqa: S105
DJANGO_DEBUG={env_name!='Production'}
IS_LOCAL={env_name!='Production'}
DJANGO_SECRET_KEY="{'brBDrH4Gb-65!' if env_name == 'development' else get_or_generate_key(name="DJANGO_SECRET_KEY", multiplier=2)}" # noqa: S105
DJANGO_DEBUG={env_name!='production'}
IS_LOCAL={env_name!='production'}
DJANGO_SETTINGS_MODULE="config.settings.{env_name}"
DB_SETUP='postgres' # (postgres or litestream)
# Celery
Expand Down

0 comments on commit 0ee1e1d

Please sign in to comment.