Skip to content

Do you know sth like this? - NO! Coffee has run out! Do sth with it! Therefore, we decided to design and develop a very simple tool that will help us to act as soon as possible… before the level of caffeine in our blood will drop significantly :). Why EOC - End of coffee? Well, it was another solution, but we handle it in more humanity way :).

License

sandstreamdev/eoc

Repository files navigation

EOC - End Of Coffee App

Greenkeeper badge last commit All Contributors

An app made by Sandstream Development team, to track office inventory, groceries, and even your daily tasks!

Main application tech stack

App uses WebSockets technology via Socket.io library to provide a better user experience.

Client:

  • React.js,
  • Redux

Server:

  • Node,
  • Express.js

Database:

  • MongoDB

Installation

Please remember first to create .env file in the root directory of the project and add necessary .env keys that you can find in the .env-example file.

1. Clone the repository

git clone https://github.com/sandstreamdev/eoc.git

2. Go inside the directory

cd eoc

3. Install dependencies

npm install

4. Run database

monogod

5. Start the development server

npm run dev

Build for production

npm run build

Seeding database for development

At first run of the app, log in and check your user id in the database under eoc/users directory. Put that user ID, generated by mongo to .env file under USER_ID variable and save the file. Then simply run npm run seed.

Seeding is not working?

Probably USER_ID in your database is not matching with USER_ID in your .env file. Be aware that if you clean up the whole database with users collection, your USER_ID delivered by mongo will be different compared to the previous session.

Tip:

When playing with data via MongoDB Compass, always clean all the collections omitting users collection, so you don't have to deal with USER_ID configuration over and over again.

Available scripts

 "check": - runs lint, format and stylelint scripts together,
 "clear-demo": - clears demo data from the database,
 "build:dev": - builds for development,
 "build:prod": - builds for production,
 "dev": - runs development server,
 "format": - formats all the files using Prettier,
 "format:fix": - formats and fix all the files using Prettier,
 "libs": "scripts/libs.sh -j server/data/libraries.json -m LIBRARIES.md",
 "lint": - lint all the files using eslint,
 "lint:fix": - lint and fix all files using eslint,
 "migrate": - runs migration script,
 "migrate:up":  - migrate database up,
 "migrate:down":  - migrate database down,
 "seed": - seed database with demo data,
 "start:client:dev": - start client dev server,
 "start:server:dev": - start dev server,
 "start:server:prod": - start production server,
 "stylelint": - stylelint all style files,
 "stylelint:fix": - stylelint and fix all style files,
 "test": - run tests

Database migrations

To perform DB migrations we use migrate-mongo tool. To config migrate-mongo edit migrate-mongo-config.js file. To create migration file run npm run migrate create <version> in your terminal. Migration file will be created at server/migrations directory. To run all new migrations run npm run migrate:up or npm run migrate up in your terminal. To rollback, last migration run npm run migrate:down or npm run migrate down in your terminal. To see migrations status run npm run migrate status in your terminal.

Third-party licenses

To generate json and markdown files containing third-party licenses you need to install globally: license-checker and npm-license-crawler:

1. Install packages globally

npm i license-checker npm-license-crawler -g

2. Go inside the directory

cd eoc

3. Run libs script

This script create two files: JSON file and markdown file.

The first one contains data about packages used in the project. It is used by controllers: getLibraries and getLicense to extract this data and send it to the client to display information about the used package.

The second file contains a list of packages used in the project with links to their repositories and license file. It is available on the project repository page.

npm run libs -j path/to/json/file [-m path/to/md/file]

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License and trademarks info

Contributors ✨

Thanks goes to these wonderful people (emoji key):

sandstreamdevelopment
sandstreamdevelopment

💼 💵 🤔
Adam Klepacz
Adam Klepacz

💻 📖 🎨 🤔 👀
Aleksander Fret
Aleksander Fret

💻 📖 🎨 🤔 👀
Marek Rozmus
Marek Rozmus

👀 💻 📖 🎨 🤔 🚇 📆
Przemysław Zalewski
Przemysław Zalewski

👀 🤔
mariusz-machnicki
mariusz-machnicki

🐛 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Do you know sth like this? - NO! Coffee has run out! Do sth with it! Therefore, we decided to design and develop a very simple tool that will help us to act as soon as possible… before the level of caffeine in our blood will drop significantly :). Why EOC - End of coffee? Well, it was another solution, but we handle it in more humanity way :).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published