Giter Site home page Giter Site logo

alxarno / swap Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 24.88 MB

๐Ÿ–ฅ๏ธ Messenger Backend (Golang, GORM, SQLite)

License: GNU General Public License v3.0

Go 99.47% Shell 0.53%
golang chat chat-application api-rest gorm sqlite3 golang-server messenger messaging jwt-authentication

swap's Introduction

Instant messenger for local network

Current standalone application is messenger's server, there isn't UI

System Capabilities

  • Working without a setup
  • Auto producing self-signed SSL certificates
  • Embedded database
  • Files holding
  • Declarative settings
  • Logging to a file

Messenger Capabilities

  • User's sing in and sing up
  • Creating chat
  • Invite users to a chat
  • Block users in the chat
  • Leave chat
  • Upload docs
  • Instant messaging via WebSocket

Installation and run

Getting repository

go get github.com/alxarno/swap

All deps are in vendor folder

Running only API server, without web UI.

For running with web UI look below

go run main.go logo.go  router.go  router_without_ui.go

Also you can start by fresh, with auto rebuild

go get github.com/pilu/fresh
./fresh.sh

Config

After starting swap server, it create swap.json file, if it doesnt exist. The swap.json contains swap's settings.

{
	"backend":{
		"fileLogs": true, // swap will logging to swap.log file, instead stdout
		"host": "80", // base host for http (will auto redirect to sslhost)
		"sslhost": "443", // https host
		"secret_key_for_token": "CGli0F5jNe3RhLCfVyEBTw==", // auto produced random string for creating some tokens
		"files_path": "./files/" // folder for containing files
	},
	"cert":{
		"org": "Example Co", // self-signed cert's company name 
		"hosts": ["192.168.1.38","localhost","127.0.0.1"], // self-signed cert's hosts
		"rsa-bits":2048 // key bits
	},
	"service":{
		"max_file_size_byte": 104857600, // max uploaded file size (1MB)
		"max_minutes_available_for_files_download": 5, // temporary donwload link time
		"cors": false // cross-domain requests
	},
	"db":{
		"sqlite":{
			"file_path": "swap.db" // DB file name
		}
	}
}

Certificates

After starting swap server, it create swap.crt and swap.key files, if they don't exist.

They are generated based on information in swap.json

You can generate your own certificate and key, and put it like swap.crt and swap.key

Build

For build executable install packr and run

./build.sh

It download UI, make go classes by packr and compile all

Now supporting building only for current OS

Result will appear in releases folder

Built With

Download

You can download the latest portable version of Swap

License

GPL-3.0

swap's People

Contributors

alxarno avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.