This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
FoodLoop-Web/README.md

148 lines
4.6 KiB
Markdown
Raw Normal View History

2021-03-20 09:41:38 +00:00
# LocalSpend (Web App.)
2021-03-20 09:41:38 +00:00
Looking to discover if the value of spending local can be measured, understood and shown.
This repository contains the Web application for the LocalSpend system. See also:
* the [server](https://github.com/Pear-Trading/Foodloop-Server); and
* the [mobile application](https://github.com/Pear-Trading/LocalSpend-Tracker).
2020-10-17 13:39:57 +00:00
## Current Status
2021-03-20 09:41:38 +00:00
| Branch | Status |
|---------------|------------------ |
| `master` | [![Build Status](https://travis-ci.org/Pear-Trading/FoodLoop-Web.svg?branch=master)](https://travis-ci.org/Pear-Trading/FoodLoop-Web) |
2020-10-18 13:46:21 +00:00
| `development` | [![Build Status](https://travis-ci.org/Pear-Trading/FoodLoop-Web.svg?branch=development)](https://travis-ci.org/Pear-Trading/FoodLoop-Web) |
2017-09-14 10:06:14 +00:00
2021-03-20 09:41:38 +00:00
## Table of Contents
* [Tech Stack](#tech-stack)
* [Features](#features)
* [Installation](#installation)
* [Configuration](#configuration)
* [Usage](#usage)
* [Testing](#testing)
* [Code Formatting](#code-formatting)
* [Documentation](#documentation)
* [Acknowledgments](#acknowledgements)
* [License](#license)
* [Contact](#contact)
## Technology Stack
2020-10-18 13:45:03 +00:00
2021-03-20 09:41:38 +00:00
The Web app. is written in [TypeScript](https://www.typescriptlang.org/).
2020-10-18 13:45:03 +00:00
2021-03-20 09:41:38 +00:00
The stylesheets are written in [SCSS](https://sass-lang.com).
2021-03-20 09:41:38 +00:00
| Technology | Description | Link |
|------------|----------------------------|-----------------|
| Node.js | JavaScript server runtime | [Link][node] |
| AngularJS | JavaScript MVW framework | [Link][angular] |
2020-10-17 13:39:57 +00:00
For your local Node.js, we recommend using:
2021-03-20 09:41:38 +00:00
- [n][https://github.com/tj/n] for \*nix and Mac; and
- [nodist][https://github.com/marcelklehr/nodist] for Windows.
2020-11-28 19:30:41 +00:00
We recommend Node.js version 8.0.0+ and npm version 5.3.0+.
2021-03-20 09:41:38 +00:00
[node]: https://nodejs.org/
[angular]: https://angularjs.org/
## Features
This client app. provides:
- user authorisation (but not registration);
- transaction logging;
- presentation of transaction history analysis; and
- presentation of leaderboard.
## Installation
1. Clone the repo. to your dev. environment (`git clone git@github.com:Pear-Trading/FoodLoop-Web.git`);
1. enter the new directory (`cd FoodLoop-Web`); and
2021-03-21 14:44:12 +00:00
1. install the dependencies (`npm install`).
2021-03-20 09:41:38 +00:00
## Configuration
The app. defaults to using the production environment.
App. configuration settings are found in `package.json`.
2021-03-20 09:41:38 +00:00
TypeScript configuration settings are found in `tsconfig.json`.
2021-03-20 09:41:38 +00:00
Angular configuration settings are found in `angular.json`.
2021-03-20 09:41:38 +00:00
Environment variables are found in `src/environments/environment.⟨environment⟩.ts`.
2017-08-15 10:34:05 +00:00
2021-03-20 09:41:38 +00:00
## Usage
2017-08-15 10:34:05 +00:00
2021-03-20 09:41:38 +00:00
### Development
2020-10-18 13:48:43 +00:00
2021-03-20 09:41:38 +00:00
- Run `npm run start:dev` to start in development mode using Angular.
- Run `npm run build:dev` to build in development mode using Angular.
### Production
- Run `npm run start:prod` to start in production mode using Angular.
- Run `npm run build:prod` to build in production mode using Angular.
2020-10-18 13:48:43 +00:00
## Testing
2020-10-17 13:39:57 +00:00
There are two types of test in this codebase:
2021-03-20 09:41:38 +00:00
- unit tests; and
- end-to-end (E2E) tests.
### Unit Tests
Run `npm run test` to run the full test suite using [Karma](https://karma-runner.github.io/latest/index.html).
Unit tests re-run automatically on source changes.
Tests are found in `*.spec.ts` files alongside normal source files.
Karma configuration settings are found in `karma.conf.js`.
### End-to-End (E2E) Tests
Run `npm run e2e` to run the full E2E test suite using (Selenium WebDriver](https://www.selenium.dev/documentation/en/webdriver/).
You may need to run `webdriver-manager update` to install the correct WebDriver and dependencies first.
E2E tests run only once and will need to be re-run manually after source changes.
2021-03-20 09:41:38 +00:00
## Code formatting
2021-03-20 09:41:38 +00:00
### JavaScript/TypeScript Code
2021-03-21 14:44:12 +00:00
- Run `npm run lint` to format all JS/TS files with [Codelyzer](http://codelyzer.com/); and
- run `npm run lint-js:fix` to attempt to automatically fix errors and warnings.
2021-03-20 09:41:38 +00:00
Codelyzer configuration settings are found in `tslint.json`.
2020-10-17 13:39:57 +00:00
2021-03-20 09:41:38 +00:00
## Documentation
2021-03-20 09:41:38 +00:00
TODO
2021-03-20 09:41:38 +00:00
## Acknowledgements
2021-03-20 09:41:38 +00:00
LocalLoop is the result of collaboration between the [Small Green Consultancy](http://www.smallgreenconsultancy.co.uk/), [Shadowcat Systems](https://shadow.cat/), [Independent Lancaster](http://www.independent-lancaster.co.uk/) and the [Ethical Small Traders Association](http://www.lancasteresta.org/).
2020-10-17 13:39:57 +00:00
2021-03-20 09:41:38 +00:00
The Web client interface is based off of [CoreUI](https://coreui.io/).
2020-10-17 13:39:57 +00:00
2021-03-20 09:41:38 +00:00
## License
2021-03-20 09:41:38 +00:00
This project is released under the [MIT license](https://mit-license.org/).
2021-03-20 09:41:38 +00:00
## Contact
2021-03-20 09:41:38 +00:00
| Name | Link(s) |
|----------------|-------------------|
| Mark Keating | [Email][mkeating] |
| Michael Hallam | [Email][mhallam] |
2021-03-20 09:41:38 +00:00
[mkeating]: mailto:m.keating@shadowcat.co.uk
[mhallam]: mailto:info@lancasteresta.org