This application simulates a simplified portfolio of invoices and their generation of account receivables.
It's the server part of the ctr-invoice-mean project, split so can be connected to other clients and expand to other databases.
As its origin, it can be used as a demo and template of a series of finance applications developped for Immaginare Service clients since 2010.
The REST full server application controls:
- Login (suggesting a demo company)
- 'api/login' (POST)
- Users
- 'api/users (POST)
- Invoices
- 'api/recins' (POST)
- Config
- 'api/config' (POST)
Backend
- Node
- Express
- Mongoose
- MongoDb
- Firebase
- cors
-
If Mongodb not installed, install it
-
Download files to the working folder
-
Install the application and run Node
$ npm install
$ node index
- Open browser and create default database
localhost:4000/api/install
This url will reset the original database at any time
- Still in the browser, run the application
localhost:4000
Properties and defaults stored in the file config.json:
- serverPort: 4000
- dbOption: can be mongo, (default), 'postgreesl' or 'firebase'
- mongooseConnectionString: 'mongodb://localhost/example'
- token: '123321'
- loginStd: can be '0' (no token, default), '1' (token in param) or '2' (token in cookies)
- MongoDb: Local example
- Firebase: In the account
- PostgreeSQL
- Json: for resetting with test data
Running in the local NodeJS server
Some Troubleshooting
- Mongo doesn't run
- $ pgrep
- $ kill processId // where processId is the return in the first command
Running read only accorging /db/firebase/firebase.json
Account with the the below security setup at Firebase/RealtimeDatabase/Rules:
{
"rules": {
".read": "true",
".write": "auth != null"
}
}
Running for tests as ctr001 in www.immaginareservice.com.br test hosting
Access to be coded in the future
Available at /db/json/*.json with test data to reset other databases
- Run using Test script
$ npm run test
- Open about:inspect in Chrome
- Click the "Open dedicated DevTools for Node" link.
The default db will be Mongo, unless dbOption in the config.json is set to 'firebase'.
- Any suggestion or info request to: plinio.prado@immaginare.com.br