Giter Site home page Giter Site logo

kryptokrona / hugin-api Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 8.0 8.51 MB

RESTful API and WebSocket server for the Hugin Messenger service.

Home Page: https://kryptokrona.org

License: Other

Dockerfile 0.24% JavaScript 69.94% Shell 0.38% Jinja 8.01% CSS 18.69% Python 2.73%
hugin restful-api blockchain p2p kryptokrona xkr express swagger

hugin-api's Introduction

Hugin API

build release license slack discord

Hugin is a messaging service where messages are stored on the Kryptokrona Blockchain. Messages are secured with industry leading encryption so that only you and your chat partner have the possibility to read them. The purpose is not to gather any personal information about the users, unlike most apps and social media.

Hugin also packs some powerful decentralized P2P encrypted features like video, voice, screen sharing and filesharing.

To be able to get data more easily from Hugin this RESTful API and websocket server called Hugin API was created. It provides useful endpoints for within the Kryptokrona project as well as other external 3rd party interests that wants to host their own Hugin API.

Table of Contents

Development Resources

Sponsors

The following sponsors are either helping the project with free usage, great discounts of services or in other ways helping via advertisement.

Novastack Hosting

Usages

Our API is useful! Projects using Hugin API:

If you are using Hugin API, please fork and make a pull request into our repo with your added link.

Contributors

The following contributors have either helped to start this project, have contributed code, are actively maintaining it (including documentation), or in other ways being awesome contributors to this project. We'd like to take a moment to recognize them.

jo7an TechyGuy17 Coffeboi Swepool f-r00t

License

The license is BSD-3 License.

hugin-api's People

Contributors

coffeboi avatar f-r00t avatar marcuscvj avatar mjovanc avatar n9lsjr avatar swepool avatar techyguy17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hugin-api's Issues

Add threads of posts

We need to store information about threads of a specific post when someone replies. Probably we need a junction table to store this data.

Add monitoring software

It would be nice to have a monitoring software to setup with Ansible such as Prometheus so we can see statistics of the VPS graphically on the web such as CPU/RAM/disk usage etc.

Definition of Done (DOD):

Bonus additions:

  • Add metric such as posts added to API over time
  • Add metric of how many hashtags added to API
  • Add metric of how many encrypted posts added to API

Store reply to a post

Check if a reply exists and save it to database for a post.

Files that needs to be updated (perhaps more):

  • database/models/post.js
  • database/migrations/20220426141549-create-post.js
  • configs/huginSyncer.js

All unit tests needs to be updated in with new field:

  • tests/controllers/post.js

Implement rollback pipeline

If we run the main pipeline and deploy and the smoke test fails we need to handle rollbacks. It should get the previous docker container with the previous commit SHA and deploy it once again. Then we only need to run a deploy job and smoke test again since the docker image is already built since before.

Categorize content based on language

All messages should be analysed and categorised into a language category so a user can then select what kind of messages to subscribe to. To be more selective.

Definition of done (DOD):

  • Create new function in huginSyncer.js called detectLanguage(text)
  • Add new column on post table called "language"
  • Create migration file using command
npx sequelize-cli migration:create --name create_language_column
  • Update post model with new field
  • Use i18n.detectLanguage() see link in comment for detecting the language used for a string
  • Update huginSyncer to save the new field in the messageObj
  • Update unit test in tests/utils/messageCriteria.js with new field language.
  • Update unit test in tests/controllers/post.js with new field language.
  • Update seeder in database/seeders/20220426144921-Post.js with new field so the database will populate correctly.

Fix NGINX conf SSL directive

2022/05/10 21:14:35 [warn] 59348#59348: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/sites-enabled/le:13

Show if the API is up and running in the HTML document

We need a way to display in the HTML document if it can not access the API or if it's up and running.

Definition of done (DOD):

  • When the API is down, show a message as "Could not connect to Hugin Cache API".
  • When the API is up, show a subtile message like "Hugin Cache API is operational".

Configurable system

We need to implement a way so that a user running the system should be able to:

  • Configure a clean method to work directly if the user wants even if the maximum storage is below (80-90%) to remove old data from previous week/month/year

Implement logging

We need to save the log output to a file. This should be mapped to a volume locating outside the Docker container.

Remove frontpage

We don't need the frontend. All the API endpoints is much better suited to be viewed/tested on our Postman account. And since people are going to use this and host it, it just feels unnecessary.

Save your own encrypted posts with keypair

Private Hugin Syncer to save encrypted messages that you write using Hugin Messenger.

This could be used by third party to allow for private communication with Hugin Cache server.

known_keys (public keys) which the user can decrypt.

This is to be used with both boards posts and/or encrypted posts.

New table: posts_encrypted

Null values of properties of a post

Some posts that get's created in the DB gets null values for some reason. We need to investigate why. This is what it looks like:

{
            "id": 7,
            "message": null,
            "key": null,
            "signature": null,
            "board": null,
            "time": null,
            "nickname": null,
            "tx_hash": "946a5d2552e3082ab8ec5d1166e08f320cc695a2122855a9585ab8869a2a88bc",
            "createdAt": "2022-05-11",
            "updatedAt": "2022-05-11"
        },

Usage of appropriate status codes

We need to implement appropriate status codes when user request something with for example faulty parameters or similar, currently we get a 500s and that's not a good way.

Add staging server

Add a staging server that we can test deploy to and conduct load testing and smoke test before starting production deployment.

Cache data to improve performance

Add caching to return data from the local memory cache instead of querying the database to get the data every time we want to retrieve some data that users request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.