https://github.com/ugobriasco/gastronomycon-server
🍽️ A NodeJS application for supporting multilingual groceries accessible via REST API.
https://github.com/ugobriasco/gastronomycon-server
foodtech grocery-products mongo multilingual-grocery-lists nodejs rest-api
Last synced: 2 months ago
JSON representation
🍽️ A NodeJS application for supporting multilingual groceries accessible via REST API.
- Host: GitHub
- URL: https://github.com/ugobriasco/gastronomycon-server
- Owner: ugobriasco
- License: mit
- Created: 2016-12-13T14:53:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T12:12:17.000Z (over 3 years ago)
- Last Synced: 2025-01-24T23:27:56.690Z (over 1 year ago)
- Topics: foodtech, grocery-products, mongo, multilingual-grocery-lists, nodejs, rest-api
- Language: JavaScript
- Homepage: https://gastronomycon.io
- Size: 8.96 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Gastronomycon
[](https://www.codacy.com/app/ugobriasco/grocerybot-server?utm_source=github.com&utm_medium=referral&utm_content=ugobriasco/gastronomycon-server&utm_campaign=Badge_Grade)
[](https://travis-ci.org/ugobriasco/ggastronomycon-server)
[](https://github.com/prettier/prettier)
## Intro
This is the server-side application of Gastronomycon - a microservice for multilingual groceries. It provides and handles groceries, accessable via REST API. The default client application can be found [here](https://github.com/ugobriasco/grocerybot-cli).
Visit the [official page](http://46.101.201.71:3000), collaborate to the project on [GitHub](https://github.com/ugobriasco/gastronomycon-server), or contact the author [Ugo Briasco](http://ugobriasco.me) on [Slack](https://matchyourtie.slack.com/messages/general/whats_new/).
## Framework
- [mongo](https://docs.mongodb.com/getting-started/shell/)
- [node](https://nodejs.org/en/)
- [express](http://expressjs.com/)
## Usage
Please refer to the [API documentation](https://github.com/ugobriasco/gastronomycon-server/wiki/API-v1.0-reference) for released versions, or check [here](https://github.com/ugobriasco/grocerybot-server/blob/master/server/api/v1.0/api-doc.json).
## Development
### Prerequisites
- node 8+
- npm 6+
- Nodemon 1.4+
- mongoDB 4+
- dependency-cruiser 4+ (for updating dependency graph)
### Setup
- Install dependencies
```bash
git clone git@github.com:ugobriasco/gastronomycon-server.git && cd gastronomycon-server
npm i
cp ./cfg.js.template ./cfg.js
mongod
npm start
```
- Create the root user, by sending a `POST` request to `http://localhost:3000/api/v1.0/signup` with the following body:
`{"email":"ROOT_EMAIL","passowrd":"ROOT_PASSWORD","role": "Admin"}`
- Set `allow_set_role_on_signup: false` in `./cfg.js`. This prevents guest user to sign up as Admin.
- Optional - SignupCode
In order to control the signup, it is possible to provide a signup code option, which -if enabled- requires a code during the the registration of a new user. This option can be created by an admin user as following:
`POST http://localhost/api/settings`
`{"name": "signupCode", "value": "foo"}`
### Test
Run `npm test` to execute the unit and integration tests. It requires the following ftramework:
- [Mocha](https://mochajs.org/).
- [Chai](http://chaijs.com).
- [Sinon](http://sinonjs.org).
In order to check the current test coverage, run `npm coverage`, which requires [Istanbul](https://istanbul.js.org/).
Before running the tests make sure you are serving the app via `npm start`.
### Architecture
Dependency graph [here](./dependencygraph.svg). For updating it, run:
```
sh ./script/plot-dependency-graph.sh
```
## Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
## License
[MIT](https://github.com/ugobriasco/grocerybot-server/blob/master/LICENSE.md)