Giter Club home page Giter Club logo

freshcom_web's Introduction

Freshcom Web

This repo contains the web layer of the Freshcom Project. It builds on top of freshcom and provides a JSON API. This repo does not contain any UI

  • For a back office UI please checkout freshcom_dashboard.
  • You will have to build your own storefront UI, we recommand VueJS but any solid SPA framework will do.

Status of Development

Currently in early development with estimated alpha version in 6-12 months.

Getting Started

External Dependencies

Since freshcom_web depends on freshcom to do all the heavy lifting, please checkout the external dependencies of freshcom and make sure you have all the external dependencies.

Setup

1. Install Mix Depedencies

Since freshcom is not yet published as a mix package, you will need to clone it first to make it available locally.

$ git clone https://github.com/freshcom/freshcom
$ git clone https://github.com/freshcom/freshcom_web
$ cd freshcom_web
$ mix deps.get

2. Generate RSA Key Pairs

freshcom_web uses RSA key pairs to sign tokens used for authentication so use the following to generate the key pairs.

$ mkdir keys/dev
$ cd keys/dev
$ openssl genrsa -out private.pem 2048
$ openssl rsa -in private.pem -outform PEM -pubout -out public.pem

You should see two files get created inside the keys/dev directory.

3. Set Environment Variables

Once all the mix dependencies are installed we need to config the environment variables. Please copy paste .env.example and rename it to .env add in all the relevant environment variables. Then run source .env to set all the variables.

4. Setup Database

Setup the database needed by freshcom with mix freshcom.setup which will do the following for you:

  • Create the projection (read side) database and run all the relevant migrations
  • Create and initialize the eventstore (write side) database

5. Create a freshcom app for freshcom_dashboard (optional)

If you plan to use freshcom_dashboard you will need to create a freshcom app so that freshcom_dashboard can use the app ID to identify itself with the JSON API in order to gain access all the API it needs. Simply run the following to get the app created and its app ID will be displayed.

$ mix freshcom.init_dashboard

To see where to use this app ID please view the guide for freshcom_dashboard.

Run

freshcom_web is built using phoenix so starting the server is simply mix phx.server.

Once the server is running you can try hit any of the endpoint provided to test if its working. API documentation can be found here

Learn more

Contact

Any question or feedback feel free to find me in the Elixir Slack Channel @rbao, will usually respond within few hours in PST timezone day time.

freshcom_web's People

Contributors

rbao 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.