98 lines
3.0 KiB
Markdown
98 lines
3.0 KiB
Markdown
# MifosX
|
|
|
|
Revamped codebase of community-app
|
|
|
|
# Getting started
|
|
|
|
1. Go to project folder and install dependencies:
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
2. Launch development server, and open `localhost:4200` in your browser:
|
|
```bash
|
|
npm start
|
|
```
|
|
|
|
# Main tasks
|
|
|
|
Task automation is based on [NPM scripts](https://docs.npmjs.com/misc/scripts).
|
|
|
|
Tasks | Description
|
|
------------------------------|---------------------------------------------------------------------------------------
|
|
npm start | Run development server on `http://localhost:4200/`
|
|
npm run build [-- --env=prod] | Lint code and build app for production in `dist/` folder
|
|
npm test | Run unit tests via [Karma](https://karma-runner.github.io) in watch mode
|
|
npm run test:ci | Lint code and run unit tests once for continuous integration
|
|
npm run e2e | Run e2e tests using [Protractor](http://www.protractortest.org)
|
|
npm run lint | Lint code
|
|
npm run translations:extract | Extract strings from code and templates to `src/app/translations/template.json`
|
|
npm run docs | Display project documentation
|
|
|
|
When building the application, you can specify the target environment using the additional flag `--env <name>` (do not
|
|
forget to prepend `--` to pass arguments to npm scripts).
|
|
|
|
The default build environment is `prod`.
|
|
|
|
## Development server
|
|
|
|
Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change
|
|
any of the source files.
|
|
You should not use `ng serve` directly, as it does not use the backend proxy configuration by default.
|
|
|
|
## Code scaffolding
|
|
|
|
Run `npm run generate -- component <name>` to generate a new component. You can also use
|
|
`npm run generate -- directive|pipe|service|class|module`.
|
|
|
|
If you have installed [angular-cli](https://github.com/angular/angular-cli) globally with `npm install -g @angular/cli`,
|
|
you can also use the command `ng generate` directly.
|
|
|
|
## Additional tools
|
|
|
|
Tasks are mostly based on the `angular-cli` tool. Use `ng help` to get more help or go check out the
|
|
[Angular-CLI README](https://github.com/angular/angular-cli).
|
|
|
|
# What's in the box
|
|
|
|
The app template is based on [HTML5](http://whatwg.org/html), [TypeScript](http://www.typescriptlang.org) and
|
|
[Sass](http://sass-lang.com).
|
|
|
|
#### Design guides
|
|
|
|
- [Bootstrap Material](https://bootswatch.com/materia/)
|
|
- [Angular Material](https://material.angular.io/components/categories)
|
|
|
|
|
|
#### Steps to add component
|
|
|
|
1. Create a module using
|
|
`ng generate module [name]`
|
|
2. Go to *app.module.ts*
|
|
- import the module
|
|
|
|
|
|
import { module_name } from './module'
|
|
|
|
- declare the module in
|
|
|
|
|
|
```
|
|
@NgModule({
|
|
imports: [ module_name ]})
|
|
```
|
|
|
|
3. Setup routing in newly created module
|
|
|
|
|
|
#### Coding guides
|
|
|
|
- [Angular](docs/coding-guides/angular.md)
|
|
- [TypeScript](docs/coding-guides/typescript.md)
|
|
- [Sass](docs/coding-guides/sass.md)
|
|
- [HTML](docs/coding-guides/html.md)
|
|
- [Unit tests](docs/coding-guides/unit-tests.md)
|
|
- [End-to-end tests](docs/coding-guides/e2e-tests.md)
|
|
|
|
|