ksquareincmx / poc-chef-server

Wanna order tortas? We gotcha covered fam!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poc Chef Server

Server application to order tortas

Table of contents

  1. Instalation
  2. Develop
  3. Deploy
  4. Docs
  5. Tests
  6. License

Installation

Useful scripts

Run project in development mode:

npm run start-dev

Generate JS code, for production mode:

npm run build

Remove production code:

npm run clean

Run project in production mode:

npm run production

Generate documentation:

npm run apidoc

Develop

Built With

This app uses the following technologies:

It's recommended to have basic knowledge of those technologies before working with this project.

Prerequesites

It's neccesary install global dependencies:

npm install -g nyc mocha source-map-support apidoc

Setting up dev

Download and install dependencies:

git clone https://github.com/ksquareincmx/poc-chef-server.git
cd poc-chef-server
npm install

Set enviroment variables:

cp env.example .env

It's necessary to generate google oauth credentials and jwt secret, and set enviroment variables.

Generate jwt secret:

printf "%s\n" $(openssl rand -base64 32 | tr -dc 0-9A-Za-z | head -c 40)

Generate google oauth2 credentials

Build

Execute project in localhost:

npm run start-dev

You must see the next output:

> chef-api@1.0.0 start-dev /home/user/poc-chef-server
> DEBUG=chef:* NODE_ENV=development nodemon

[nodemon] 1.18.9
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /home/mike/GitHub/Ksquare/poc-chef-server/api/**/*
[nodemon] starting `ts-node ./api/server.ts`
  chef:orders:api:configuration Configuration API-Chef-Orders: getting configurations... +0ms
  chef:orders:app app loading... +0ms
  chef:orders:server Server Running on port: 3000 +0ms

Deploy

Execute docker compose:

docker-compose build
docker-compose up

TODO: add server configuration

Tests

Run project first: npm run start-dev or npm run production Run test: npm run test

Docs

You can see the API documentation in dev mode following the next steps:

npm run apidoc
npm run start-dev

See documentation: localhost:3000/apidoc, if you are running your project in production mode you can access change localhost:port by your URL

License

MIT

About

Wanna order tortas? We gotcha covered fam!

License:MIT License


Languages

Language:TypeScript 96.0%Language:JavaScript 4.0%Language:Dockerfile 0.1%