Skip to content

Commit

Permalink
Merge pull request #10 from upperdo/develop
Browse files Browse the repository at this point in the history
feat: events - appwrite initial
  • Loading branch information
acidlake authored Oct 27, 2023
2 parents 1b30084 + 4b99f32 commit c86d524
Show file tree
Hide file tree
Showing 62 changed files with 2,176 additions and 103 deletions.
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Application Envs
PUBLIC_APPWRITE_ENDPOINT="http://localhost/"
PUBLIC_APPWRITE_API_VERSION="v1"
PUBLIC_APPWRITE_PROJECT_ID="your-project-id"
PUBLIC_SELECTED_PLATFORM="appwrite"
PUBLIC_DEBUG=
PUBLIC_DEBUG=

## AppWrite CLI Bash Related ENV
APPWRITE_SELF_SIGNED=true
APPWRITE_SET_ENDPOINT=true
APPWRITE_CLI_ENDPOINT=https://cloud.appwrite.io/v1
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@ copy .env.example .env
pnpm dev
```

## Appwrite
There's an appwrite folder in the root of the project, it contains the base functions, database and collections for the project.

there's also a bash script that can be run with ./login_appwrite.sh, it will promp to login to appwrite instance that you spesify in the .env, see .env.example

## Events
To use the events handler simple follow:

```bash
# import event list
import EVENTS from $lib/common/constants/events
# import dispatchEvent
import dispatchEvent from $lib/common/events/event-bus

# have some payload ready to send
const payload = {
name: 'demo',
notifications: {
email: true,
sms: true
}
}

# use the function on the component that you want to trigger the event,
<button on:click={() => dispatchEvent(EVENTS.UPDATE_PROFILE, payload)} >hi</button>

# Add as many more handlers and events as need it

```

## Folder Structure
The project is well organized into the following folder structure, and use route grouping.

Expand Down
Loading

0 comments on commit c86d524

Please sign in to comment.