Skip to content

baseapp-e2e: move to baseapp-backend #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jobs:
uses: ./.github/workflows/project-workflow.yml
with:
project: baseapp-social-auth
baseapp-e2e:
uses: ./.github/workflows/project-workflow.yml
with:
project: baseapp-e2e
baseapp-profiles:
uses: ./.github/workflows/project-workflow.yml
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/sonar-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ jobs:
with:
project: baseapp-social-auth
secrets: inherit
baseapp-e2e:
uses: ./.github/workflows/sonar-workflow.yml
with:
project: baseapp-e2e
secrets: inherit
baseapp-profiles:
uses: ./.github/workflows/sonar-workflow.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Integration with Cloudflare Stream for file streaming

This app uses django provided permission and group model and provides the ability to add roles to a django model, and make views from the [django-restframework](https://www.django-rest-framework.org/) check for them. A **Permission** represents the lowest single unit of access. A **Group** is a collection of Permissions. A **Role** can have many Permision Groups, many Permissions and many **Excluded Permissions**. The access of a Role is the aggregation of its single Permissions + the permissions on its **Permission** Groups - its Excluded Permissions.

## [baseapp-e2e](baseapp-e2e)
## [baseapp-e2e](baseapp/baseapp_e2e)

Utilities for performing E2E (End-To-End) tests with front-end client. (Database initialization and seeding)

Expand Down
18 changes: 0 additions & 18 deletions baseapp-e2e/baseapp_e2e/tests/factories.py

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions baseapp-e2e/baseapp_e2e/wsgi.py

This file was deleted.

22 changes: 0 additions & 22 deletions baseapp-e2e/manage.py

This file was deleted.

22 changes: 0 additions & 22 deletions baseapp-e2e/setup.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions baseapp-e2e/setup.py

This file was deleted.

Empty file.
Empty file.
Empty file.
5 changes: 0 additions & 5 deletions baseapp-e2e/testproject/e2e/scripts/hello.py

This file was deleted.

5 changes: 0 additions & 5 deletions baseapp-e2e/testproject/e2e/scripts/world.py

This file was deleted.

19 changes: 0 additions & 19 deletions baseapp-e2e/testproject/factories.py

This file was deleted.

4 changes: 0 additions & 4 deletions baseapp-e2e/testproject/requirements.txt

This file was deleted.

25 changes: 0 additions & 25 deletions baseapp-e2e/testproject/settings.py

This file was deleted.

Empty file.
9 changes: 0 additions & 9 deletions baseapp-e2e/testproject/testapp/admin.py

This file was deleted.

34 changes: 0 additions & 34 deletions baseapp-e2e/testproject/testapp/migrations/0001_initial.py

This file was deleted.

Empty file.
14 changes: 0 additions & 14 deletions baseapp-e2e/testproject/testapp/models.py

This file was deleted.

13 changes: 0 additions & 13 deletions baseapp-e2e/testproject/urls.py

This file was deleted.

16 changes: 0 additions & 16 deletions baseapp-e2e/testproject/wsgi.py

This file was deleted.

5 changes: 5 additions & 0 deletions baseapp/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ include baseapp_chats/README.md
recursive-include baseapp_chats/templates *
recursive-include baseapp_chats/static *
recursive-include baseapp_chats/locale *

include baseapp_e2e/README.md
recursive-include baseapp_e2e/templates *
recursive-include baseapp_e2e/static *
recursive-include baseapp_e2e/locale *
86 changes: 85 additions & 1 deletion baseapp/baseapp_chats/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
# BaseApp Chats

This package has been moved to [baseapp-packend](https://pypi.org/project/baseapp-backend/) package.
This package provides a simple chat system for your project, where multiple profiles can chat with each other.

## Requirements:
```
- **baseapp-core** >= 0.3.7
- **baseapp-profile** >= 0.2.4
```

Run `pip install baseapp-chats`
And make sure to add the frozen version to your `requirements/base.txt` file

If you want to develop, [install using this other guide](#how-to-develop).

## How to use

Add `baseapp_chats` to your project's `INSTALLED_APPS`

Make sure your Profile's GraphQL Object Types extends `ChatRoomsInterface` interface:

```python
from baseapp_chats.graphql.interfaces import ChatRoomsInterface

class ProfileObjectType(DjangoObjectType):
class Meta:
interfaces = (relay.Node, ChatRoomsInterface)
```

This is not necessary if you are using the `baseapp-profile` as it is without a custom ProfileObjectType implementation.

Expose `ChatsMutations`, `ChatsQueries` and `ChatsSubscriptions` in your GraphQL/graphene endpoint, like:

```python
from baseapp_chats.graphql.mutations import ChatsMutations
from baseapp_chats.graphql.queries import ChatsQueries
from baseapp_chats.graphql.subscriptions import ChatsSubscriptions


class Query(graphene.ObjectType, ChatsQueries):
pass


class Mutation(graphene.ObjectType, ChatsMutations):
pass


class Subscription(graphene.ObjectType, ChatsSubscriptions):
pass


schema = graphene.Schema(query=Query, mutation=Mutation, subscription=Subscription)
```

Those will expose the following queries, mutations and subscriptions:

### Queries

- `chatRoom(id: ID!)`: Return a specific chatRoom

### Mutations

- `chatRoomCreate(profileId: ID!, participants: [ID!]!)`: Create a chatRoom with your profile and multiple participants
- `chatRoomSendMessage(roomId: ID!, profileId: ID!, content: String!, inReplyToId: ID)`: Send a message in a room, using a specific profile. Optionally, you can reply to a message by passing the `inReplyToId` argument.
- `chatRoomReadMessages(roomId: ID!, profileId: ID!, messageIds: [ID])`: Mark messages in a room as read by a specific profile, if `messageIds` is not passed, all messages will be marked as read.

### Subscriptions

- `chatRoomOnRoomUpdate(profileId: ID!)`: Subscribe to chat rooms updates under your current profile
- `chatRoomOnMessagesCountUpdate(profileId: ID!)`: Subscribe to unread/read messages count updates under your current profile
- `chatRoomOnMessage(roomId: ID!)`: Subscribe to new messages in a specific room

## How to develop

Clone the project inside your project's backend dir:

```
git clone git@github.com:silverlogic/baseapp-backend.git
```

And manually install the package:

```
pip install -e baseapp-backend/baseapp-chats
```

The `-e` flag will make it like any change you make in the cloned repo files will effect into the project.
2 changes: 1 addition & 1 deletion baseapp-e2e/README.md → baseapp/baseapp_e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ There is a [test project](testproject/) with a complete demo set up.
Install in your environment:

```bash
pip install baseapp-e2e
pip install baseapp-backend
```

### Settings
Expand Down
File renamed without changes.
Loading