Giter Club home page Giter Club logo

codever's Introduction

Codever

โšก๐Ÿ”–๏ธ Bookmarks and snippets manager for developers & co ๐Ÿ”–โšก๏ธ


๐Ÿ‘‰ Use our HowTo pages to get you going and start saving time and nerves when managing your bookmarks and code snippets. The following helpers and extensions will assist you along the way:

Extensions

Bookmarklet Chrome Firefox IntelliJ Plugin VSCode extension
Bookmarklet Chromium Extension Firefox Addon IntelliJ Plugin VSCode Extension

Chrome extension usage example - save snippet

Save to Codever chrome extension usage

The other extensions function more or less after the same principle

Public bookmarks


Worthy public bookmarks are published regularly on Github at CodeverDotDev/bookmarks.


Setup (development or self hosting)

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

The project is developed with the MEAN stack and Keycloak for authentication and authorization: components-graph

The project contains two apps

  • codever-ui which makes up the User Interface. This uses with Angular and Angular CLI.
  • codever-api which is the API supporting the UI. It uses ExpressJS with MongoDB and Keycloak. See the OpenAPI specification

Prerequisites

What you need to run this app:

  • node and npm (we recommend using NVM)
    • Ensure you're running Node at least (v16.x.x+) and NPM (8.x.x+)
  • nodemon - npm install -g nodemon
  • Docker - we recommend using Docker Desktop

Docker and Docker-compose are currently used only for local development

Installing (development setup)

Start MongoDB and Keycloak server

โš ๏ธ ย  When you run docker compose for the first time uncomment the following -Dkeycloak.migration.action=import line :

    #command: -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=dir -Dkeycloak.migration.dir=/tmp/keycloak/export-import -Dkeycloak.migration.strategy=IGNORE_EXISTING

in the docker-compose file, so that the initial Keycloak setup (realm and users) is loaded.

โš ๏ธ ย  For further startups of docker-compose you should comment back this line, as it starts faster

docker-compose up

Use -d to run it in the background

Install and run (frontend & backend)

You want to have the backend API running first with the following commands:

# install
nvm use   #only if you are using nvm
npm install

# run
npm run frontend #to run the frontend
npm run backend #to run the backend

#alternatively run in parallel
npm start

or in one line nvm use; npm install; npm start

This starts

  • the API with nodemon at http://localhost:3000/api and will watch for code changes in backend and automatically redeploy.
  • the frontend available at http://localhost:4200. Login the user/password mock/mock configured for you in the initial Keycloak setup. Some bookmarks are initially loaded with your account, so you can start playing with them.

You can create your own test user, or any other extra users by following the screenshots in Add a Keycloak user to create it.

To be able to automatically add youtube videos published date and duration to the title you need to create a nodemon.json file based on the backend/nodemon.json.example and add your own youtube api key

Testing

E2E (integration) tests with Cypress

Keycloak and mongodb have to be started as specified above (docker-compose up command)

Run the integration test by issuing the following command.

cd apps/codever-ui
npm run cy:run

To open Cypress you can run the following task npm run cy:open

API (backend)

Integration tests

Keycloak and mongodb have to be started as specified above (docker-compose up command)

Run the integration test by issuing the following command.

cd apps/codever-api
npm run integration-tests

A report will be generated.

Debugging

UI (Frontend)

Dev Tools in Chromium browsers

You can use the Dev Tools in Chromium based browsers (e.g. Chrome, Brave). Navigate to Sources and the file you want to set your break points, like in the following example:

chrome-dev-tools-debugging

IntelliJ

In IntelliJ you add Javascript Debug configuration as shown below:

Intelli-frontend-debugging

Backend

IntelliJ / Webstorm (Node.js plugin is required)

The npm run debug starts nodemon with the --inspect parameter so you can attach to this process, by using the following configuration:

nodejs-remote-debugging

Visual Studio Code

See Node.js debugging in VS Code with Nodemon

Blog

Blog posts related to Codever features and implementation details can be found on Codepedia.org and Dev.to

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Changelog

The changelog is available in CHANGELOG.md

To update the changelog execute the following commands:

nvm use
standard-changelog

License

This project is licensed under the MIT License - see the LICENSE file for details.

All media materials used in the project fall under the copyright law

codever's People

Contributors

adixchen avatar dependabot[bot] 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

codever's Issues

Add user notifications

Show a bell besides the user's avatar. When clicked a list of notifications a la Facebook should appear.

List of notifications could be:

  • users following you
  • likes on your posts
  • "post" you might be interested in..

Add favicons

Add favicons to bookmarks to easily recognise the source of the bookmark.

Fallback to default icon (or no icon) when no favicon is present or error

Autocomplete tags in search box

For example when start typing "[" or "t:" launch autocomplete for my tags (if logged in) and main public tags (when not logged in).

Share via link private snippets or bookmarks too

When the snippets and bookmarks are private give the possibility to share them with others via link, by generting a not guessable (URL, id) that maps to the original id... (if it is public already it should not be a problem)

A la create link for google-photo albums...

Add comments to bookmark posts

Add comments functionality to bookmark posts - in the list will be shown only a comment icon plus number of comments. When clicked the comments are shown (probably in a new page with detailed overview of the bookmark) and the possibility to add your comments.

Add Back Button (link to home page) in Login/Register Form

In some browsers (Firefox and Safari) when you are automatically redirected to Login/Register Form in Keycloak you cannot go back (it is confusing, first of all for new users).

So adding a back button/link in the Keycloak form should ease the problem.

Add to History also when link inside "bookmark" is clicked

It happens very often that when I bookmark a link, I have related or sub-links in the description, instead of bookmarking all of them separately.

When I click one of those sub-links I want the main bookmark to appear in the History tab and soon to be implemented shortcut...

Add clean-up section for personal bookmarks

Beside read later tab add a clean-up tab where the user can get to do some clean up:

  • delete personal (not public) bookmarks that she hasn't accessed in the last 3 years for example (public maybe if they haven't been by at least somebody else besides the user) - move the public ones to a generic account if already starred by someone
  • delete personal bookmarks by tag (useful for private bookmarks) - DONE
  • Danger Zone - delete account (remove account from keycloak, delete all personal bookmarks and the public bookmarks starred by someone else move to generic account

One more sql command needed

Hi! To do succesfully the user privilage changes, you should add this sql Command (at the end): 'FLUSH PRIVILEGES;'
Nice tutorial!

jboss.naming.context.java.module.auth.auth.DefaultDataSource is missing

I edited everything according to you but I'm getting this error please see logs and let me know if you need any other details I'm using mysql 5.7.20 server and keycloak 6.0.1

\Users\Akash\Desktop\keycloak_6.0.1\keycloak-6.0.1\bin\standalone.conf.bat"
A property to "C:\Program Files\Java\jdk1.8.0_241\bin\java"

tstrap Environment

E: "C:\Users\Akash\Desktop\keycloak_6.0.1\keycloak-6.0.1"

\Program Files\Java\jdk1.8.0_241\bin\java"

: "-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.

====================================================================

0 INFO [org.jboss.modules] (main) JBoss Modules version 1.9.0.Final
3 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.5.Final
1 INFO [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
7 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: Keycloak 6.0.1 (WildFly Core 8.0.0.Final) starting
1 INFO [org.wildfly.security] (ServerService Thread Pool -- 19) ELY00001: WildFly Elytron version 1.8.0.Final
5 INFO [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=manag
ement-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description oper
arn more about the deprecation.
1 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 25) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem
erver=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-descr
ation to learn more about the deprecation.
4 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
8 INFO [org.xnio] (MSC service thread 1-4) XNIO version 3.6.5.Final
0 INFO [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.6.5.Final
2 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 36) WFLYCLINF0001: Activating Infinispan subsystem.
9 INFO [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 50) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
5 INFO [org.jboss.as.security] (ServerService Thread Pool -- 47) WFLYSEC0002: Activating Security Subsystem
3 INFO [org.jboss.as.jaxrs] (ServerService Thread Pool -- 37) WFLYRS0016: RESTEasy version 3.6.3.Final
3 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0003: Undertow 2.0.19.Final starting
5 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 42) WFLYNAM0001: Activating Naming Subsystem
2 INFO [org.jboss.as.security] (MSC service thread 1-6) WFLYSEC0001: Current PicketBox version=5.0.3.Final
3 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 48) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This
for environments running multiple servers. Please make sure the attribute value is unique.
2 INFO [org.wildfly.extension.microprofile.config.smallrye.private] (ServerService Thread Pool -- 49) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
3 INFO [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 51) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
8 INFO [org.jboss.as.connector] (MSC service thread 1-1) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.12.Final)
9 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default]
0 INFO [org.jboss.as.naming] (MSC service thread 1-1) WFLYNAM0003: Starting Naming Service
0 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
1 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 52) WFLYUT0014: Creating file handler for path 'C:\Users\Akash\Desktop\keycloak_6.0.1\keycloak-6.
-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
9 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 31) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (
)
0 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0018: Started Driver service with driver-name = mysql
9 INFO [io.smallrye.metrics] (MSC service thread 1-7) Converted [2] config entries and added [4] replacements
6 INFO [io.smallrye.metrics] (MSC service thread 1-7) Converted [3] config entries and added [14] replacements
8 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0010: Unbound data source [java:/jboss/datasources/KeycloakDS]
6 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 35) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on you
le processors
8 INFO [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from
of CPUs on this host.
9 INFO [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from
ker pool sizing.
6 INFO [org.jboss.as.patching] (MSC service thread 1-1) WFLYPAT0050: Keycloak cumulative patch ID is: base, one-off patches include: none
9 INFO [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 5.0.8.Final
9 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-7) WFLYDM0111: Keystore C:\Users\Akash\Desktop\keycloak_6.0.1\keycloak-6.0.1\standalone\configur
cation.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
9 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0012: Started server default-server.
4 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\Akash\Desktop\keycloak

oak-6.0.1\standalone\deployments
0 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0018: Host default-host starting
2 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "keycloak-server.war" (runtime-name: "keycloak-server.war")
6 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
0 INFO [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0493: EJB subsystem suspension complete
0 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0001: Bound data source [java:/jboss/datasources/KeycloakDS]
1 WARN [org.jboss.as.dependency.private] (MSC service thread 1-7) WFLYSRV0018: Deployment "deployment.keycloak-server.war" is using a private module ("org.kie") which
ged or removed in future versions without notice.
9 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
0 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-8) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.8.Final
8 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 67) WFLYCLINF0002: Started work cache from keycloak container
0 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 57) WFLYCLINF0002: Started actionTokens cache from keycloak container
6 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 56) WFLYCLINF0002: Started authorization cache from keycloak container
2 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 61) WFLYCLINF0002: Started loginFailures cache from keycloak container
4 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 65) WFLYCLINF0002: Started clientSessions cache from keycloak container
5 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 62) WFLYCLINF0002: Started offlineSessions cache from keycloak container
9 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 60) WFLYCLINF0002: Started offlineClientSessions cache from keycloak container
2 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 58) WFLYCLINF0002: Started users cache from keycloak container
1 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 59) WFLYCLINF0002: Started keys cache from keycloak container
9 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0002: Started authenticationSessions cache from keycloak container
7 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 66) WFLYCLINF0002: Started sessions cache from keycloak container
7 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 64) WFLYCLINF0002: Started realms cache from keycloak container
0 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 68) WFLYCLINF0002: Started client-mappings cache from ejb container
8 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0273: Excluded subsystem weld via jboss-deployment-structure.xml does not exist.
4 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0273: Excluded subsystem webservices via jboss-deployment-structure.xml does not exist.
8 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "keycloak-server.war
ure description: {
L0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.ExampleDS"],
L0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.auth.auth.DefaultDataSource is missing [jboss.naming.context.java.jboss.dat
ampleDS]"]

9 INFO [org.jboss.as.server] (ServerService Thread Pool -- 53) WFLYSRV0010: Deployed "keycloak-server.war" (runtime-name : "keycloak-server.war")
1 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
: New missing/unsatisfied dependencies:
ce jboss.naming.context.java.jboss.datasources.ExampleDS (missing) dependents: [service jboss.naming.context.java.module.auth.auth.DefaultDataSource]
: 9 additional services are down due to their dependencies being missing or failed
4 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
3 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
5 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
0 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: Keycloak 6.0.1 (WildFly Core 8.0.0.Final) started (with errors) in 48072ms - Started 562 of 835 services (1
failed or missing dependencies, 559 services are lazy, passive or on-demand)

add all private capability

the user can select this option then his account will not be visible and she doesn't have the option displayed to make bookmarks public (all her bookmarks are private). She can opt in and out out of this option, probably via account settings page.

Add collections with autocomplete function when searching

Introduce collections to group bookmarks and snippets as a level above tags. If so add autocompletion when searching "c:(then autocomplete)" . Just ONE unique collection per Bookmark/snippet.

Maybe also add the possibility to add a color to the bookmarks that are part of the collection.

Add Import from Chrome Bookmarks possibility

Under User Settings for example add the possibility to upload your chrome (later firefox) bookmarks to www.bookmarks.dev
Existing url won't be overwritten (maybe add the "imported" tab to it)

  • all imported are private bookmarks

Display possibility on first login welcome screen

Authentication + Authorization from Angular2 app

Hi, thanks for sharing this pretty useful and detailed information, it is great to see that people share their knowledge and experience, so congrats. I would like to ask if you have done Authentication + Authorization from the Frontend App. I'm dealing with an issue where I can authenticate without problem from my AngularJS app, but later I need to get an Authorization token (with all permissions) the user has. But I'm facing a CORS issue when doing the second API call to Keycloak. I configured correctly my Web Origin (actually in dev environment I have "*" in web origin), so I can pass that authentication stage but once I arrive authorization phase I get blocked. Do you know how to solve this problem? Am I doing wrong trying to get authorization from Frontend app?

Import gists from Github

Probably via personal access token with access only to gists (one time, store only in memory)...

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.