@calljmp/cli v0.0.26
Calljmp CLI
Secure backend-as-a-service for mobile developers. No API keys. Full SQLite control.
š Overview
Calljmp is a secure backend designed for mobile developers, providing:
- ā Authentication via App Attestation (iOS) and Play Integrity (Android)
- ā Full SQLite database access (no restrictions, run raw SQL)
- ā Dynamic permissions for users & roles
- ā React Native SDK for seamless integration
š¹ Website: calljmp.com
š¹ Follow: @calljmpdev
š¦ Installation
Install the CLI globally via npm:
npm install -g @calljmp/clior via yarn:
yarn global add @calljmp/cliš ļø Setup & Usage
Most commands require current directory to be a project root directory when executing them. You can optionally supply a project root directory with --project <project-directory> flag.
1ļøā£ Setup and link project
Add ignores, generate types, and install dependencies. It will also walk you through the login and linking process.
calljmp setup2ļøā£ Local development
Run the local development server to develop your backend locally:
calljmp startIf you want to run the local server in a different port, you can specify it with the --port flag:
calljmp start --port 8080If you want to persist the data between restarts, you can specify the --persist-database flag:
calljmp start --persist-database3ļøā£ Managing database
Manage your SQLite schema and generate migrations:
calljmp database schemaYou can reset the local database to its initial state with:
calljmp database resetPull the database schema and data from your cloud project to local database:
calljmp database pullApply migrations to the cloud database and local database:
calljmp database migrate4ļøā£ Deploy to Calljmp
Deploy your local changes to the cloud:
calljmp service deployCode generation
Generate TypeScript code for environment variables, database, and resources:
calljmp service generateEnvironment variables
You can set environment variables in the .env file with CALLJMP_ prefix or without prefix in .service.env. In order to protect a value upon deployment and access outside of the service scope prepend key with SECRET_ prefix. The CLI will automatically load them when you run the commands.
For example:
.env:
CALLJMP_SOME_TOKEN = "not a secret token"
CALLJMP_SECRET_TOKEN = "encrypted secret token".service.env:
ANOTHER_TOKEN = "another public token"
SECRET_ANOTHER_SAFE_TOKEN = "encrypted another secret token"Then in code you will have access to:
import { Service } from './service';
const service = Service();
service.get('/', async c => {
// Evaluate access control to your service
{
console.debug(
'Access',
c.var.trusted,
c.var.userId,
c.var.platform,
c.var.serviceId
);
if (!c.var.trusted && !c.env.DEVELOPMENT) {
// Calljmp was not able to confirm the device and app integrity when the service was called.
return c.json({ error: 'Unauthorized' }, 401);
}
if (!c.var.userId) {
// User is not authenticated.
return c.json({ error: 'Unathenticated' }, 401);
}
}
// Access environment variables and secrets
{
console.debug('Variables', c.env.SOME_KEY, c.env.ANOTHER_KEY);
console.debug(
'Secrets',
c.env.ACTUAL_SECRET_KEY,
c.env.COMMON_VERY_SECRET_KEY
);
}
// Access database and return query result
{
const result = await c.env.db.prepare('PRAGMA table_info(users)').run();
return c.json({ result });
}
});
export default service;š License
This project is licensed under the MIT License - see the LICENSE file for details.
š¬ Support & Community
If you have any questions or feedback:
- Follow @calljmpdev
- Join the Calljmp Discord
- Open an issue in the GitHub repo
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago