Coder Social home page Coder Social logo

swiftcommerce / productmanager Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 2.0 675 KB

A micro-service that manages products, categories and attributes. Servers as a backend for classical store frontends.

Home Page: https://www.skelpo.com

License: MIT License

Swift 99.18% Dockerfile 0.82%
swift serverside-swift vapor vapor-swift product-management products product microservice

productmanager's Introduction

Product Manager

The Product Manager is a micro-service that works as the catalog for an e-commerce app. It is built with the server-side Swift framework Vapor.

Setup

After you have forked and cloned the service, you will need to do a little setup so it can run:

  1. MySQL

    Product Manager stores its data in a MySQL database. First, you need to install it:

    Homebrew:

    brew install mysql
    mysql_secure_installation

    APT:

    sudo apt-get update
    sudo apt-get install mysql-server
    mysql_secure_installation

    By default, the service expects the MySQL user to be root and the password to be password, but you can either change the value in the configuration of set the DATABASE_USER and DATABASE_PASSWORD environment variables.

    You then need to create a database called product_manager, or, as before, you can name it something else and change the config or set DATABASE_DB

  2. JWT Tokens

    Product Manager uses JWT bearer authentication for protecting routes that mutate a collection (POST, PATCH, and DELETE routes). Product Manager relies on another service to create the token when the user authenticates, but it still needs to verify the token. To do this, it needs access to the token's public key. You can give access by assigning it to the JWT_PUBLIC key.

Documentation

You can read the API documentation here.

Vapor Cloud

The MySQL configuration is setup to work seamlessly with Vapor Cloud. Just make sure your replica has a MySQL database for it.

To set the JWT public key, you can run vapor cloud config modify JWT_PUBLIC=<TOKEN> from your project root.

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.