Code Monkey home page Code Monkey logo

demo-todo-with-vue's Introduction

Our Appwrite Init event has concluded. You can check out all the new and upcoming features on our Init website ๐Ÿš€


Appwrite Logo

Appwrite is a backend platform for developing Web, Mobile, and Flutter applications. Built with the open source community and optimized for developer experience in the coding languages you love.

We're Hiring Hacktoberfest Discord Build Status X Account

English | ็ฎ€ไฝ“ไธญๆ–‡

Announcing Appwrite Cloud Public Beta! Sign up today!

Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster.

Using Appwrite, you can easily integrate your app with user authentication and multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, Cloud Functions, and more services.


Appwrite - 100% open source alternative for Firebase | Product Hunt

Appwrite

Find out more at: https://appwrite.io

Table of Contents:

Installation

Appwrite is designed to run in a containerized environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool, such as Kubernetes, Docker Swarm, or Rancher.

The easiest way to start running your Appwrite server is by running our docker-compose file. Before running the installation command, make sure you have Docker installed on your machine:

Unix

docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:1.5.4

Windows

CMD

docker run -it --rm ^
    --volume //var/run/docker.sock:/var/run/docker.sock ^
    --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
    --entrypoint="install" ^
    appwrite/appwrite:1.5.4

PowerShell

docker run -it --rm `
    --volume /var/run/docker.sock:/var/run/docker.sock `
    --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
    --entrypoint="install" `
    appwrite/appwrite:1.5.4

Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation.

For advanced production and custom installation, check out our Docker environment variables docs. You can also use our public docker-compose.yml and .env files to manually set up an environment.

Upgrade from an Older Version

If you are upgrading your Appwrite server from an older version, you should use the Appwrite migration tool once your setup is completed. For more information regarding this, check out the Installation Docs.

One-Click Setups

In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running quickly with Appwrite without installing Docker on your local machine.

Choose from one of the providers below:

DigitalOcean Logo
DigitalOcean
Gitpod Logo
Gitpod
Akamai Logo
Akamai Compute

Getting Started

Getting started with Appwrite is as easy as creating a new project, choosing your platform, and integrating its SDK into your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials.

Platform Technology
Web app Quick start for Web
Quick start for Next.js
Quick start for React
Quick start for Vue.js
Quick start for Nuxt
Quick start for SvelteKit
Quick start for Refine
Quick start for Angular
Mobile and Native Quick start for React Native
Quick start for Flutter
Quick start for Apple
Quick start for Android
Server Quick start for Node.js
Quick start for Python
Quick start for .NET
Quick start for Dart
Quick start for Ruby
Quick start for Deno
Quick start for PHP
Quick start for Kotlin
Quick start for Swift

Products

  • Account - Manage current user authentication and account. Track and manage the user sessions, devices, sign-in methods, and security logs.
  • Users - Manage and list all project users when building backend integrations with Server SDKs.
  • Teams - Manage and group users in teams. Manage memberships, invites, and user roles within a team.
  • Databases - Manage databases, collections, and documents. Read, create, update, and delete documents and filter lists of document collections using advanced filters.
  • Storage - Manage storage files. Read, create, delete, and preview files. Manipulate the preview of your files to perfectly fit your app. All files are scanned by ClamAV and stored in a secure and encrypted way.
  • Functions - Customize your Appwrite project by executing your custom code in a secure, isolated environment. You can trigger your code on any Appwrite system event either manually or using a CRON schedule.
  • Messaging - Communicate with your users through push notifications, emails, and SMS text messages using Appwrite Messaging.
  • Realtime - Listen to real-time events for any of your Appwrite services including users, storage, functions, databases, and more.
  • Locale - Track your user's location and manage your app locale-based data.
  • Avatars - Manage your users' avatars, countries' flags, browser icons, and credit card symbols. Generate QR codes from links or plaintext strings.

For the complete API documentation, visit https://appwrite.io/docs. For more tutorials, news and announcements check out our blog and Discord Server.

SDKs

Below is a list of currently supported platforms and languages. If you would like to help us add support to your platform of choice, you can go over to our SDK Generator project and view our contribution guide.

Client

  • โœ… ย  Web (Maintained by the Appwrite Team)
  • โœ… ย  Flutter (Maintained by the Appwrite Team)
  • โœ… ย  Apple (Maintained by the Appwrite Team)
  • โœ… ย  Android (Maintained by the Appwrite Team)
  • โœ… ย  React Native - Beta (Maintained by the Appwrite Team)

Server

  • โœ… ย  NodeJS (Maintained by the Appwrite Team)
  • โœ… ย  PHP (Maintained by the Appwrite Team)
  • โœ… ย  Dart (Maintained by the Appwrite Team)
  • โœ… ย  Deno (Maintained by the Appwrite Team)
  • โœ… ย  Ruby (Maintained by the Appwrite Team)
  • โœ… ย  Python (Maintained by the Appwrite Team)
  • โœ… ย  Kotlin (Maintained by the Appwrite Team)
  • โœ… ย  Swift (Maintained by the Appwrite Team)
  • โœ… ย  .NET - Beta (Maintained by the Appwrite Team)

Community

Looking for more SDKs? - Help us by contributing a pull request to our SDK Generator!

Architecture

Appwrite Architecture

Appwrite uses a microservices architecture that was designed for easy scaling and delegation of responsibilities. In addition, Appwrite supports multiple APIs, such as REST, WebSocket, and GraphQL to allow you to interact with your resources by leveraging your existing knowledge and protocols of choice.

The Appwrite API layer was designed to be extremely fast by leveraging in-memory caching and delegating any heavy-lifting tasks to the Appwrite background workers. The background workers also allow you to precisely control your compute capacity and costs using a message queue to handle the load. You can learn more about our architecture in the contribution guide.

Contributing

All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.

We truly โค๏ธ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the contribution guide.

Security

For security issues, kindly email us at [email protected] instead of posting a public issue on GitHub.

Follow Us

Join our growing community around the world! Check out our official Blog. Follow us on X, LinkedIn, Dev Community or join our live Discord server for more help, ideas, and discussions.

License

This repository is available under the BSD 3-Clause License.

demo-todo-with-vue's People

Contributors

achsuyog avatar adityaoberai avatar ayushpaudel avatar brandonroberts avatar chirag-ghosh avatar christyjacob4 avatar codechef123 avatar eldadfux avatar gewenyu99 avatar hannesfant avatar himanshu007-creator avatar jungne avatar king-11 avatar kohsheen1234 avatar meldiron avatar pierosavi avatar pineappleionic avatar remenyo avatar rzkmak avatar tabuz avatar tafadzwad avatar torstendittmann avatar yash-singh1 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

demo-todo-with-vue's Issues

๐Ÿš€ Feature: Update Vue Demo using Pinia and Composition API, with optional TypeScript and Script Setup syntax sugar

๐Ÿ”– Feature description

Basically, it is just an update to the current vue todo list demo to feature the new features for vite and vue 3, including, but not limited to, composition api, pinia, and script setup.

๐ŸŽค Pitch

Currently, it is seen that the demo project has already used vite under the hood, so why not use some of the new features it had already brought?

These new features include the new composition api, and the equally new <script setup> syntax sugar, which simplifies how we write our script tags in vue, eliminating a lot of boilerplate code and making it feel like a more natural javascript experience.

here's an example from the project's Login.vue component (still working on it though, this code is just for demonstration purposes.):

before

<script>
import { mapActions, mapGetters } from "vuex";
export default {
  name: "Login",
  data() {
    return {
      email: "",
      password: "",
    };
  },
  methods: {
    ...mapActions(["login"]),
    handleLogin(e) {
      e.preventDefault();
      console.log("Form submitted", this.email, this.password);
      this.login({
        email: this.email,
        password: this.password,
      });
    },
  }
};
</script>

after

<script setup>
  import { useAccountStore } from "../stores/account.js";
  import { refs } from "vue";
  
  const account = useAccountStore();

  const email: ref("");
  const password: ref("");

  const handleLogin = (e) => {
    e.preventDefault();
    console.log("Form Submitted", email.value, password.value);
    account.login({
      email: email.value,
      password: password.value
    })
  }
</script>

This also demonstrated how pinia also simplifies how you access the state just by writing two lines of code:

import { useAccountStore } from "../stores/account.js";
const account = useAccountStore();

you would have immediate access to that store just by doing that! any method or reactive value set in the account store can now be accessed just by typing account.. Its that simple!

Wow!

Another is the newer state management system, pinia. It also freshens up the experience in using a state management system, as it does not require modules and a main index.js file to handle multiple state managements. Modules can now be in their own file, called stores, and does not need to be imported into a single index.js file like what it used to be with vuex. Also, pinia can be imported easily through any components with ease.

your folder structure would be a noticeable difference when using pinia over vuex, look at the difference:

before

.
โ”” src
  โ””โ”€ store
     โ”œโ”€ modules
     โ”‚  โ”œโ”€ account.js
     โ”‚  โ””โ”€ todo.js
     โ””โ”€ index.js
  

after

.
โ”” src
  โ””โ”€ stores
     โ”œโ”€ account.js
     โ””โ”€ todo.js

**No need for an index.js file anymore inside the src/store folder!

You can even use the composition API in pinia, so that you can have that same boilerplate-less code for your state management system as well as your components!

here's an example comparison between the two. I used the account.js as a reference from the project (still working on it though, this code is just for demonstration purposes)

before

import api from "../../api";

const state = {
  account: null,
  session: null,
};

const actions = {
  signup: async ({ commit }, { email, password, name }) => {
    try {
      const account = await api.createAccount(email, password, name);
      await api.createSession(email, password);
      commit("setAccount", account);
    } catch (e) {
      console.log("Error creating Account");
      commit(
        "setError",
        {
          show: true,
          message: e.message,
          color: "red",
        },
        { root: true }
      );
    }
  },
  fetchAccount: async ({ commit }) => {
    try {
      const account = await api.getAccount();
      commit("setAccount", account);
    } catch (e) {
      console.log("Error getting Account");
    }
  },
  login: async ({ commit }, { email, password }) => {
    try {
      console.log(email, password);
      await api.createSession(email, password);
      const account = await api.getAccount();
      commit("setAccount", account);
    } catch (e) {
      console.log("Error creating Session", e);
      commit(
        "setError",
        {
          show: true,
          message: e.message,
          color: "red",
        },
        { root: true }
      );
    }
  },
  logout: async ({ commit }) => {
    try {
      await api.deleteCurrentSession();
      commit("setAccount", null);
    } catch (e) {
      console.log("Error deleting session");
      commit(
        "setError",
        {
          show: true,
          message: "Failed to logout",
          color: "red",
        },
        { root: true }
      );
    }
  },
};

const getters = {
  getAccount: (state) => state.account,
  getSession: (state) => state.session,
};

const mutations = {
  setAccount: (state, account) => (state.account = account),
};

export default {
  state,
  actions,
  getters,
  mutations,
};

after

import api from "../../api"
import {defineStore} from "pinia"
import {ref} from "vue"

export const useAccountStore = defineStore("account", () => {

    const account = ref()
    const session = ref()
    const error = ref()

    const signup = async (email, password, name) => {
        try {
            const account = await api.createAccount(email,password,name)
            account.value = await api.createSession(email,password)
        } catch (e) {
            console.error("Error creating account.")
            error.value = {
                {
                  show: true,
                  message: e.message,
                  color: "red",
                }
            }
        }
    }

    const fetchAccount = async () => {
        try {
            const account = await api.getAccount()
            account.value = account
        } catch (e) {
            console.error("Error getting Account")
        }
    }

    const login = async (email, password) => {
        try {
            console.log(email, password)
            await api.createSession(email, password)
            const account = await api.getAccount()
            account.value = account
        } catch (e) {
            console.error("Error creating Session:", e)
            error.value = {
                {
                  show: true,
                  message: e.message,
                  color: "red",
                }
            }
        }
    }

    const logout = async () => {
        try {
            await api.deleteCurrentSession()
            account.value = null
        } catch (e) {
            console.error("Error deleting Session")
            error.value =  {
                show: true,
                message: e.message,
                color: "red",
            }
        }
    }


    return {
        account,
        session,
        error,
        signup,
        fetchAccount,
        login,
        logout
    }

})

so as you can see, it used less boilerplate code, and you write your methods without actions or even mutations! as if you were writing composition api from a vue component.

besides all of that, this is just a suggestion. i'm currently trying out appwrite, and im currently trying out on how to incorporate what i have learned from the new composition api, pinia, and script setup, to see how all of these works together, and i would love to see it with the new features vue 3 and vite had brought to us.

im also curious on what other people think about updating or adding another demo project that uses pinia and composition api. and i hope you would also like to try appwrite with these new features!

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

installation fails with being unable to sign up

I'm trying to install this app example locally, and I can't get it running. Note that I have limited knowledge of docker, Vue, or appwrite. At first, my todo items weren't saved, Firefox' console said "User id is null/empty". I figured that was because I was unable to login/signup, because the screen redirected immediately to the prompt for entering todo-items, which I was able to mitigate by editing App.vue with this:

  watch: {
    getAccount(newValue, oldValue) {
      console.log("In Watch getAccount in App.vue")
      if (newValue === null) {
        this.$router.replace('/')
      } else {
        this.$router.replace('/login')
      }
    }

But now I'm stuck trying to sign up with my local instance, see this output of Firefox' javascript console:

signing up ... [redacted] SignUp.vue:64:15
XHROPTIONShttps://localhost/account
[HTTP/2 204 No Content 6ms]

XHRPOSThttps://localhost/account
CORS Missing Allow Origin

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost/account. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

Error creating Account account.js:15:15
XHRGEThttp://localhost:3000/__vite_ping

My guess is that I need to do one of these:

  • set up the docker network differently (I only just installed docker on this machine, which is running Ubuntu 20.04 (desktop))
  • change my answers in the setup script (I kept the defaults, though I made my own API key)
  • install this example app in a docker container as well and set it to the same subnet as the appwrite backend (no idea how to do that, I don't have any experience with docker)
  • read the instructions more carefully (I doublechecked several times already, but who knows ...)
  • use a different operating system than Ubuntu 20.04

tldr: This guide (or the app itself) does not work as-is.

๐Ÿ› Bug Report: TypeError: Cannot read properties of undefined (reading 'get')

๐Ÿ‘Ÿ Reproduction steps

Refresh the page after login

๐Ÿ‘ Expected behavior

Stay logged in

๐Ÿ‘Ž Actual Behavior

I need to log in again

And I caught possible related errors

TypeError: Cannot read properties of undefined (reading 'get')
    at Object.getAccount (index.js:25:34)
    at Store2.fetchAccount (account.js?t=1660704707512:29:33)
    at Array.wrappedActionHandler (vuex.esm-bundler.js:305:23)
    at Store2.dispatch (vuex.esm-bundler.js:1032:13)
    at Store2.boundDispatch [as dispatch] (vuex.esm-bundler.js:914:21)
    at Proxy.mappedAction (vuex.esm-bundler.js:1281:20)
    at Proxy.created (App.vue:27:12)
    at callWithErrorHandling (runtime-core.esm-bundler.js:155:36)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:164:21)
    at callHook (runtime-core.esm-bundler.js:2965:5)

๐ŸŽฒ Appwrite version

Version 0.10.x

๐Ÿ’ป Operating system

Windows

๐Ÿงฑ Your Environment

No response

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

๐Ÿ› Bug Report: Param "userId" is not optional

๐Ÿ‘Ÿ Reproduction steps

Just create a new account in Signup

๐Ÿ‘ Expected behavior

Signing up should go through with new credentials

๐Ÿ‘Ž Actual Behavior

Getting error:

image

๐ŸŽฒ Appwrite version

Different version (specify in environment)

๐Ÿ’ป Operating system

Linux

๐Ÿงฑ Your Environment

This is the demo app

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

Todos separation

I would like to report issue with user's todo's separation. I've deployed app on my localhost, creaded DB and collection. Registered two users and logged them in. Both users are sharing one Todo list and they do not have their own.

Not sure if this is a bug or feature :) I would expect separation in Todos per user.

I am using latest version of Appwrite.

Upgrade our issue templates to use GitHub issue forms โœ๏ธ

Introduction

GitHub has recently rolled out a public beta for their issue forms feature. This would allow you to create interactive issue templates and validate them ๐Ÿคฏ.

Appwrite currently uses the older issue template format. Your task is to create GitHub issue forms for this repository. Please use Appwrite's issue templates as a reference for this PR.

Tasks summary:

  • Fork & clone this repository
  • Prepare bug report issue form in .github/ISSUE_TEMPLATE/bug.yaml
  • Prepare documentation issue form in .github/ISSUE_TEMPLATE/documentation.yaml
  • Prepare feature request issue form in .github/ISSUE_TEMPLATE/feature.yaml
  • Push changes to master and test issue forms on your fork
  • Submit pull request

If you need any help, reach out to us on our Discord server.

Are you ready to work on this issue? ๐Ÿค” Let us know, and we will assign it to you ๐Ÿ˜Š

Happy Appwriting!

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.