Giter VIP home page Giter VIP logo

genezio's Introduction


The easiest way to write and host a serverless application


unit-tests windows-integration-tests-prod linux-integration-tests-prod

npm-downloads

npm-version PRs Welcome

Join our community Follow @geneziodev

What is genezio?

genezio is a developer platform for full-stack developers or teams who need to build, run and maintain web, mobile or enterprise apps with a typesafe backend that scales automatically.

For more details on how to use genezio, you can check out the official documentation.

โญ If you want to support the genezio community, give us a star on this repo โญ

Contents

Features

  • ๐Ÿš€ Function-as-a-service: No need to worry about infrastructure, scaling, or maintenance.
  • ๐Ÿ“ฆ Genezio Functions: Deploy and run code on-demand without managing servers or infrastructure.
  • ๐Ÿ’ก Full static type-safety with auto-completion in your favorite editor.
  • ๐Ÿงฉ Typesafe RPC: Ensuring type safety and IDE auto-completion across diverse languages like TypeScript, Dart, Kotlin and Go, by leveraging advanced code analysis.
  • ๐Ÿš€ Tested and production ready for Javascript/Typescript.
    • Beta support for: GoLang, Kotlin and Dart.
  • ๐Ÿ“ฆ NPM Registry - the client SDK is pushed to a private or public registry.
  • ๐ŸŒ Framework agnostic: works with React, Vue, Angular, Flutter, Svelte, etc.
  • ๐ŸŽฏ Seamless Bundling and Compiling
  • โšก Deploy with one command the backend and the frontend.
  • ๐Ÿ”„ Multiple staging environments supported as well as local development environment.
  • ๐Ÿ–ฅ๏ธ Dashboard: explore logs, env variables for different environments, Test interface and easy to access third party integration.
  • ๐Ÿ‘ฅ Collaboration: work alone or as a team - share the projects and dashboard features between team members with different access rights.
  • โžฐ Queues: use them for your automation apps.
  • ๐Ÿ—„ Databases: provisioned by us or you can bring your own. The database is not exposed to the frontend directly. Table creation and CRUD boilerplate functions generated through LLM.
  • ๐Ÿ•’ Cron jobs: scheduled to be executed up to a minute granularity.

Getting Started

Check out our Getting started documentation page to find out how to start using Genezio.

For more details about the genezio CLI commands, run genezio help or genezio [command] help.

Test your project using the Test Interface

You can also test your code locally by running the following command in the server directory.

genezio local

This will spawn a local server that can be used for testing. Now, you can navigate to the Test Interface and test your project locally from GUI.

Test Interface

Once you are happy with your project, you can deploy it in a production environment by running: genezio deploy.

Commands Summary

The genezio CLI tool supports the commands shown in the following table:

Command Description
genezio create Create a new fullstack project from templates Learn more
genezio local --port <port> Runs a local environment with your project for testing purposes. Learn more
genezio deploy Deploys your project to the genezio infrastructure. Learn more
genezio list [<identifier>] Displays details of your projects. You can view them all at once or display a particular one by providing its name or ID. Learn more
genezio delete [<project-id>] Deletes the project described by the provided ID. If no ID is provided, lists all the projects and IDs. Learn more
genezio sdk Generates an SDK corresponding to a deployed project. Learn more
genezio account Display information about the current account logged in. Learn more
genezio login <access-token> Authenticates with genezio platform to deploy your code. Learn more
genezio logout Logout from genezio platform. Learn more
genezio help / genezio <command> --help Displays help for the CLI tool.

Examples deployed with genezio

You can find out more about genezio from our examples repository.

Official documentation

How does genezio work?

genezio is using JSON RPC 2.0 to facilitate the communication between SDK and your class. Your functions are deployed in the Genezio infrastructure. The functions are not executed on a long lasting Virtual Machine. Instead, our system uses a serverless approach. Whenever a request is received, your code is loaded and executed. This is more cost and energy efficient. However, the developer needs to take into account the following - the values of the global variables are not persistent between runs.

Type safety is ensured by the generated SDK, even if the server and the client are not written in the same language. The CLI tool analyzes the server code generates client side types equivalent to the server side types, as well as functions with equivalent signatures.

Detailed documentation

To find more details on how to use genezio, check out the official documentation:

If you cannot find what you are looking for in the docs, don't hesitate to drop us a GitHub issue or start a discussion on Discord.

Getting support

We want you to get your project up and running in no-time.

If you find yourself in a pickle using genezio, drop us a GitHub issue, start a discussion with us on Discord or drop us an email at [email protected].

System requirements

  • genezio can be installed and used on macOS, Linux-based distributions and Windows.
  • A version of node >= 18 should be installed on your machine.

Troubleshooting

For the most common issues that our users have dealt with, we created a Troubleshooting section in the documentation.

If you don't find the guidance there, drop us a GitHub issue. We are more than happy to help you!

Contributing

Contributions are welcome! Please see our Contributing Guide for more details.

Show your support by giving us a star โญ, to help others discover genezio and become part of our community!

Ecosystem

There are a growing number of awesome projects deployed with genezio and we want to shout out about them.

If you deployed a project using genezio let us know on Discord and we will add it to our Hall Of Fame.

Community projects

Below you can find projects build by the community and deployed with genezio.

Check them out for inspiration:

If you've also built a project that you are proud of, please open a Pull Request adding it or let us know on Discord.

Badge

Brag to your friends that you are using genezio with this awesome badge -> deployed with: genezio

[![deployed with: genezio](https://img.shields.io/badge/deployed_with-genezio-6742c1.svg?labelColor=62C353&style=flat)](https://github.com/genez-io/genezio)

License

genezio is licensed under GNU General Public License v3.0. For more information, please refer to LICENSE.

genezio's People

Contributors

adriangeorge avatar andreia-oca avatar costinsin avatar cristim67 avatar dependabot[bot] avatar github-actions[bot] avatar laurci avatar magodelblocco avatar paulacionca avatar radu1122 avatar stefandarius avatar tudor-ang avatar tudorpip avatar valighita avatar virgil993 avatar vladiulianbogdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

genezio's Issues

Module not found `Error: Can't resolve 'https'`

I am trying to run the todo-list app from the genezio examples.

genezio local runs successfully, but when I am trying to start the frontend with npm start, I am receiving the following errors:

ERROR in ./src/sdk/remote.js 7:0-26
Module not found: Error: Can't resolve 'https' in '/home/andreia/genezio-examples/javascript/todo-list/client/src/sdk'

and

ERROR in ./src/sdk/remote.js 8:0-24
Module not found: Error: Can't resolve 'http' in '/home/andreia/genezio-examples/javascript/todo-list/client/src/sdk'

I will leave below the contents of my genezio.yaml config file:

name: todo-list
region: us-east-1
sdk:
  language: js
  options:
    runtime: node
  path: ../client/src/sdk
frontend:
  path: ../client/build
classes:
  - path: ./task.js
    type: jsonrpc
    methods: []
  - path: ./user.js
    type: jsonrpc
    methods: []

It seems to me that the SDK was not generated correctly. Do you have any idea how to fix it?

[Bug]: Genezio Local doesn't refresh if the path contains `(` or if it has `~` at the end of the path

Describe your bug

When running genezio local and listening for changes, the watcher will not refresh if the path it needs to watch contains the ( character or if the path end with the ~ character. This is due to a known issue with the chokidar library which provides the watcher.

genezio version

0.6.3

genezio configuration file

No response

What browsers are you seeing the problem on?

No response

Relevant log output

No response

[Improvement task]: The stdout output from "scripts" is spamming and hiding relevant information

Describe your task

The "scripts" property from genezio.yaml is a way to run various commands at certain events that occur during the deployment: preBackendDeploy, postBackendDeploy, preFrontendDeploy, postFrontendDeploy. For example, one can specify that the npm install command should be executed before the execution of the deployment.

The problem now is that when these commands are executed, their stdout is also displayed to the user. This hides relevant information such as the link of the application.

Example of output:

Before this change:

iulian-bogdanvlad@Iulian-Bogdans-MacBook-Pro getting-started % genezio deploy --logLevel info
Running preBackendDeploy script...

up to date, audited 107 packages in 2s

5 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (1 moderate, 5 high, 1 critical)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.


Bundling your code...โœ…

Deploying your backend project to genezio infrastructure...
Uploading TaskService: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ | 100% | 0s
Checking your credentials...โœ…
Deploying...crossing our fingers...โœ…
Doing the final touch-ups...โœ…

Your code was deployed and the SDK was successfully generated!
Your SDK is ready to be used. To import it in your client project, run npm install @genezio-sdk/[email protected] in your client's root folder.
Your backend project has been deployed and is available at https://dev.app.genez.io/project/3197ba04-7361-44ea-a77e-26bc1d55975b
Running preFrontendDeploy script...
npm run install-prod-sdk && npm install && npm run build

> [email protected] install-prod-sdk
> npm install @genezio-sdk/[email protected]


up to date, audited 1465 packages in 6s

212 packages are looking for funding
  run `npm fund` for details

18 vulnerabilities (6 moderate, 10 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

up to date, audited 1465 packages in 3s

212 packages are looking for funding
  run `npm fund` for details

18 vulnerabilities (6 moderate, 10 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> [email protected] build
> react-scripts build

Creating an optimized production build...
Compiled with warnings.

Critical dependency: the request of a dependency is an expression

Critical dependency: the request of a dependency is an expression

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

  91.67 kB  build/static/js/main.1edc3502.js
  28.01 kB  build/static/css/main.85768c17.css
  1.79 kB   build/static/js/787.3dd23931.chunk.js

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  serve -s build

Find out more about deployment here:

  https://cra.link/deployment


Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

Deploying your frontend to genezio infrastructure...
Frontend successfully deployed at https://plum-excess-tarantula.dev.app.genez.io.

After the change:

iulian-bogdanvlad@Iulian-Bogdans-MacBook-Pro getting-started % genezio deploy --logLevel info
Running preBackendDeploy script...
Bundling your code...โœ…

Deploying your backend project to genezio infrastructure...
Uploading TaskService: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ | 100% | 0s
Checking your credentials...โœ…
Deploying...crossing our fingers...โœ…
Doing the final touch-ups...โœ…

Your code was deployed and the SDK was successfully generated!
Your SDK is ready to be used. To import it in your client project, run npm install @genezio-sdk/[email protected] in your client's root folder.
Your backend project has been deployed and is available at https://dev.app.genez.io/project/3197ba04-7361-44ea-a77e-26bc1d55975b
Running preFrontendDeploy script...
Deploying your frontend to genezio infrastructure...
Frontend successfully deployed at https://plum-excess-tarantula.dev.app.genez.io.

Stderr should still be displayed.

Module has no default export and Parameter 'err' implicitly has an 'any' type.

I am creating a TypeScript todo app from scratch and I am receiving the following errors when running genezio local.
I am pretty sure that I have all the packages installed with npm install and they are added as dependencies in package.json.

Syntax error:
[tsl] ERROR in /home/andreia/genezio-examples/typescript/todo-list/server/user.ts(2,8)
      TS1192: Module '"/home/andreia/genezio-examples/typescript/todo-list/server/node_modules/@types/jsonwebtoken/index"' has no default export.
 Syntax error:
[tsl] ERROR in /home/andreia/genezio-examples/typescript/todo-list/server/helper.ts(2,8)
      TS1192: Module '"/home/andreia/genezio-examples/typescript/todo-list/server/node_modules/@types/bcryptjs/index"' has no default export.

Can you help me to figure it out?

[Bug fix]: At deployment, exclude source code files that are not used

Describe your task

This task is a bug fix.

Steps to reproduce the bug:

  1. Clone any genezio example - e.g. the typescript getting started example[1].
  2. Create a new .ts file on the server side and write something that generates a typescript error in it - for example:
export class TaskService {
    constructor() {
        this.fail(); // this method is not declared, so it will fail
    }
}
  1. Run genezio deploy.
  2. The process will fail:
Bundling your code...
|  [2023-10-23T14:36:33.672Z] DEBUG: The bundling process has started for file ./task.ts...
[2023-10-23T14:36:33.947Z] DEBUG: Typechecking Typescript files...
bug.ts(3,14): error TS2339: Property 'fail' does not exist on type 'TaskService'.

Typescript compilation failed.

This is not the expected behavior.

The deployment process should successfully end because the newly created file/class is not included in the genezio.yaml, hence it shouldn't be part of the deployment bundle.

[1] https://github.com/Genez-io/genezio-examples/tree/main/typescript/getting-started

[Improvement task]: "scripts" should also have an array of commands

Describe your task

The "scripts" property from genezio.yaml is a way to run various commands at certain events that occur during the deployment: preBackendDeploy, postBackendDeploy, preFrontendDeploy, postFrontendDeploy. For example, one can specify that the npm install command should be executed before the execution of the deployment.

Right now, if a user wants to run multiple commands, we use && between them. Example:

scripts: 
  preFrontendDeploy: npm run install-prod-sdk && npm install && npm run build 

However, this is problematic because this is not cross platform.

I propose to have each hook be either a string or an string[]. The YamlScriptsConfiguration would become:

export class YamlScriptsConfiguration {
  preBackendDeploy?: string|string[];
  postBackendDeploy?: string|string[];
  postFrontendDeploy?: string|string[];
  preFrontendDeploy?: string|string[];
}

Then the scripts can be written like this:

scripts: 
  preFrontendDeploy:
    - npm run install-prod-sdk
    - npm install
    - npm run build 

[Bug]: .genezioignore doesn't behave correctly with relative paths

Describe your bug

For a simple empty project that looks like this:

temp
โ”œโ”€โ”€ .genezioignore
โ”œโ”€โ”€ genezio.yaml
โ”œโ”€โ”€ test
โ”‚ย ย  โ”œโ”€โ”€ 1
โ”‚ย ย  โ”œโ”€โ”€ 2
โ”‚ย ย  โ”œโ”€โ”€ 3
โ”‚ย ย  โ”œโ”€โ”€ 4
โ”‚ย ย  โ””โ”€โ”€ 5
โ””โ”€โ”€ test.js

And the following .genezioignore file:

test/

I would expect genezio deploy to include only the following 3 files:

.genezioignore
genezio.yaml
test.js

Instead, it includes the following 9 files:

.genezioignore
genezio.yaml
test
test.js
1
2
3
4

Small improvement

Related to the same problem, another inconvenience is that I can't negate matches. For example, I would assume that !test/1 would include only test/1 and exclude everything else. But this is not mentioned in the documentation as working, so it's not a bug.

genezio version

0.6.4

genezio configuration file

No response

What browsers are you seeing the problem on?

No response

Relevant log output

No response

[Improvement task]: Improve reading/updating the genezio configuration file

Describe your task

To configure the deployment settings, we are using an YAML file usually named genezio.yaml in the codebase.

Right now, the reading from/writing to genezio.yaml is pretty naive.
With this task we want to add the following features:

  • preserve line and inline comments
  • preserve the keys order when updating the YAML file

The method of interest are writeToFile[1], readUTF8File[2], parse[3] and (imported from a yaml library) and YamlProjectConfiguration.writeToFile[4]. [1][2] are generic methods that probably should be modified.

Things to consider:

  • genezio.yaml will evolve over time, the fields are going to change. We should not change the reading/updating every time we make a change in the yaml structure.
  • writeToFile and readUTF8File are generic reading/writing methods used throughout our codebase for other files too. This task should not modify the behavior from other code flows.

This task should also add unit tests to make sure that the functionality is correct.

To set up genezio on your machine and test out a solution to this task, follow the steps from the contributing file [5]

[1]

export function writeToFile(

[2]
export function readUTF8File(filePath: string): Promise<string> {

[3]
export async function getProjectConfiguration(
configurationFilePath = "./genezio.yaml"
): Promise<YamlProjectConfiguration> {
if (!(await checkYamlFileExists(configurationFilePath))) {
throw new Error("The configuration file does not exist.");
}
const genezioYamlPath = path.join(configurationFilePath);
const configurationFileContentUTF8 = await readUTF8File(genezioYamlPath);
let configurationFileContent = null;
try {
configurationFileContent = await parse(configurationFileContentUTF8);
} catch (error) {
throw new Error(`The configuration yaml file is not valid.\n${error}`);
}
const projectConfiguration = await YamlProjectConfiguration.create(
configurationFileContent
);
return projectConfiguration;
}

[4]
async writeToFile(path = "./genezio.yaml") {

[5] https://github.com/Genez-io/genezio/blob/master/CONTRIBUTING.md

[Improvement task]: Improve `genezio addClass` output

Describe your task

The output for genezio addClass should be improved, especially the error messages. RIght now, the messages are a bit misleading.

For example, the following output is misleading because it does not have all the information required to fix the issue:

$ genezio addClass myClass
Please provide a class name with a valid class extension.

This error message should also indicate that genezio addClass expects a filename that contains a supported extension (.ts, .js and .dart).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.