ZAPP

Follow @EpicsDAO

Zapp

Rust Serverless Framework

The Zapp project was launched with the goal of reducing software development, operation and maintenance costs.

Build Serverless Apps faster. Powered by Rust, Aysnc-GraphQL, SeaORM, Axum, and Google Cloud.

Dependency

Cloud Infrastructure

Installation

bash $ cargo install zapp

```bash zapp --help EpicsDAO Rust Serverless Framework

USAGE: zapp

OPTIONS: -h, --help Print help information -V, --version Print version information

SUBCOMMANDS: compute
db
docker
g
gh
help Print this message or the help of the given subcommand(s) iam
init
new
run
sql
```

QuickStart

Create your application with zapp CLI. ```bash $ zapp new YOURAPP

███████╗ █████╗ ██████╗ ██████╗ ╚══███╔╝██╔══██╗██╔══██╗██╔══██╗ ███╔╝ ███████║██████╔╝██████╔╝ ███╔╝ ██╔══██║██╔═══╝ ██╔═══╝ ███████╗██║ ██║██║ ██║
╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝
💃 💃 💃 💃 💃 💃 💃 💃 💃 💃 💃 💃 Rust Serverless Framework $ cd YOURAPP $ zapp docker psql $ cargo run

Go to : http://localhost:3000/api/graphql ```

Create Docker PostgreSQL bash $ zapp docker psql ✅ PostgreSQL Container Created: 4619cfc047f3cad6c9db8d255aff841fbfe34bbef0e2661fa3a02db5d5ec5d91

Run GraphQL Local Server bash $ cargo run

Now go to

http://localhost:3000/api/graphql

GraphQL Mutation/Query Scaffold

Create Model bash $ zapp g model user ✅ Successfully created migration file: migration/src/m20220612_211439_create_user_table.rs ✅ Successfully created entity file: entity/src/user.rs ✅ Successfully created mutation file: src/graphql/mutation/user.rs ✅ Successfully created query file: src/graphql/query/user.rs ✅ Successfully added mutation route: src/graphql/mutation/mod.rs ✅ Successfully added mutation route: src/graphql/query/mod.rs

DB Migrate

DB Migrate bash $ zapp db migrate ✅ Successfully DB migrated

Deploy to Google Cloud Run

Github CLI Auth Login

bash $ gh auth login

Gcloud Auth Login

bash $ gcloud auth login

1. Generate Your Application

bash $ zapp new YOURAPP $ cd YOURAPP

2. Create GitHub

Let's create a new repository on GitHub.

GitHub link

After creating a new repository on the above site, upload the source code with the following command.

Run from the mother directory.

bash $ git add . $ git commit -m 'first commit' $ git remote add origin git@github.com:YOURREPO/YOURAPP.git $ git push origin main

3. Create A Google Cloud Project

If you have never used Google Cloud before, use this link to create a project.

How to create a project

4. Setup Cloud Compute Network

bash $ zapp compute setup

5. Push it to Github

GitHub Actions start when you make some changes at main branch.

bash $ git add . $ git commit -m 'first deploy' $ git push origin main

Your APP is all set!

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/EpicsDao/zapp. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the Apache-2.0 License.

Code of Conduct

Everyone interacting in the EpicsDAO project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.