Giter Site home page Giter Site logo

spacecloud-io / space-cloud Goto Github PK

View Code? Open in Web Editor NEW
3.9K 58.0 212.0 68.03 MB

Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes

Home Page: https://space-cloud.io

License: Apache License 2.0

Go 98.35% Dockerfile 0.05% Shell 0.24% Scala 1.28% PowerShell 0.08%
serverless database graphql kubernetes firebase mysql postgres mongodb microservice microservices event-driven realtime paas baas mssql

space-cloud's Introduction

SpaceCloud is currently in maintaiance mode. Checkout Hasura or Wundergraph instead.

Space Cloud

Develop, Deploy and Secure Serverless Apps on Kubernetes.

WebsiteDocsSupport


Go Report Card Apache License

Space Cloud is a Kubernetes based serverless platform that provides instant, realtime APIs on any database, with event triggers and unified APIs for your custom business logic.

Space Cloud helps you build modern applications without having to write any backend code in most cases.

It provides GraphQL and REST APIs which can be consumed directly by your frontend in a secure manner.

Features

View complete feature set here.

  • Powerful CRUD: Flexible queries, transactions, aggregations and cross-database joins
  • Realtime: Make live queries to your database
  • File storage: Upload/download files to scalable file stores (e.g., Amazon S3, Google Cloud Storage)
  • Extensible: Unified APIs for your custom HTTP services
  • Event-driven: Trigger webhooks or serverless functions on database or file storage events
  • Fine-grained access control: Dynamic access control that integrates with your auth system (e.g., auth0, firebase-auth)
  • Scalable: Written in Golang, it follows cloud-native practices and scales horizontally
  • Service Mesh: Get all the capabilities of a service mesh without having to learn any of that!
  • Scale down to zero: Auto scale your http workloads including scaling down to zero

Supported databases ❤️:

  • MongoDB
  • PostgreSQL and PostgreSQL compatible databases (For eg. CockroachDB, Yugabyte, etc.)
  • MySQL and MySQL compatible databases (For eg. TiDB, MariaDB, etc.)
  • SQL Server

Table of Contents

Quick start

If you are new to Space Cloud, we strongly recommend following our step-by-step guide to get started

Other guides

View the installation guides for Docker and Kubernetes.

Client-side tooling

Space Cloud exposes GraphQL and REST APIs. See setting up project guide to choose a client and set it up.

GraphQL APIs

GraphQL is the recommended way to use Space cloud, and it works with any GraphQL client. However, we recommend using Apollo Client. See awesome-graphql for a list of clients.

REST APIs

You can use the REST APIs of Space Cloud if you are more comfortable with REST.

To make it easy to consume the REST APIs in web projects, we have created a Javascript SDK for you.

How it works

Space Cloud is meant to replace any backend php, nodejs, java code you may write to create your endpoints. Instead, it exposes your database over an external API that can be consumed directly from the frontend. In other words, it allows clients to fire database queries directly.

However, it's important to note that the client does not send database (SQL) queries to Space Cloud. Instead, it sends an object describing the query to be executed. This object is first validated by Space Cloud (using security rules). Once the client is authorized to make the request, a database query is dynamically generated and executed. The results are sent directly to the concerned client.

We understand that not every app can be built using only CRUD operations. Sometimes it's necessary to write business logic. For such cases, Space Cloud allows you to access your custom HTTP servers via the same consistent APIs of Space Cloud. In this scenario, Space Cloud acts merely as an API gateway between your services and the client. However, the cool part is that you can even perform joins on your microservices and database via the GraphQL API of Space Cloud.

Detailed Space Cloud architecture

Space Cloud integrates with Kubernetes and Istio natively to bring to you a highly scalable Serverless Platform. It encrypts all traffic by default and lets you describe communication policies to protect your microservices.

With that, it also provides autoscaling functionality out of the box including scaling down to zero.

Support & Troubleshooting

The documentation and community should help you troubleshoot most issues. If you have encountered a bug or need to get in touch with us, you can contact us using one of the following channels:

Contributing

Space Cloud is a young project. We'd love to have you onboard if you wish to contribute. To help you get started, here are a few areas you can help us with:

  • Writing the documentation
  • Making sample apps in React, Angular, Android, and any other frontend tech you can think of
  • Deciding the road map of the project
  • Creating issues for any bugs you find
  • And of course, with code for bug fixes and new enhancements

License

Space Cloud is Apache 2.0 licensed.

space-cloud's People

Contributors

10allday avatar akshayjj1997 avatar aliabbasmerchant avatar atharva29 avatar ayan4m1 avatar heyitsjs avatar high-functioning-sociopath avatar inconnu08 avatar ivanoats avatar jcs98 avatar kaivalya97 avatar kavishshah09 avatar khannaabhi avatar khushalpshah avatar ledex avatar michael-orzel avatar nicknonis avatar prakashmishra1598 avatar prithvi081099 avatar rushikesh-kulkarni avatar sarveshkargutkar avatar sharadregoti avatar shreyalaheri avatar shubham4443 avatar sosiska avatar suyash16999 avatar thienpow avatar u5surf avatar vedantparanjape avatar yourtechbud 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  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

space-cloud's Issues

The docs styles isn't proper

I noticed some styling issues with the docs specifically for the code tags. Can we make the long code lines wrap automatically?

Also, it would be great if the width of the docs would be larger on the browser.

AllRequest may be redundant

Currently, server.proto defines BatchRequest in the following way:

message AllRequest {
  string col = 1;
  bytes document = 2;
  string operation = 3;
  bytes find = 4;
  bytes update = 5;
  string type = 6;
}
message BatchRequest {
  repeated AllRequest batchrequest = 1;
  Meta meta = 2;
}

Instead of AllRequest we can directly use the already defined CreateRequest, ReadRequest, etc

message BatchRequest {
  repeated CreateRequest cr = 1;
  repeated ReadRequest rr = 2;
  repeated DeleteRequest dr = 3;
  repeated UpdateRequest ur = 4;
  repeated AggregateRequest ar = 5;
  Meta meta = 6;
}

To be considered:

  1. This new method will remove the AllRequest message.
  2. The predefined messages will be used. This will help to segregate and identify the specific components in the batch request. This may also make it easier to implement in the client modules.
  3. The meta field may be repeated, but we can always omit it in the component CreateRequest, ReadRequest, etc.

Need to improve the docs and quick start

The docs are not good enough. People new to the project won't be able to understand its aim and where it fits. Also the quick start seems to be a bit scattered and doesn't paint a clear picture regarding what it does.

Ability to put raw MongoDB where query in the mongo client sdk !

We are already sending out the where clause as a MongoDB query to the backend. Why not let the user put the raw query directly?

I know this is a request for the client libraries. But lets put it here to keep track. The updates of it being done on individual clients can be done here.

Typo mistake in Readme

The main reason Space Cloud was born was to simplify the app / web development process. Right from making simple CURD CRUD operations to syncing data reliably in a distributed environment, everything must be as simple as a function call.

Add joins to all supported databases

We need to add support for doing joins. In SQL databases it would be a native join while in Mongo it would be an application side join.

The concern I have here is, how will the where (find) clause be applied on the joints table.

Request to allow hosting static files.

It would be really useful if space-cloud allowed the user to host static files as well.
Adding this feature will definitely help space-cloud lift up above the others.

The config file used in the example can be more elaborate

I thing the config file provided in the example here should cover all the possible configuration. Maybe we can put the defaults of each module (enabled = false)?

Also it will be of great help if the config file has helpful comments. The config file should be self documenting.

Need logging in Space Cloud

Currently space cloud doesn't provide any logging. We need a proper logging mechanism with configurable levels.

Typo mistake in Readme

The main reason Space Cloud was born was to simplify the app / web development process. Right from making simple CURD CRUD operations to syncing data reliably in a distributed environment, everything must be as simple as a function call.

Pub sub module

Problem faced right now

There's no way in SC to let users sync data easily without touching the Database module

How can we solve it

We can have a pub sub module built into Space Cloud which lets users to publish and subscribe data.

We need to make sure the security rules are enforced for each object published. Also the consistency level needs to be tunable.

For example, if a client looses the connection due to connectivity issues at the time a data point was published, should he be delivered the message or not?

Loads of things to consider to do this right!

Need to rename transaction to batch in http and gRPC endpoints.

The transaction support we have added works more like a batch. Let's make that more explicit. This will require us refactoring:

  • The https endpoint (url)
  • The gRPC rpc name.
  • The CRUD interface in crud.go and operations.go
  • the func name in sql and mongo packages

API for CRUD needs to be updated

The API for CRUD needs to be updated to make it short and more intuitive.

Here's the current API for javascript:

// Insert one / all:
db.insert(col).one(doc).then(res => ...).catch(ex => ...);
db.insert(col).all(docs).then(res => ...).catch(ex => ...);

// Get one / all:
db.get(col).where(whereClause).one().then(res => ...).catch(ex => ...);
db.get(col).where(whereClause).all().then(res => ...).catch(ex => ...);

// Update one / all:
db.update(col).where(whereClause).set(obj).one().then(res => ...).catch(ex => ...);
db.update(col).where(whereClause).set(obj).all().then(res => ...).catch(ex => ...);

// Delete one / all:
db.delete(col).where(whereClause).one().then(res => ...).catch(ex => ...);
db.delete(col).where(whereClause).all().then(res => ...).catch(ex => ...);

In the new API there should not be explicit one() and all() method. The API should take the default operation type to be all since one is used very rarely and also one is not available on SQL. However, the user should be able to change the op by calling an optional op method. The method apply will actually trigger the request.

This is the new proposal:

// Insert all:
db.insert(col).docs(docs).apply().then(res => ...).catch(ex => ...);
// Insert one:
db.insert(col).doc(doc).apply().then(res => ...).catch(ex => ...);

// Get all:
db.get(col).where(whereClause).apply().then(res => ...).catch(ex => ...);
// Get one:
db.getOne(col).where(whereClause).apply().then(res => ...).catch(ex => ...);
// Get count:
db.count(col).where(whereClause).apply().then(res => ...).catch(ex => ...);
// Get distinct:
db.distinct(col).where(whereClause).apply().then(res => ...).catch(ex => ...);

// Update all:
db.update(col).where(whereClause).set(obj).apply().then(res => ...).catch(ex => ...);
// Update one:
db.updateOne(col).where(whereClause).set(obj).apply().then(res => ...).catch(ex => ...);
// Upsert:
db.upsert(col).where(whereClause).set(obj).apply().then(res => ...).catch(ex => ...);

// Delete all:
db.delete(col).where(whereClause).apply().then(res => ...).catch(ex => ...);
// Delete one:
db.deleteOne(col).where(whereClause).apply().then(res => ...).catch(ex => ...);

unsafe password handling

actual plaintext passwords being sent in user management, really unsafe thing to do. Standard way is to salt the passwords and the compare the hashes, not plain text passwords

What sample apps can we create as use cases for Space Cloud

We should definitely create some use cases. Need ideas on what we can do!

Here are some to get started

  • Realtime chat app with "last seen" and "is typing" feature
  • An IoT Fleet management system
  • a markdown editor where multiple people can collaborate in real time (google docs for markdown
  • an e-commerce portal
  • a social media platform

Even the most craziest of ideas are welcome!

Schema validation

The problem faced right now

There's no way to enforce a schema for schemaless databases(like MongoDB) in SC.

How can it be solved

Allow SC to accept a schema via Mission control for various collections. This schema should have the following field level config optons:

  • Data type (int, string, bool etc)
  • Default value
  • Required
  • Optional encryption / hash / bcrypt operation

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.