The Dart client for Teta CMS. Our mission is to help people build amazing products.

Overview

Teta CMS

pub package

The Dart client for Teta CMS

Teta dashboard screenshots

Introducing Teta CMS

Teta CMS is a low-code back-end service. We provide:

  • Scalable NoSQL database
  • Real-time subscriptions
  • User authentication system and policies
  • Perform custom queries on your collections with our Ayaya language
  • Use an easy-to-use and responsive user interface

Getting Started

To use Teta CMS you have to create first a project on Teta.so

Compatibility

Auth Database Ayaya Realtime Analytics
Android
iOS
Web
macOS Coming soon
Windows Coming soon
Linux Coming soon

Examples

Initialize

To get the credentials, go to Teta > project dashboard > Getting Started

Since you call the .initialize method, you are able to use Teta.instance anywhere in your application

import 'package:teta_cms/teta_cms.dart';

void main() {
  TetaCMS.initialize(
    token: prjToken,
    prjId: prjId,
  );
  
  runApp(
    // Your app...
  );
}

Database with custom query

Making a query with the Ayaya language

// Fetch all docs in `CollectionA` created less than a week, ordering by `created_at`
final response = await TetaCMS.instance.client.query(
  r'''
    MATCH name EQ CollectionA;
    IN docs;
    MATCH created_at GT DATESUB($now $week);
    SORT created_at -1;
    LIMIT 20;
  ''', 
);

// Check if it returns an error
if (response.error != null) {
  debugPrint('${response.error?.message}');
} else {
  // Safe to use response.data 🎉
}

With Ayaya, you can join two or more collections:

// Fetch all docs in `Collection1` and `Collection2`
final response = await TetaCMS.instance.client.query(
  '''
    MATCHOR name EQ Collection1 name EQ Collection2;
  ''', 
);

Fetch docs

// Fetch all docs by `collectionId`, ordering and filtering
final List<dynamic> response = await TetaCMS.instance.client.getCollection(
  collectionId, // You can retrieve this from your project dashboard
  limit: 10,
  page: 0,
  showDrafts: false,
  filters: [
    Filter(
      'Key',
      'Value',
      type: FilterType.like,
    ),
  ],
);

Or you can use our TetaFutureBuilder. It manages the cache by preventing unwanted calls.

TetaFutureBuilder(
  future: TetaCMS.instance.client.getCollection(
    collectionId, // You can retrieve this from your project dashboard
  ), 
  builder: (final context, final snap) {
    // build your widgets with snap.data as List<dynamic>
  },
);

TetaFutureBuilder supports any future. You can also use it to run an Ayaya query.

See other examples.

Realtime

// Stream all docs by `collectionId` ordering and filtering
final StreamController<List<dynamic>> controller = TetaCMS.instance.realtime.streamCollection(
  collectionId, // You can retrieve this from your project dashboard
  limit: 10,
  page: 0,
  showDrafts: false,
  filters: [
    Filter(
      'Key',
      'Value',
      type: FilterType.like,
    ),
  ],
);

// Remember to close it when you're done
controller.close();

Or you can use our TetaStreamBuilder. It manages the cache by preventing unwanted calls and closes the stream controller at the dispose event.

TetaStreamBuilder(
  stream: TetaCMS.instance.realtime.streamCollection(
    collectionId, // You can retrieve this from your project dashboard
  ), 
  builder: (final context, final snap) {
    // build your widgets with snap.data as List<dynamic>
  },
);

Social authentication

// Sign up user with Apple OAuth provider
TetaCMS.instance.auth.signIn(
  provider: TetaProvider.apple,
  onSuccess: (final isFirstTime) async {
    // Success 🎉
  );
);

The isFirstTime flag tells us whether the user is a first-time login, which is useful if we only need to perform actions for the first time.​

Retrieve current user

// Get the current user
final TetaUser user = await TetaCMS.instance.auth.user.get;
if (user.isLogged) {
  // The user is logged 🎉
} else {
  // There is no current user
}

Sign Out

await TetaCMS.instance.auth.signOut();

Teta Auth configuration

Authentication with Teta CMS works by opening a browser to allow people to log in using different providers. This method allows us to write much less code.

To open a browser and return to the application after successful login, you need to configure the deeplink in your application.

Set your redirect URL

  • Go to app.teta.so > Project dashboard > Users > Config
  • Fill the Redirect Url field (eg. com.example.app://welcome following the format SCHEME://HOSTNAME)

Teta Auth redirect URL field

Teta social OAuth config

Follow our docs for the following OAuth providers:

Android

Declare your Redirect Url inside the ActivityManifest.xml file. In this example we are using the value com.example.app://welcome

<manifest ...>
  <application ...>
    <activity ...>
      <!-- ... -->

      <!-- Teta Auth Deeplink -->
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- Your redirect URL -->
        <data
          android:scheme="com.example.app"
          android:host="welcome" />
      </intent-filter>
    </activity>
  </application>
</manifest>

Android docs: https://developer.android.com/training/app-links/deep-linking

iOS

Declare your Redirect Url inside the ios/Runner/Info.plist file. In this example we are using the value com.example.app://welcome

<plist>
<dict>
  <!-- Teta Auth Deeplink -->
  <key>CFBundleURLTypes</key>
  <array>
    <dict>
      <key>CFBundleTypeRole</key>
      <string>Editor</string>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>com.example.app</string>
      </array>
    </dict>
  </array>
  <!-- ... -->
</dict>
</plist>

Apple docs: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app

Web

Nothing needs to be set up for the Web.

Windows, macOS, Linux

Authentication for desktop platforms is coming soon.


Tutorials

This section will be updated whenever a new tutorial is released

Docs

See our Flutter docs on teta.so/flutter-docs

Teta CMS is still in open alpha

  • Closed Alpha;
  • Open Alpha: We could still introduce some big changes;
  • Open Alpha: Expect bugs, but it is ready for testing and side projects;
  • Beta: first stable version;
  • Teta: we are finally full Teta;

We are just at the beginning, and we still have a long way to go.

Let us know what you think, we thank you for your support :)

Reaction

Comments
  • Mey

    Mey

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Smartphone (please complete the following information):

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Browser [e.g. stock browser, safari]
    • Version [e.g. 22]

    Additional context Add any other context about the problem here.

    opened by Vinod0224 0
  • https://app.clickup.com/t/2f35egn

    https://app.clickup.com/t/2f35egn

    • decoupled logic for TetaStore
    • created mappers
    • added service locator
    • added dependency injection
    • added template response

    https://app.clickup.com/t/2f35egn

    opened by AndreiCosmaTeta 0
  • Unable to change AppIcon and to Duplicate pages

    Unable to change AppIcon and to Duplicate pages

    Description of the bugs

    1. I'm trying to change the app icon to the required characteristics (The icon must be 1024 x 1024 px, .png format and must not be transparent) but nothing happens, it is not updated nor do I get any popup mistake.

    2. When I try to duplicate a pre-existing page of a new project, the loader reloads the screen without duplicating it; when I try to duplicate a page I created of a new project, the loader appears but never completes the load

    I tried to verify these operations also from other devices (such as in phone apps or from other computers) but I am still unable to change the app icon or duplicate a page

    opened by dauria-dev 0
  • User problems

    User problems

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    opened by Mohammed-App-creater 2
  • signIn with google teta AUTH

    signIn with google teta AUTH

    signIn {"error":"request to https://public.teta.so:9840/auth/credentials/services/107961 failed, reason: certificate has expired"} Error: Exception: signIn resulted in 500 at Object.throw_ [as throw] (http://localhost:37503/dart_sdk.js:5080:11) at auth.TetaAuth.new._signIn (http://localhost:37503/packages/teta_cms/src/index.dart.lib.js:1586:21) at _signIn.next () at http://localhost:37503/dart_sdk.js:40641:33 at _RootZone.runUnary (http://localhost:37503/dart_sdk.js:40511:59) at _FutureListener.thenAwait.handleValue (http://localhost:37503/dart_sdk.js:35438:29) at handleValueCallback (http://localhost:37503/dart_sdk.js:35999:49) at _Future._propagateToListeners (http://localhost:37503/dart_sdk.js:36037:17) at [_completeWithValue] (http://localhost:37503/dart_sdk.js:35872:23) at async._AsyncCallbackEntry.new.callback (http://localhost:37503/dart_sdk.js:35906:35) at Object._microtaskLoop (http://localhost:37503/dart_sdk.js:40778:13) at _startMicrotaskLoop (http://localhost:37503/dart_sdk.js:40784:13) at http://localhost:37503/dart_sdk.js:36261:9 Application finished.

    opened by steyagri 0
A Marvel Heroes and Comics guide, built with Flutter and MarvelAPI to help people get to know more about this amazing universe

?? Marvel Guide ?? ?? Project A Marvel Heroes and Comics guide, built with Flutter and MarvelAPI to help people get to know more about this amazing un

Gustavo T. Chinalia 3 Aug 30, 2022
mypro immobilier app created to manage our real estate agency, we can store products, contacts and transactions..

mypro_immobilier A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

soufiane bouchtaoui 1 Dec 11, 2021
Let's setup Firebase​​ for our Flutter​​ app on Android​, iOS​ and Flutter Web. Setup Firebase to use Firebase products.

Flutter Tutorial - Firebase Setup For Flutter Web Let's setup Firebase for our Flutter app on Android, iOS and Flutter Web. Setup Firebase to use Fire

null 1 Apr 27, 2022
Our application, MyArmyPal serves to be an all in one service for our service men.

Our application, MyArmyPal serves to be an all in one service for our service men. It seeks to provide convenience and useful features just one tap away. Its main features include an IPPT Calculator, reservist checklist, customized IPPT training plan according to the user's current fitness level and a canteen order pick up service in all army camps. We are also implementing an anytime Eliss system using computer vision for users to check on their push up form easily.

Poh Wei Pin 3 Jun 17, 2022
A flutter project for amfoss cms

cms_mobile cms-mobile is a flutter application for the amFOSS CMS. Using the application, club members can login into the CMS and view club attendence

FOSS@Amrita 501 Dec 29, 2022
This is the flutter mobile application for active ecommerce cms by : Ahd Marouane

active-ecom-flutter-app This is the flutter mobile application for active ecommerce cms by : Ahd Marouane Getting Started This project is a starting p

Ahd Marouane (عهد) 4 Jun 19, 2022
Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.

supabase_flutter Flutter package for Supabase. What is Supabase Supabase is an open source Firebase alternative. We are a service to: listen to databa

Supabase 251 Jan 7, 2023
Aditya 93 Dec 25, 2022
A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.

Ably Flutter Plugin A Flutter plugin wrapping the ably-cocoa (iOS) and ably-java (Android) client library SDKs for Ably, the platform that powers sync

Ably Realtime - our client library SDKs and libraries 46 Dec 13, 2022
Recipes app in flutter using API to get data. Amazing Recipes app UI in Flutter using dart with simple widgets.

Food Recipe App In Flutter Using API'S Recipe App in Flutter Subscribe Our YouTube Channel. Visit Website Demo OutPut Images ## ?? Links Getting Start

Habib ullah 2 Dec 26, 2022
Expense tracker - Build an app in flutter that can record the transaction we make in our daily life

expense_tracker I tried to build an app in flutter that can record the transacti

Shishir Rijal 6 Nov 6, 2022
This is a on-demend food delivery app specifically for learning and exploring flutter amazing framework

This is a on-demend food delivery app specifically for learning and exploring flutter amazing framework. This Project is developed to help beginners, intermediates and sometime advance to know better about using Firebase services and tools, different flutter state management solutions, complex navigations, realtime control over maps, understanding payments etc.

Paul Edeme'kong - Flutter Fairy 15 Nov 5, 2022
This project provides an amazing widget for using the specific inputfield for the specific platform

This project provides an amazing widget for using the specific inputfield for the specific platform

Kovács Levente 0 Apr 12, 2022
A flutter app that help the visually/auditory/speech impaired people cope with their surroundings and get assistance

Lumos Introduction ?? Despite the advancement of tools and technologies, mankind

R Adithya Kumar 11 Aug 8, 2022
Lost and Found is an app to help people find their lost items.

lost_and_found A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

SonaCodeur 1 Jan 20, 2022
An app made in Flutter to help people choose the colors they will use in their projects!

Color Picker An app made in Flutter to help people choose the colors they will use in their projects! Features Pick a color from a picker wheel, palet

Bruno D'Luka 50 Nov 27, 2022
IMP - an innovative open source application that will help people memorize text more easily

InnoMemorizerApp IMP - an innovative open source application that will help people memorize text more easily Home page Upload page Home page provides

null 3 Jul 13, 2022
This project is a NGO which let you donate anything or even let you ask for help to people.

ngo_app This app is written in flutter using dart language. Getting Started This project is a NGO which let you donate anything or even let you ask fo

null 1 May 8, 2022
A renting platform to rent products

Welcome to RentALL Mobile App ?? A renting platform to rent products APP PREVIEW Install flutter create . Usage flutter run Run tests f5 / debug ?? Ak

Akshat Sachan 24 Aug 19, 2022