Welcome to Cozy Chat, a powerful chat application built with C and SQLite.
- C: The core language used to build this application.
- SQLite: Used for storing and managing data.
- JWT: Used for authentication.
- cJSON: For handling JSON data.
- libmx: A custom utility library.
- mongoose: For handling HTTP requests and WS connections.
- sqlite3: For interacting with SQLite databases.
- CURL: For sending HTTP requests to server
- client: Contains the client-side code.
- server: Contains the server-side code.
- db: Contains the SQLite database and related files(like migrations and seeds).
- lib: Contains static libraries used in the project.
To get started with Cozy Chat, clone the repository and follow the instructions in the Makefile.
First of all you have to compile all static libs and repository code
make
After that install gtk+3 if you dont have it.
Than you need to start server. There is 2 ways to do it:
-
Easy(checks if any changes was made in server folder(recompiles if necessary) and than launch)
make server
-
Edvanced(you can pass options to configure server)
./uchat_server 3000
When server have started you can launch client. There is 2 ways to do it:
-
Easy(checks if any changes was made in client and than launch)
make client
-
Edvanced
./uchat localhost 3000
💡 Migrations, Triggers, and Database Flow 💡
Project uses migration to save db state amoung developers, triggers to change updated_at data, foreign keys to ensure security of provided data
Here is the schema of the Cozy Chat database:
Api is written on C using mongoose embeded framework. It provides RESTfull architecture and uses MVC architeture design. Cozy Chat provides comprehensive API documentation using OpenAPI and AsyncAPI specifications.
The OpenAPI documentation describes the RESTful API endpoints and their corresponding request and response structures.
You can find doc at server/docs/open-api.yaml
How to open it? Google it if you are really interested 😉
(We used OpenAPI (Swagger) Editor
VS code extenstion preview option)
The AsyncAPI documentation provides information about websocket comunication
You can find doc at server/docs/async-api.yaml
How to open it? It is harder than open-api(couse it is not such popular).
You can use asyncapi-preview
VS code extenstion preview option