Skip to content

Demo webapp built with Jester, Norm, and Norman.

License

Notifications You must be signed in to change notification settings

moigagoo/shopapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

69571aa · Oct 25, 2023
Sep 1, 2020
Nov 26, 2020
Oct 15, 2023
Aug 4, 2020
Nov 20, 2020
Nov 26, 2020
Jul 25, 2020
Oct 15, 2023
Nov 24, 2020
Aug 4, 2020

Repository files navigation

Shop App with Karax, Jester, Norm, and Norman

This is a proof-of-concept for a webapp created with Karax for frontend, Jester for API server, Norm for ORM, and Norman for migration management.

Usage

  1. Clone the repo and cd into the repo dir:
$ git clone git@github.com:moigagoo/shop-api.git
$ cd shop-api
  1. Create .env from .env_example:
$ cp .env_example .env
  1. Build the image:
$ docker-compose build
  1. Start web service and enter the container:
$ docker-compose run --rm --service-ports web bash
  1. Apply the migrations:
$ norman migrate
  1. Run the app:
$ nimble run --deepcopy:on
  1. Open your browser at localhost:5000 and play around.
  2. Send requests to it in a separate terminal:
$ curl -s http://localhost:5000/api/customers/1 | jq
{
  "auth": {
    "email": "user1@example.com",
    "googleToken": "",
    "id": 1
  },
  "name": "Alice 1",
  "age": 21,
  "id": 1
}

$ curl -s 'http://localhost:5000/api/customers/?page=3&per_page=2' | jq
[
  {
    "auth": {
      "email": "user5@example.com",
      "googleToken": "",
      "id": 5
    },
    "name": "Alice 5",
    "age": 25,
    "id": 5
  },
  {
    "auth": {
      "email": "user6@example.com",
      "googleToken": "",
      "id": 6
    },
    "name": "Alice 6",
    "age": 26,
    "id": 6
  }
]

$ curl -X DELETE -s http://localhost:5000/api/customers/2
$ curl -X POST --data 'email=foo@bar.com&token=AbC123' http://localhost:5000/api/customers/
11

About

Demo webapp built with Jester, Norm, and Norman.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages