module
0.0.0-20230323125333-e8e5fc35c6a3
Repository: https://github.com/calgorr/chatapp.git
Documentation: pkg.go.dev
# README
Chat Application with Go and Echo Framework
This is a chat application built with Go and the Echo web framework, using Redis as the database and JWT for authentication. The application allows users to sign up, log in, create groups, add members to groups, send messages within groups, and more.
Installation
To install the chat application, follow these steps:
Clone the repository to your local machine:
git clone https://github.com/Calgorr/ChatApp.git
Install the required dependencies:
go mod download
Set up the Redis database and update the configuration file with the correct Redis credentials.
Build and run the server application:
go run server/main.go
API Endpoints
The chat application has the following API endpoints:
User
POST api/users
: Sign up as a new user.POST api/users/login
: Log in as an existing user.
Message
POST api/messages/newmessage
: Send a new message within a group.
Group
POST api/groups/newgroup
: Create a new group.POST api/groups/addmember
: Add a new member to a group.POST api/groups/getgroups
: Get a list of all groups.GET api/groups/getmessages
: Get all messages within a group.GET api/groups/getgroup
: Get details of a specific group.DELETE api/groups/removeuser
: Remove a user from a group.
Authentication
Authentication is handled using JWT (JSON Web Token). To access protected endpoints, clients must include a valid JWT in the Authorization
header of their HTTP requests.