Code Monkey home page Code Monkey logo

sudosos-backend's Introduction

Welcome to SudoSOS

Hi welcome to SudoSOS. To get you quickly started follow the install steps below.

Quick start

This quick start first states what software needs to be installed to be able to work with the project and then explains how to get the project started.

Prerequisites:

  • Have Node.js installed. Version 18 is required.
    • Note that NPM 14.16 (latest) might not run the coverage on Linux. This is probably a race condition in the package and is being addressed.
  • Have Git and possibly a Git manager installed
  • Have OpenSSL installed (if you're using Git Bash you already have OpenSSL)
  • Have a SQLite viewer installed (optional, you can also set it to be saved in another database, but SQLite is the default). Recommended tools are DB Browser for SQLite or DataGrip.

Installing:

  • Checkout the Git to your favorite directory -- If your path contains spaces you are basically begging for problems, and that is entirely your own fault
  • Copy .env.example to .env
  • Run npm install in this base directory
  • Run openssl genrsa -out config/jwt.key 2048
  • Check that there exists a jwt.key file in the config directory starting with -----BEGIN RSA PRIVATE KEY-----
  • Run npm run swagger
  • Run npm run build
  • Run npm run test - All of these should now pass

Running:

  • OR without seed

    • Run npm run schema
    • Check that local.sqlite exists and open it
    • Create an entry in the user table (INSERT INTO "user"(createdAt, updatedAt, version, firstName, lastName, active, deleted, "type") VALUES(datetime('NOW'), datetime('NOW'), 1, 'firstName', 'lastName', 1, 0, 1))
    • Remember the userId (probably 1)
  • OR with seed

    • Run npm run seed
  • Run npm run watch to start the application in development mode

  • Check that http://localhost:3000/api-docs shows a swagger ui

  • You can get a JWT key by using /authentication/mock using a valid userId. You can then use this token to for example set a password to log in on the frontend

  • IN SWAGGER UI USE Bearer <token> TO GET THINGS TO WORK!!

Intellij hints

Easy ESLint intergration

To make sure ESLint fixes your code on save do the following:

  • Have Webstorm version 2020.1 or higher installed
  • Go to Preferences - Language and Frameworks - Javascript - Code Quality Tools - Eslint
  • check Run ESLint --fix on save
  • Apply changes and press ok

sudosos-backend's People

Contributors

justsamuel avatar yoronex avatar kevinjil avatar r4lfe avatar woutderuiter avatar lordalisat avatar gijsbellaard avatar rjbrinkman avatar codenamedrobin avatar svenmokveldje avatar rinkp avatar gewisabc avatar jorisparee avatar supervk avatar tomudding avatar

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.