commit | cfa4430e5ef1c73f02a495b01247ce297c2a1d34 | [log] [tgz] |
---|---|---|
author | Misha Krieger-Raynauld <mkriegerraynauld@gmail.com> | Wed Nov 30 18:36:36 2022 -0500 |
committer | Misha Krieger-Raynauld <mkriegerraynauld@gmail.com> | Fri Dec 02 15:45:50 2022 -0500 |
tree | 1f569197184a500819da98f9ae64b9614fdf6ca0 | |
parent | 641b262b8f66b35d4167968256c7445a3d7c4f3c [diff] |
Create new interfaces for objects transmitted using the REST API Changes: - Create new IContact, IAccount, and IConversation interfaces in common/ - These interfaces represent the serialized versions of the models which are transferred - The client models are classes which implement these interfaces - Create new LookupResult interface for nameserver lookup results - Create new IConversationMember interface for conversation members - The client interface ConversationMember extends this interface to have a Contact field rather than IContact - Create new ConversationInfos interface for conversation infos - Create new ContactDetails interface for contact details (used by contacts routes) - Move request and response body interfaces into common/ - Merge AccountConfig into AccountDetails interface - Create interfaces for server-only objects: - ConversationMemberInfos - ConversationRequestMetadata - Ensure interfaces in jami-signal-interfaces.ts do not contain fields with JamiSwig types - Rename models/ filenames to camelCase as they are not components - Rewrite client models to have proper TypeScript accessors and remove unused getters - Rewrite how client models are initialized from the serialized interface using .fromInterface static methods - Make client models implement the interfaces in common/ for consistency - Remove unneeded _next parameter for Express.js route handlers - Use Partial<T> for all Express.js request body types on server - Type all Axios response body types with interfaces GitLab: #92 Change-Id: I4b2c75ac632ec5d9bf12a874a5ba04467c76fa6d
The web version of Jami.
The repo is structured as 4 subprojects:
client
: the web front-end made with Reactserver
: the back-end server made with Express.js, which starts a daemon instancecommon
: the common code used by both client
and server
daemon
: a submodule containing the Jami daemonLinux
Build from source with the following instructions: https://swig.org/svn.html
Note: you will need have Bison installed. On Ubuntu, this can be installed using
sudo apt install bison
.
git clone https://github.com/swig/swig.git cd swig ./autogen.sh ./configure make sudo make install
Install the required dependencies: https://docs.jami.net/build/dependencies.html
Note: for Ubuntu, the minimally needed dependencies are:
sudo apt install git build-essential cmake automake autoconf autopoint libtool pkg-config libdbus-1-dev libva-dev libvdpau-dev libasound2-dev libpulse-dev libudev-dev libexpat1-dev ssnasm yasm yasm nasm
Compile the dependencies:
cd daemon/contrib mkdir native cd native ../bootstrap make -j$(nproc)
Install node-gyp
to build the daemon with Node.js bindings:
npm install -g node-gyp
Compile the daemon with Node.js bindings:
cd ../.. ./autogen.sh ./configure --with-nodejs make -j$(nproc)
Create a symlink to jamid.node
in server
:
cd ../server ln -s ../daemon/bin/nodejs/build/Release/jamid.node jamid.node cd ..
npm install
This will install the relevant dependencies for all subprojects and configure Git hooks.
Start both the client and server:
LD_LIBRARY_PATH="${PWD}/daemon/src/.libs" npm start
You can also start the client and server individually:
npm start --workspace client LD_LIBRARY_PATH="${PWD}/daemon/src/.libs" npm start --workspace server
Open http://localhost:3000 in your browser to view the app.
npm run build
LD_LIBRARY_PATH="${PWD}/daemon/src/.libs" npm run start:prod
npm run lint
Lint and fix files:
npm run lint:fix
npm run format
npm run clean
You may instead wish to use a Docker container for development.
This allows you to avoid having to install all the dependencies needed to build the daemon on your computer. The container is meant for development: it uses bind mounts to mount the source code from your computer into the container, so that the container rebuilds the project whenever changes are made locally.
Build the Docker image for the daemon:
docker-compose build jami-daemon
Build the Docker image for Jami web:
docker-compose build
Run the Docker container:
docker-compose up
Build the Docker image for the daemon:
cd daemon docker build --build-arg config_args="--with-nodejs" -t jami-daemon . cd ..
Build the Docker image for Jami web:
docker build --target development --t jami-web .
Run the Docker container:
docker run -it \ -p 3000:3000 \ -p 5000:5000 \ --volume ${PWD}/client/src:/web-client/client/src \ --volume ${PWD}/server/src:/web-client/server/src \ --volume ${PWD}/client/.env.development:/web-client/client/.env.development \ --volume ${PWD}/server/.env:/web-client/server/.env \ jami-web