Skip to content
API supporting the Bookmark Manager for Developers & Co
JavaScript Dockerfile
Branch: develop
Clone or download
Latest commit 10699a1 Dec 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin unify error-handling, unify userId validation and create services for… Dec 5, 2019
docker-compose-setup unify error-handling, unify userId validation and create services for… Dec 5, 2019
docs
resources add linting - two minor problems left Nov 14, 2019
src unify error-handling, unify userId validation and create services for… Dec 5, 2019
.dockerignore got it running with docker but still 403 forbidden by api call Oct 20, 2019
.editorconfig add .editorconfig file Oct 6, 2016
.eslintrc.json add linting - two minor problems left Nov 14, 2019
.gitignore add linting - two minor problems left Nov 14, 2019
.nvmrc update node version to 10.15.0 in .nvmrc Feb 3, 2019
CONTRIBUTING.md add contributing to README Oct 25, 2019
Dockerfile got it running with docker but still 403 forbidden by api call Oct 20, 2019
LICENSE Update license Dec 5, 2019
README-docker-compose.md move docker-compose init files to own directory Oct 24, 2019
README.md unify error-handling, unify userId validation and create services for… Dec 5, 2019
docker-compose.yml move docker-compose init files to own directory Oct 24, 2019
env.json make run the integration tests run in docker Oct 29, 2019
nodemon.json.example make run the integration tests run in docker Oct 29, 2019
package-lock.json unify error-handling, unify userId validation and create services for… Dec 5, 2019
package.json unify error-handling, unify userId validation and create services for… Dec 5, 2019
pm2-process.example.json minor corrections in readme Oct 29, 2019

README.md

Bookmarks.dev-API

Back-end REST API for www.bookmarks.dev.

Built With

components-graph

The production setup is can be found here - components production


Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What you need to run this app:

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

Installing (development setup)

A step by step series of examples that tell you how to get a development env running

Start MongoDB and Keycloak server

docker-compose up

OR

docker-compose up -d # if you want it to run in the background

Create a Keycloak user (2 min)

To test with the front-end bookmarks.dev create a Keycloak test user. Follow the screenshots in Add a Keycloak user to create it.

Start the development server (API)

nvm use
npm install
npm run debug

This will start the API with nodemon and will watch for code changes and automatically redeploy.

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 nodemon.json.example and a real youtube api key

Debugging

IntelliJ / Wegstorm (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

Get Keycloak access token via API call

To get a keycloak access token via API call see Get Access Token from Keycloak via API call

Testing

Integration tests

Start Keycloak and mongodb by issuing the docker-compose up command

Run the integration test by issuing the following command.

npm run integration-tests

A report will be generated.

Swagger docs

Deployment

We currently use pm2 to start the project in production.

Start

pm2 start pm2-process.json --env production

Commited is a pm2-process.exammple.json example file

Restart

pm2 restart pm2-process.json --env production

Stop

pm2 stop pm2-process.json --env production

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.

License

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

Appendix

You can’t perform that action at this time.