Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kiaragrouwstra/js-invoices


https://github.com/kiaragrouwstra/js-invoices

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Deliverables

* At the bottom of the page you should show a dynamically calculated invoice total. This total should take into account the quantity and price of each product and the invoice discount
* From the invoice form, make it possible to add a new Customer that is not already in the system. It should be possible to add a name, .
* From the invoice form, make it possible to add a new Product. It should be possible to add a name and price.

# Dependencies

- sqlite3
- node
- npm

# Getting Started

###### Install npm dependencies
`npm install`

###### Run the node server
`node app.js`

###### Viewing the application in your browser
`http://localhost:8000`

###### Watch changes
`webpack --watch`

# Schema

## Customers

- id (integer)
- name (string)
- address (string)
- phone (string)

## Products

- id (integer)
- name (string)
- price (decimal)

## Invoices

- id (integer)
- customer_id (integer)
- discount (decimal)
- total (decimal)

## InvoiceItems

- id (integer)
- invoice_id (integer)
- product_id (integer)
- quantity (decimal)

# Resources

## Customers
```
GET|POST /api/customers
GET|PUT|DELETE /api/customers/{id}
```

## Products
```
GET|POST /api/products
GET|PUT|DELETE /api/products/{id}
```
## Invoices
```
GET|POST /api/invoices
GET|PUT|DELETE /api/invoices/{id}
```

## InvoiceItems
```
GET|POST /api/invoices/{id}/items
GET|PUT|DELETE /api/invoices/{invoice_id}/items/{id}
```