{"id":16983975,"url":"https://github.com/tusharsadhwani/instachat","last_synced_at":"2026-03-08T23:31:28.074Z","repository":{"id":56306960,"uuid":"286797082","full_name":"tusharsadhwani/instachat","owner":"tusharsadhwani","description":"A working replica of Instagram DMs and stories, written in Flutter and Go.","archived":false,"fork":false,"pushed_at":"2021-05-26T12:32:55.000Z","size":17880,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T05:09:14.215Z","etag":null,"topics":["backend","flutter","messenger"],"latest_commit_sha":null,"homepage":"https://instachat.live","language":"Go","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/tusharsadhwani.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}},"created_at":"2020-08-11T16:41:40.000Z","updated_at":"2025-09-05T03:28:18.000Z","dependencies_parsed_at":"2022-08-15T16:20:49.414Z","dependency_job_id":null,"html_url":"https://github.com/tusharsadhwani/instachat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tusharsadhwani/instachat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Finstachat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Finstachat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Finstachat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Finstachat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tusharsadhwani","download_url":"https://codeload.github.com/tusharsadhwani/instachat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Finstachat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30276911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["backend","flutter","messenger"],"created_at":"2024-10-14T02:29:47.511Z","updated_at":"2026-03-08T23:31:28.050Z","avatar_url":"https://github.com/tusharsadhwani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InstaChat\n\nA working replica of Instagram DMs and stories, written in Flutter and Go.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43412083/105750515-d9ca0680-5f6a-11eb-8681-0451f21fd935.png\" width=\"300\" hspace=\"10\" vspace=\"20\"\u003e \u003cimg src=\"https://user-images.githubusercontent.com/43412083/105750622-fbc38900-5f6a-11eb-884b-71de91ed4f2b.png\" width=\"300\" hspace=\"10\" vspace=\"20\"\u003e\n\n\u003e **Note:** This is currently a work in progress.\n\u003e \n\u003e The stories aren't integrated, but you can take a look at them as a separate project: [insta_stories](https://github.com/tusharsadhwani/insta_stories)\n\n## Deploy your own\n\nYou will need [go](https://golang.org) and [flutter](https://flutter.dev) installed on your system.\n\n### Before you start\n\nTo run your own instance, you'll need:\n\n- a GCP project (for OAuth)\n- an Amazon S3 bucket\n- a domain name\n- a VPS/cloud server\n\nYou can get all of these for free for limited use.\n\n1. Create a GCP Project and setup OAuth:\n\n   - Log into [Google Cloud Console](https://console.cloud.google.com/) and create a new project.\n\n2. Create an AWS S3 bucket for media hosting:\n\n   - Be sure to un-check \"Block all public access\".\n\n   - Add the following bucket policy, to allow public read access\n     (replace `\u003cbucket name\u003e` with your S3 bucket name):\n\n     ```json\n     {\n       \"Version\": \"2012-10-17\",\n       \"Statement\": [\n         {\n           \"Sid\": \"PublicReadGetObject\",\n           \"Effect\": \"Allow\",\n           \"Principal\": \"*\",\n           \"Action\": \"s3:GetObject\",\n           \"Resource\": \"arn:aws:s3:::\u003cbucket name\u003e/*\"\n         }\n       ]\n     }\n     ```\n\n- Edit `./instachat/.env` to set `DOMAIN` as the domain name of your backend, along with your AWS S3 bucket URL.\n\n  (Look at `./instachat/.env.example` for more info)\n\n- Create a release build of the app for use:\n\n  ```bash\n  flutter build apk --target-platform=android-arm64,android-arm,android-x64 --split-per-abi\n  ```\n\n  Created APKs will be present in `./instachat/build/app/outputs/flutter-apk/`\n\n- Setup the backend domain:\n\n  - Get a domain name for the backend, free domain names are available on [freenom](https://freenom.com) for example.\n\n  - Point the domain/subdomain name (eg. `mybackend.site` or `api.instachat-server.net`) to the IP address of your VPS/cloud server, by adding an `A` DNS record, with host of `\u003cyour.domain\u003e` and value of the IP address.\n\n  - It can take a few minutes for the DNS records to be updated, you can use [dnschecker](https://dnschecker.org) to check the DNS records on your address.\n\n- Add the following nginx configuration on the server (replace `\u003cyour.domain\u003e` with your domain name):\n\n  ```nginx\n  server {\n      server_name \u003cyour.domain\u003e;\n\n      location / {\n          proxy_pass http://localhost:5555;\n          proxy_http_version 1.1;\n          proxy_set_header Upgrade $http_upgrade;\n          proxy_set_header Connection \"Upgrade\";\n          proxy_set_header Host $host;\n      }\n  }\n  ```\n\n  Then restart and test nginx with:\n\n  ```bash\n  sudo systemctl restart nginx\n  sudo nginx -t\n  ```\n\n- Setup an SSL Certificate for the backend:\n\n  - Install [certbot](https://certbot.eff.org/instructions) on your server, on Ubuntu it's just `sudo snap install --classic certbot`\n\n  - Run `sudo certbot --nginx` to install your SSL certificate.\n\n- Clone the repository on the server:\n\n  ```bash\n  git clone https://github.com/tusharsadhwani/instachat\n  ```\n\n- Create a postgres database for the backend.\n\n- Edit `./server/.env` to add your database and GCP/AWS credentials.\n\n  (Look at `./server/.env.example` for more info)\n\n- In the `./server` subdirectory, run:\n\n  ```bash\n  go run ./cmd/genkeys\n  ```\n\n  To generate an RSA key pair for the app.\n\n- Start the server:\n\n  ```bash\n  go build ./cmd/server\n  ./server\n  ```\n\n## Local Development\n\nYou will need [go](https://golang.org) and [flutter](https://flutter.dev) installed on your system.\n\n### App\n\n- Clone the repository:\n\n  ```bash\n  git clone https://github.com/tusharsadhwani/instachat\n  ```\n\n- Edit `./instachat/android/app/build.gradle`, change package name from:\n\n  ```gradle\n  defaultConfig {\n        applicationId \"com.tusharsadhwani.instachat\"\n        ...\n  ```\n\n  to your own package name, eg. `com.yourdomain.instachat`\n\n  ```gradle\n  defaultConfig {\n        applicationId \"com.yourdomain.instachat\"\n        ...\n  ```\n\n\u003c!-- TODO: move this content somewhere more sensible.\nMaybe move the common AWS and GCP instructions to their own specific blocks --\u003e\n\n- Log into [Google Cloud Console](https://console.cloud.google.com/)\n\n  - Go to APIs \u0026 Services \u003e OAuth consent screen, and:\n\n    - Choose the User Type to be **External**\n    - Add the required fields:\n      - App Name\n      - User Support Email\n      - Application Home Page (eg. `https://mydomain.com`)\n      - Application privacy policy link (eg. `https://mydomain.com/policy`)\n      - Application terms of service link (eg. `https://mydomain.com/terms`)\n      - Authorized domains (set it the same as the domain of above links)\n    - Save and Continue.\n\n  - Go to APIs \u0026 Services \u003e Credentials, and:\n\n    - Click Create Credentials \u003e OAuth Client ID\n    - Choose Application type: **Android**\n    - Add the package name (eg. `com.yourdomain.instachat`) and the SHA-1 key\n\n      (use `./gradlew signingReport` command in `./instachat/android/` subdirectory to get the SHA-1 value)\n\n    - Give it any name, and click Create.\n\n    - Click Create Credentials \u003e OAuth Client ID (again)\n    - Choose Application type: **Web**\n    - Give it any name, and click Create.\n\n    - Copy the **Web Application** Client ID\n\n    - Now, create a file: `./instachat/app/src/main/res/values/strings.xml`\n    - Set its contents to be:\n\n      ```xml\n      \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n      \u003cresources\u003e\n          \u003cstring name=\"default_web_client_id\"\u003eXXXXXXXXXXXX-YOUR_GCP_CLIENT_ID.apps.googleusercontent.com\u003c/string\u003e\n      \u003c/resources\u003e\n      ```\n\n      Replace the dummy client ID with the ID you copied from GCP.\n\n- Edit `./instachat/.env` to set `DOMAIN` as the domain name of your backend, along with your AWS S3 bucket URL.\n\n  (Look at `./instachat/.env.example` for more info)\n\n- In the `./instachat` subdirectory, run the following:\n\n  - Web:\n\n    ```bash\n    flutter run --web-port 5000 --web-renderer html\n    ```\n\n  - Android:\n\n    ```bash\n    adb reverse tcp:5555 tcp:5555\n    flutter run\n    ```\n\n- To create Release builds of the app for use, run:\n\n  ```bash\n  flutter build apk --target-platform=android-arm64,android-arm,android-x64 --split-per-abi\n  ```\n\n  Created APKs will be present in `./instachat/build/app/outputs/flutter-apk/`\n\n### Backend\n\n- Setup a local SSL Certificate:\n\n  - Install [mkcert](https://github.com/filosottile/mkcert) to generate a self-signed certificate:\n\n  - On Linux, first install `certutil`:\n\n    ```bash\n    sudo apt install libnss3-tools\n        -or-\n    sudo yum install nss-tools\n        -or-\n    sudo pacman -S nss\n        -or-\n    sudo zypper install mozilla-nss-tools\n    ```\n\n  - Then install mkcert:\n\n    ```bash\n    cd /tmp\n    git clone https://github.com/filosottile/mkcert\n    cd mkcert\n    go install -ldflags \"-X main.Version=$(git describe --tags)\"\n    ```\n\n  - Move to the instachat `./server` subdirectory, and install the certificate:\n\n    ```bash\n    mkcert -install\n    mkcert localhost\n    ```\n\n    This will generate `localhost.pem` and `localhost-key.pem` files for your local HTTPS server.\n\n- Create a postgres database for the backend.\n\n- In the `./server` subdirectory, run:\n\n  ```bash\n  go run ./cmd/genkeys\n  ```\n\n  To generate an RSA key pair for the app.\n\n- Edit `./server/.env` to add your database and GCP/AWS credentials.\n\n  (Look at `./server/.env.example` for more info)\n\n- Run the server:\n\n  To get live reloading, use [air](https://github.com/cosmtrek/air):\n\n  ```bash\n  go get -u github.com/cosmtrek/air\n  ```\n\n  \u003e Make sure $(go env GOPATH) is in your PATH.\n\n  Then run the command in `./server` subdirectory:\n\n  ```bash\n  air -c .air.toml\n  ```\n\n  to start the server with HTTPS and hot reload.\n\n## Testing\n\nTo run tests:\n\n- In the `./server` subfolder, run:\n\n  ```bash\n  go test ./tests\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftusharsadhwani%2Finstachat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftusharsadhwani%2Finstachat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftusharsadhwani%2Finstachat/lists"}