Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
28ebe79
new branch
toximu Apr 10, 2025
2b2e60a
Delete server directory
toximu Apr 11, 2025
ebbe197
change structure, declare base classes
toximu Apr 11, 2025
49fa0d0
return ui and scripts
toximu Apr 11, 2025
12ac15f
change .gitignore
toximu Apr 11, 2025
602ee56
merge from origin
toximu Apr 11, 2025
1ae49bd
return cmake for client
toximu Apr 11, 2025
050b1cf
copy database to client
toximu Apr 11, 2025
5d93e07
update client
toximu Apr 11, 2025
8e3c15b
client works
toximu Apr 11, 2025
25b4b26
declare client classes, some refactor server
toximu Apr 12, 2025
2d417c0
try make request
toximu Apr 12, 2025
b9c007d
feat: add async Note calls and update server startup logic
mirotvoretts Apr 13, 2025
b64d8c3
Merge pull request #9 from toximu/client-server
toximu Apr 13, 2025
c13cd0f
restruct server
toximu Apr 13, 2025
5652c66
Merge branch 'rustruct_server' into get_project_endpoint
toximu Apr 13, 2025
3a68304
add GetProjectServerCall
toximu Apr 14, 2025
626d5c9
feat: implement server calls with DB integration
mirotvoretts Apr 16, 2025
068fcdb
feat: implement client calls
mirotvoretts Apr 19, 2025
72783d2
feat: add update note endpoint
mirotvoretts May 2, 2025
bba73ee
feat: finish get_note method in DAO for parsing fields from db
mirotvoretts May 2, 2025
b1d9cf0
send requests and get responses works
toximu May 3, 2025
0e772b4
rewrite main-window to protobuf
toximu May 3, 2025
45d200f
merge
toximu May 3, 2025
2dd5161
update_requests commit
toximu May 3, 2025
8fdd0a0
merge for getting databases
toximu May 3, 2025
e3ad5fc
add ProjectDAO::get_project
toximu May 3, 2025
7b185f4
feat: rewrite authorization window to proto, rewrite LRDao to pqxx, c…
mirotvoretts May 4, 2025
ca6c59b
feat: insert_project, add_member_to_project, add_note_to_project, cha…
toximu May 5, 2025
8294a68
Merge pull request #15 from toximu/project_dao
toximu May 5, 2025
5b312d1
feat: get project and create project, start update handler
toximu May 6, 2025
ea78c54
change proto
toximu May 8, 2025
b259232
feat: add join project, leave project endpoint, rewrite projectDAO
toximu May 8, 2025
c515fae
feat: add auth client calls
mirotvoretts May 8, 2025
6a1faf6
fix: building project
mirotvoretts May 9, 2025
ab117ca
fix: communication between the client and the server in the Auth service
mirotvoretts May 16, 2025
de10053
Merge pull request #13 from toximu/get_project_endpoint
toximu May 18, 2025
a4d3593
Merge branch 'client-server' into authorization_endpoint
mirotvoretts May 20, 2025
88a48ef
feat(merge): add authorization and notes api endpoints
mirotvoretts May 20, 2025
2cac5e4
rewrite projects to sync
toximu May 21, 2025
fa65343
delete old project endpoints
toximu May 21, 2025
04c5134
Merge branch 'client-server' into rewrite-projects-to-sync
toximu May 21, 2025
76b978f
rewrite-projects-to-sync
toximu May 21, 2025
bdbb40e
fix some merge troubles
toximu May 21, 2025
d57c369
fix: bugs int notes api after merge
mirotvoretts May 22, 2025
0713253
fix server
toximu Jun 1, 2025
58e2e74
use-after-poison error exists
toximu Jun 3, 2025
d6e9c87
refactor: rewrite ClientImplementation class to singleton
mirotvoretts Jun 3, 2025
514579c
fixed
toximu Jun 4, 2025
78c9996
Merge branch 'client-server' into fix_server
toximu Jun 4, 2025
47440e1
Merge pull request #19 from toximu/fix_server
toximu Jun 4, 2025
3222f43
fix after merge
toximu Jun 4, 2025
58aaadc
return old windows
toximu Jun 4, 2025
1082266
sigseg
toximu Jun 4, 2025
59b0752
feat: fill user projects storage after authorization
mirotvoretts Jun 4, 2025
ecc13a5
connect rpc methods to main window
toximu Jun 4, 2025
e5c46ed
Merge branch 'connect_main_window' of github.com:toximu/efficio-task-…
toximu Jun 4, 2025
c47a768
fix: log message in GetNoteServerCall
mirotvoretts Jun 5, 2025
d7c44b7
connect main_window
toximu Jun 5, 2025
9817af2
pull
toximu Jun 5, 2025
43b0626
main_window works good!
toximu Jun 5, 2025
9a5f04f
Merge pull request #20 from toximu/connect_main_window
toximu Jun 8, 2025
5e12772
docs: update build and run app instruction
mirotvoretts Jun 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ doc/api/
*.out

local.properties
**/main.cpp
!client/main.cpp
!client/client/test_server.cpp
!server/main.cpp

main.cpp

*pb*
*pb*
34 changes: 5 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
cmake_minimum_required(VERSION 3.16)

project(EfficioTaskTracker LANGUAGES CXX)
project(test-server)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
#add_compile_options(-fsanitize=address,undefined,leak)
#add_link_options(-fsanitize=address,undefined,leak)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 COMPONENTS Widgets Core Gui Sql REQUIRED)

add_subdirectory(scripts)
add_subdirectory(database)
add_subdirectory(ui/main-window)
add_subdirectory(ui/authorization-windows)
add_subdirectory(ui/note-widget)
add_subdirectory(server)
add_subdirectory(proto)
add_executable(EfficioTaskTracker main.cpp)

target_link_libraries(EfficioTaskTracker PRIVATE
Qt6::Widgets
Qt6::Core
Qt6::Gui
Qt6::Sql
model-proto
efficio-rpc
Database
Scripts
AuthorizationWindows
MainWindow
NoteWidget
)
add_subdirectory(client)
51 changes: 33 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
git clone git@github.com:toximu/efficio-task-tracker.git
```

2. Start **PostgreSQL** service

```bash
sudo service postgresql start && sudo -u postgres psql
```

3. Create **efficio** user
2. Create **efficio** user

```SQL
CREATE USER efficio WITH PASSWORD 'admin';
Expand All @@ -39,29 +33,50 @@ GRANT ALL PRIVILEGES ON DATABASE efficio TO efficio;
\q
```

4. Enter under **efficio** profile
3. Build

```bash
psql -U efficio -d efficio -h localhost
mkdir -p build && cd build
cmake ..
make
```

> After that run the server on address **localhost** and **port** 5432 in your pgAdmin4

5. Build and start app
4. Run the server and client in different terminal windows

```bash
mkdir -p build && cd build
cmake ..
make
./EfficioTaskTracker -platform xcb
build/server/Server
build/client/EfficioTaskTracker
```

## Recent problems

### 1) libpqxx not installed

```shell
CMake Error at server/service/CMakelists.txt:8 (find_package):
By not providing "Findlibpqxx.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "libpqxx",
but CMake did not find one.
```

1) Clone [libpqxx repository](https://github.com/jtv/libpqxx) into `server/`
2) `cd libpqxx/` then build and install it

```shell
cmake .
cmake --build .
cmake --install .
```

Now try to build **EFFICIO** one more time

## Technologies Used
- Qt 6.8.2
- PostgreSQL 17.4
- CMake 3.28.3
- VcXsrv server (XLaunch)
- gRPC 1.72.0
- pqxx 7.9.2-1

## License

This project is licensed under the **MIT License**. See the [LICENSE](https://github.com/toximu/efficio-task-tracker/blob/main/LICENSE) file for details.
This project is licensed under the **MIT License**. See the [LICENSE](https://github.com/toximu/efficio-task-tracker/blob/main/LICENSE) file for details.
34 changes: 34 additions & 0 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cmake_minimum_required(VERSION 3.16)

project(EfficioTaskTracker LANGUAGES CXX)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 COMPONENTS Widgets Core Gui Sql REQUIRED)

add_subdirectory(ui/main-window)
add_subdirectory(ui/note-widget)
add_subdirectory(ui/authorization-windows)
add_subdirectory(ui/theme-manager)
add_subdirectory(client)
add_executable(EfficioTaskTracker main.cpp)

target_link_libraries(EfficioTaskTracker PRIVATE
model-proto
Qt6::Widgets
Qt6::Core
Qt6::Gui
Qt6::Sql
Database
Client
NoteWidget
MainWindow
AuthorizationWindows
ThemeManager
model-proto
)
34 changes: 34 additions & 0 deletions client/client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cmake_minimum_required(VERSION 3.16)

project(Service LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
find_package(Threads)


file(GLOB SOURCES "src/*.cpp")
file(GLOB HEADERS "include/*.h")

add_library(Client STATIC ${SOURCES} ${HEADERS})

target_link_libraries(Client
model-proto
efficio-rpc
protobuf::libprotobuf
gRPC::grpc
gRPC::grpc++
Service
)

target_include_directories(Client
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)

add_executable(test-server test_server.cpp)
target_link_libraries(test-server Client)
63 changes: 63 additions & 0 deletions client/client/include/auth_requests.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#pragma once

#include <common_client_call.h>
#include <efficio-rpc-proto/efficio.grpc.pb.h>
#include <grpcpp/grpcpp.h>
#include "common_client_call.h"

using Efficio_proto::Auth;
using Efficio_proto::AuthRequest;
using Efficio_proto::AuthResponse;
using Efficio_proto::User;
using grpc::Channel;
using grpc::ClientAsyncResponseReader;
using grpc::CompletionQueue;

class AuthRequests {
public:
explicit AuthRequests(
const std::shared_ptr<Channel> &channel,
CompletionQueue *cq
);

bool try_authenticate_user(User *user) const;
bool try_register_user(User *user) const;

private:
class TryAuthenticateUserClientCall : public CommonClientCall {
public:
TryAuthenticateUserClientCall(
const AuthRequest &request,
CompletionQueue *cq,
Auth::Stub *stub
);
void Proceed(bool ok) override;
AuthResponse get_reply();

private:
AuthResponse reply_;
ClientContext context;
Status status;
std::unique_ptr<ClientAsyncResponseReader<AuthResponse>> responder_;
};

class TryRegisterUserClientCall : public CommonClientCall {
public:
TryRegisterUserClientCall(
const AuthRequest &request,
CompletionQueue *cq,
Auth::Stub *stub
);
void Proceed(bool ok) override;
AuthResponse get_reply();

private:
AuthResponse reply_;
ClientContext context;
Status status;
std::unique_ptr<ClientAsyncResponseReader<AuthResponse>> responder_;
};

std::unique_ptr<Auth::Stub> stub_;
std::unique_ptr<CompletionQueue> cq_;
};
48 changes: 48 additions & 0 deletions client/client/include/client_implementation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#ifndef CLIENTIMPLEMENTATION_H
#define CLIENTIMPLEMENTATION_H

#include <grpcpp/grpcpp.h>
#include <thread>
#include "auth_requests.h"
#include "update_requests.h"

using Efficio_proto::User;
using grpc::Channel;
using grpc::CompletionQueue;

class ClientImplementation {
CompletionQueue cq_;
std::shared_ptr<Channel> channel_;
UpdateRequests update_requests_;
AuthRequests auth_requests_;

public:
explicit ClientImplementation(const std::shared_ptr<Channel> &channel);
std::thread complete_rpc_thread_;

void CompleteRpc();
std::shared_ptr<Channel> get_channel();
CompletionQueue *get_cq();

bool try_authenticate_user(User *user);
bool try_register_user(User *user);

bool try_update_note(Note *note) const;
bool try_create_note(Note *note, const std::string& project_code) const;
bool try_fetch_note(Note *note) const;

bool create_project(
Project *project,
const std::string &title,
const User &user
);
bool get_project(Project *project, const std::string &code);
bool try_join_project(
Project *project,
const std::string &code,
const User &user
);
bool try_leave_project(const std::string &code, const User &user);
};

#endif // CLIENTIMPLEMENTATION_H
20 changes: 20 additions & 0 deletions client/client/include/common_client_call.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef COMMON_CLIENT_CALL_H
#define COMMON_CLIENT_CALL_H

#include <grpc++/grpc++.h>

using grpc::ClientContext;
using grpc::Status;

class CommonClientCall {
public:
explicit CommonClientCall() = default;
virtual ~CommonClientCall() = default;

ClientContext context;
Status status;

virtual void Proceed(bool = true) = 0;
};

#endif // COMMON_CLIENT_CALL_H
Loading