Skip to content

jadahbakar/chat-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Chat Server - Backend


Table of Contents
  1. About The Project
  2. Getting Started
  3. Project structure

About The Project

This system is using for Amartha - Shorty Challenge.

Built With

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • I use macOS Catalina 10.15.7

    ❯ uname -a
    Darwin 192.168.1.25 19.6.0 Darwin Kernel Version 19.6.0:
  • And then you need to install Golang prefer using homebrew

  • After that check the installation and Golang version it must be above than 1.11 because we need the Golang Modules

    > go version
    go version go1.20.3 darwin/amd64

Installation

Database

  1. Install SQLite with Homebrew
    brew install sqlite
  2. Create the database
    sqlite3 chat.db 
  3. Create table
    CREATE TABLE messages (
     id INTEGER PRIMARY KEY AUTOINCREMENT,
     sender_id INTEGER NOT NULL,
     receiver_id INTEGER NOT NULL,
     message TEXT NOT NULL,
     created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP

);



#### Manual Installation
1. Clone the repo
```sh
git clone https://github.com/jadahbakar/chat-server.git
  1. Install Modules packages

    go mod tidy

    or

    go mod download
  2. Run it

    go run main.go

Testing

  1. After running, It will show on console:

    running

  2. Testing it on postman:

    Post :

    postman-post

  3. Stop

    CTRL + C

Project Structure

.
├── README.md
├── assets
│   └── images
│       ├── console.png
│       └── postman.png
├── chat.db
├── go.mod
├── go.sum
└── main.go

3 directories, 7 files

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages