{"id":23103539,"url":"https://github.com/samioksanen/chat-app","last_synced_at":"2026-05-02T18:34:14.725Z","repository":{"id":50529721,"uuid":"519345712","full_name":"SamiOksanen/chat-app","owner":"SamiOksanen","description":"Chat App","archived":false,"fork":false,"pushed_at":"2025-09-24T23:08:29.000Z","size":2712,"stargazers_count":0,"open_issues_count":54,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T14:45:52.936Z","etag":null,"topics":["docker-compose","graphql","hasura","passport","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamiOksanen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-29T20:47:08.000Z","updated_at":"2025-09-24T19:42:59.000Z","dependencies_parsed_at":"2025-09-16T22:12:35.575Z","dependency_job_id":"66597b35-d88a-4455-b59a-8ff804e71205","html_url":"https://github.com/SamiOksanen/chat-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SamiOksanen/chat-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiOksanen%2Fchat-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiOksanen%2Fchat-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiOksanen%2Fchat-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiOksanen%2Fchat-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamiOksanen","download_url":"https://codeload.github.com/SamiOksanen/chat-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiOksanen%2Fchat-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32545866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","graphql","hasura","passport","react"],"created_at":"2024-12-17T00:21:13.484Z","updated_at":"2026-05-02T18:34:14.694Z","avatar_url":"https://github.com/SamiOksanen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chat App\n\n![image](https://img.shields.io/badge/GraphQl-E10098?style=for-the-badge\u0026logo=graphql\u0026logoColor=white)\n![image](https://img.shields.io/badge/Hasura-1EB4D4?style=for-the-badge\u0026logo=hasura\u0026logoColor=white)\n![image](https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n![image](https://img.shields.io/badge/React-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB)\n![image](https://img.shields.io/badge/Vite-B73BFE?style=for-the-badge\u0026logo=vite\u0026logoColor=FFD62E)\n![image](https://img.shields.io/badge/Ant%20Design-1890FF?style=for-the-badge\u0026logo=antdesign\u0026logoColor=white)\n![image](https://img.shields.io/badge/Nginx-009639?style=for-the-badge\u0026logo=nginx\u0026logoColor=white)\n![image](https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge\u0026logo=docker\u0026logoColor=white)\n![image](https://img.shields.io/badge/Playwright-45ba4b?style=for-the-badge\u0026logo=playwright\u0026logoColor=white)\n![image](https://img.shields.io/badge/ESLint-4B32C3?style=for-the-badge\u0026logo=eslint\u0026logoColor=white)\n![image](https://img.shields.io/badge/Prettier-F7B93E?style=for-the-badge\u0026logo=prettier\u0026logoColor=white)\n\nApplication 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. This is a hobby project I have used for trying out things like Hasura, Ant Design and developing with Claude Code. **This project is not meant for any real production use.**\n\n🚧 In Progress 🚧\n\n## Setup 🪄\n\n### Install:\n\n- Node.js\n- Docker\n- Hasura CLI\n\n### Install dependencies\n\nInstall root dependencies (ESLint, Prettier, shared tooling) and service-specific dependencies\n\n```bash\nnpm i\n```\n\n### Required environment variables\n\n- Add a `.env.development.local`, `.env.test.local` and `.env.production.local` files at the `chat-app-auth`, `chat-app-front` and `chat-app-graphql-engine` directories of the repo, by copying the `.env.development.example`, `.env.test.example` and `.env.production.example` files.\n- Add a `.env.local` file at the `chat-app-db` directory of the repo, by copying the `.env.example` file.\n- Set values to the environment variables in the `.env` files.\n\n## Run the app in development mode 🚀\n\n```bash\nnpm run start\n```\n\n### Cleanup in development mode 🧹\n\n```bash\nnpm run stop\n```\n\n## Run the app in production mode 🚀\n\n```bash\nnpm run start:prod\n```\n\n### Cleanup in production mode 🧹\n\n```bash\nnpm run stop:prod\n```\n\n## Code Quality \u0026 Development 🔧\n\n### Unified Linting \u0026 Formatting\n\nThe project uses centralized ESLint and Prettier configurations for consistent code quality across all services.\n\n```bash\n# Run from project root (applies to all services)\nnpm run lint         # Check code quality with ESLint\nnpm run lint:fix     # Fix ESLint issues automatically\nnpm run format       # Format all files with Prettier\nnpm run format:check # Check formatting without changes\n\n# Service-specific commands (uses shared config)\ncd chat-app-front\nnpm run lint         # Frontend linting only\nnpm run format       # Frontend formatting only\n\ncd chat-app-auth\nnpm run lint         # Backend linting only\nnpm run format       # Backend formatting only\n```\n\n## Testing 🧪\n\n### Unit Tests (Frontend)\n\n```bash\ncd chat-app-front\nnpm test             # Run unit tests with Vitest\nnpm run test:ui      # Run tests with Vitest UI\nnpm run test:coverage # Generate test coverage report\n```\n\n### Unit \u0026 Integration Tests (Backend)\n\nThe backend includes comprehensive testing with both unit tests (fast, mocked dependencies) and integration tests (real database, HTTP requests).\n\n```bash\ncd chat-app-auth\n# Unit Tests (61 tests across 7 suites)\nnpm test                          # Fast unit tests with mocked dependencies\nnpm run test:watch                # Unit tests in watch mode\nnpm run test:coverage             # Unit tests with coverage report\n\n# Integration Tests (23 tests across 2 suites)\nnpm run test:integration          # Full integration tests with Docker\nnpm run test:integration:watch    # Integration tests in watch mode\nnpm run test:integration:coverage # Integration tests with coverage\n\n# All Tests\nnpm run test:all                  # Run both unit and integration tests\n```\n\n**Backend test coverage includes:**\n\n- 🔧 **Unit Tests**: User models, controllers, authentication strategies, error handling\n- 🔌 **Integration Tests**: Real HTTP API endpoints with SuperTest and PostgreSQL\n- 🔐 **Authentication Testing**: Registration, login, JWT tokens, Hasura webhooks\n- 🗄️ **Database Testing**: Real database operations, constraints, migrations\n\n### End-to-End Tests (Frontend)\n\nThe application includes comprehensive e2e tests using Playwright that test the full application stack.\n\n```bash\ncd chat-app-front\nnpm run test:e2e          # Run e2e tests (auto-starts test environment)\nnpm run test:e2e:ui       # Run with Playwright UI\nnpm run test:e2e:headed   # Run in headed browser mode\nnpm run test:e2e:debug    # Run in debug mode\nnpm run test:e2e:setup    # Start test environment only\nnpm run test:e2e:cleanup  # Stop test environment\nnpm run test:e2e:complete # Full cycle: setup → test → cleanup\n```\n\n**What the e2e tests cover:**\n\n- 🔐 Authentication flows (login, logout, session management)\n- 🧭 UI navigation between different views\n- 💬 Conversation management (create, view, manage)\n- 📝 Message functionality (send, receive, display)\n- ⚡ Real-time features via GraphQL subscriptions\n\nThe e2e tests use a dedicated test environment with separate Docker services running on different ports to avoid conflicts with development.\n\n## Hasura migrations (`cd chat-app-graphql-engine`)\n\nOpen console from CLI with `hasura console --endpoint http://localhost:8081 --admin-secret chatappadminsecretkey` and it should handle creating the migration files automatically. After creating new migration files, move them to chat-app-db/migrations and export new changes to hasura metadata using `hasura metadata export --endpoint http://localhost:8081 --admin-secret chatappadminsecretkey`.\n\n### Manual operations\n\n- pull new changes to metadata\n    - `hasura metadata export --endpoint \u003cendpoint\u003e --admin-secret \u003cadmin-secret\u003e`\n- apply metadata changes\n    - `hasura metadata apply --endpoint \u003cendpoint\u003e --admin-secret \u003cadmin-secret\u003e`\n- Initialise the migration from ground up (use only when you know what you are doing)\n    - `hasura migrate create init --from-server --endpoint \u003cendpoint\u003e --admin-secret \u003cadmin-secret\u003e`\n- apply migrations\n    - https://hasura.io/docs/latest/hasura-cli/commands/hasura_migrate_apply/\n    - `hasura migrate apply --endpoint \u003cendpoint\u003e --admin-secret \u003cadmin-secret\u003e --version \u003cversion\u003e --up --skip-execution`\n- apply migrations manually\n    - `hasura migrate apply --database-name default --endpoint \u003cendpoint\u003e --admin-secret \u003cadmin-secret\u003e \u0026\u0026 hasura metadata apply --endpoint \u003cendpoint\u003e --admin-secret \u003cadmin-secret\u003e`\n- squash the migration files\n    - `hasura migrate squash --from \u003cversion\u003e`\n- reset migrations on server\n    - `hasura migrate delete --all --server --database-name \u003cdatabase-name\u003e --endpoint \u003cendpoint\u003e --admin-secret \u003cadmin-secret\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamioksanen%2Fchat-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamioksanen%2Fchat-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamioksanen%2Fchat-app/lists"}