Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samioksanen/chat-app
Chat App
https://github.com/samioksanen/chat-app
docker-compose graphql hasura passport react
Last synced: 19 days ago
JSON representation
Chat App
- Host: GitHub
- URL: https://github.com/samioksanen/chat-app
- Owner: SamiOksanen
- License: mit
- Created: 2022-07-29T20:47:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-07T23:28:24.000Z (about 2 years ago)
- Last Synced: 2023-03-08T11:23:22.920Z (almost 2 years ago)
- Topics: docker-compose, graphql, hasura, passport, react
- Language: TypeScript
- Homepage:
- Size: 2.39 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chat App
![image](https://img.shields.io/badge/GraphQl-E10098?style=for-the-badge&logo=graphql&logoColor=white)
![image](https://img.shields.io/badge/Hasura-1EB4D4?style=for-the-badge&logo=hasura&logoColor=white)
![image](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white)
![image](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)
![image](https://img.shields.io/badge/Vite-B73BFE?style=for-the-badge&logo=vite&logoColor=FFD62E)
![image](https://img.shields.io/badge/Ant%20Design-1890FF?style=for-the-badge&logo=antdesign&logoColor=white)
![image](https://img.shields.io/badge/Nginx-009639?style=for-the-badge&logo=nginx&logoColor=white)
![image](https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge&logo=docker&logoColor=white) \
Application for having conversations with other users individually and in groups. Uses React and Ant Design for the user interface, Postgres as the database, Node.js Passport for authentication and Hasura GraphQL engine for connecting everything together. Database migrations are handled with Hasura migrations.๐ง In Progress ๐ง
## Setup ๐ช
### Install:
- Node.js
- Docker
- Hasura CLI### Install dependencies in `chat-app-auth` and `chat-app-front` directories
```bash
cd
npm i
```### Required environment variables
- Add a `.env.development.local` and `.env.production.local` file at the `chat-app-front` and `chat-app-graphql-engine` directories of the repo, by copying the `.env.development.example` and `.env.production.example` file.
- Add a `.env.local` file at the `chat-app-db` directory of the repo, by copying the `.env.example` file.
- Set values to the environment variables in the `.env` files.## Run the app in development mode
```bash
docker-compose build
docker-compose up -d
```### Cleanup in development mode ๐งน
```bash
docker-compose down
```## Run the app in production mode
```bash
docker-compose -f docker-compose.prod.yaml build
docker-compose -f docker-compose.prod.yaml up -d
```### Cleanup in production mode ๐งน
```bash
docker-compose -f docker-compose.prod.yaml down
```## Hasura migrations
Open console from CLI with `hasura console --endpoint --admin-secret ` and it should handle creating the migration files automatically.### Manual operations
- Initialise the migration from ground up (use only when you know what you are doing)
- `hasura migrate create init --from-server --endpoint --admin-secret `
- pull new changes to metadata
- `hasura metadata export --endpoint --admin-secret `
- apply migrations
- https://hasura.io/docs/latest/hasura-cli/commands/hasura_migrate_apply/
- `hasura migrate apply --endpoint --admin-secret --version --up --skip-execution`
- apply migrations manually
- `hasura migrate apply --database-name default --endpoint --admin-secret && hasura metadata apply --endpoint --admin-secret `
- squash the migration files
- `hasura migrate squash --from `
- reset migrations on server
- `hasura migrate delete --all --server --database-name --endpoint --admin-secret `