Team work¶
A team shares one Git repository. Each developer works in an account of their own, on databases of their own, and pushes to a branch for a pull request. Four tools of the admin panel make that easy.
Developer accounts¶
One admin user per developer. Each developer signs in with their own account, pulls the branch of the team, works, and pushes. The APIs of each account answer under its own user path.
| Who creates them | The root user, on the Accounts page : name, email, API path, password, active. Insert Default Data (checked by default) adds sample custom APIs, schemas, hooks and migration scripts ; the default secret, group and API user are made either way. Clone copies one. |
| Unique | The API path and the email. |
| Own to each account | Its secrets, its Git branch and credentials, its masked database names, its sandbox processes, its Redis cache. |
| Shared | The Git repository, and through it every item of the project. |
| From a script | The management API creates, changes and deletes admin users. |
A developer joins :
- The root user creates the account and gives the credentials.
- The developer sets the Git URL and commit email in their User info, pulls the branch of the team, and adds the connection strings and keys of their own databases to their secret.
- When the database names of their machine differ from the ones in the code, they mask them.
- They work under
/api/…/<their path>/…, test with their own API users, and push to a branch of their own for a pull request.
Mask database names¶
The code names the databases the way production does : shop. On a developer machine the same database may be shop_dev, or two developers may share one server with shop_alice and shop_bob. Masking maps one to the other, for one account, so nobody edits a database name before a pull request.
| Where | Profile → User info → masked databases : instance, database name, masked database name. |
| Scope | The account of the developer only. Git, schemas, settings and code keep the name of the project. |
| Effect | Every API, hook, migration and query of the account runs on the masked name : the name in the URL and in the code stays the one of the project. |
| Instance | Database name (in the code) | Masked database name (on this server) |
|---|---|---|
mysql8 |
shop |
shop_alice |
- Add one row per database whose name differs. Names not listed are used as they are.
- Table meta, migrations, and plain queries which name the database in the API also go through the mapping ; SQL text you write yourself does not.
Code finder¶
APIs & Logic → Code Finder searches a word in all the code of the account at once, and opens the hit for editing.
| Searches | Custom APIs (their settings and every version), the pre and post hooks of instances, databases, tables, APIs and system APIs, events and listeners, schedulers, WebSocket events, migration scripts, process initializers, auth providers, utility classes, the settings of APIs, databases and tables, internationalizations, schemas, secrets, and the text files of SSR websites : in every language the code is written in. |
| Whose code | The account you are signed in with. |
| Result | The item, its kind and where it lives (instance, database, table, API, version…), with the code open. |
| Edit | Change the code in the result and Save changes : no need to open the page of the item. |
- Type a word and press
Enter. The options make the search case sensitive. - Each hit names its kind (custom API, hook and its type, listener, scheduler, secret, utility class…) and where it is.
-
Open a hit, edit, save.
-
Use it before renaming a field or a table : every custom API, hook and schema which names it shows up.
- A piece of code is also found by its name (a scheduler, a listener, the table of a schema…), a file of a website by its path (
pages/blog). - A file of an SSR website opens as its website shows it : TSX, with the types of
am-ssrand the imports of its other files. Save changes compiles it and the website takes it at once ; Open shows the file in its website.
Compare code¶
The Git panel lists every item the account changed since the last pull, with its kind of change, and opens each one in a compare editor.
| Where | The Git panel → Git status of commit. |
| Per file | Compare or Open in compare editor : the version of the branch next to the version of the account, the differences highlighted line by line. |
| All at once | View all changes in one diff. |
| Undo | Revert puts the file back to the branch ; several files at once with Revert selected. |
- The versions of a custom API, a hook or a listener are files of the item in Git, so a change of version shows in the same list.