{"id":24225763,"url":"https://github.com/instea/cestovne-prikazy","last_synced_at":"2026-05-12T19:31:38.388Z","repository":{"id":78149637,"uuid":"96873238","full_name":"instea/Cestovne-prikazy","owner":"instea","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-05T12:05:18.000Z","size":1080,"stargazers_count":0,"open_issues_count":23,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-14T08:15:53.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-11T09:01:35.000Z","updated_at":"2024-06-05T12:05:23.000Z","dependencies_parsed_at":"2024-06-05T13:45:04.267Z","dependency_job_id":null,"html_url":"https://github.com/instea/Cestovne-prikazy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instea%2FCestovne-prikazy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instea%2FCestovne-prikazy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instea%2FCestovne-prikazy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instea%2FCestovne-prikazy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instea","download_url":"https://codeload.github.com/instea/Cestovne-prikazy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780498,"owners_count":20019061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-14T08:15:57.213Z","updated_at":"2026-05-12T19:31:33.365Z","avatar_url":"https://github.com/instea.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trips management\n\nApplication for management of trips.\n\n## Getting Started\nApplication use Google login as only mean of registration/login ([google-sign-in](https://developers.google.com/identity/sign-in/web/sign-in)).\nAll users must register and be approved by admin before being able to login.\nFor this reason admin user must be seeded into application database.\nSee **setup DB** chapter to find all necessary information.\n\nAll users can be restricted to hosted domain, see **Environmental variables**. \n\n### Prerequisites\n\n* node 8\n* yarn\n* docker, docker-compose (for database)\n\n### Installing\n\nClone the repository\n```\ngit clone https://github.com/instea/Cestovne-prikazy.git ; cd Cestovne-prikazy\n```\n\nStart by installing the dependencies:\n\n```\nyarn install\n```\n\nThe application needs a running Mongo instance for it to work. It can be pointed to any such instance.\nIt can be set by setting the environment variable _MONGO\\_URL_ to an url in this format:\n\n```\nmongodb://user:pass@localhost:port/database\n```\n\nIf no mongo instance is readily available, the repository contains a docker compose file to quickly start a new instance:\n\n```\npushd db\ndocker-compose up -d\npopd\n```\n\nNo authentication will be used by default. If it is required, read instructions at [mongo docker page](https://hub.docker.com/_/mongo/).\n\nThe application also requires some secret files that are not present in the repository:\n* secrets/key.pem - private and public key\n\nThose can be generated by running:\n\n```\nopenssl genrsa -out ./secrets/key.pem 2048\n```\n\nand then extracting the Base64 content into private.key and public.pem files.\n\n## Setup DB\n\nDatabase is not initialized with default admin user due to Google login as only\nmean of user registration and login (you would need to supply google_id and email).\nInstead of it, create user via Google login and then use following command to grant\nuser with given email admin rights (can approve other users via GUI) \nand approved status (can login into app).\n```\nyarn promote-user --email=\u003cgoogle_email\u003e\n```\n\n## Running\nIf using the dockerized mongo instance with no authentication, the server can be run by this command:\n\n```\nyarn server\n```\n\nOtherwise, mongo url needs to be set:\n\n```\nMONGO_URL=mongodb://user:pass@localhost:port/database yarn server\n```\n#### Environmental variables\nWhen server is running, various environmental variables are used.\n \nServer environmental variables to generate and send emails. When some of SMTP options are not set, emails are not sent. \n```\nSMTP_HOST\nSMTP_PORT\nSMTP_USER\nSMTP_PASSWORD\nBASE_URL - root url of frontend webpage\nAPPROVAL_MAIL_RECEIVER - email address to send emails about new leaves to\nMAIL_SENDER - name of email sender\nDEFAULT_TIMEZONE - default timezone used to format datetime in emails, \n                   if not set, 'Europe/Bratislava' is used\n```\n\nServer environmental variables for Google login. When HOSTED_DOMAIN is set, all users \nmust belong to given hosted domain, otherwise they won't be able to register/login.\n```\nHOSTED_DOMAIN=instea.co\nCLIENT_ID=914978031481-bk8e8bj1ur0vhq4qlh7n7875drin9r0e.apps.googleusercontent.com\n```\n\n#### Attendence API\nEndpoint to get attendence of users for given year and month (supply month as integer from 1 (January) to 12 (December))\n**/api/attendence/:year/:month**\n\nThis endpoint uses following environment variables: \n```\nM2M_USERNAME - username for HTTP Basic authentication\nM2M_PASSWORD - password for HTTP Basic authentication\nSSO_URI      - URI of SSO Metadata endpoint to get all keys for users\nSSO_USERNAME - SSO username used for HTTP Basic authentication\nSSO_PASSWORD - SSO password used for HTTP Basic authentication\n```\n\n\nYou need to run the client and server application. Client side is run by issuing yarn start command:\n\n```\nyarn start\n```\nClient environmental variables for Google login (e.g. in `.env.local`). When REACT_APP_HOSTED_DOMAIN is set, only emails\nof given domain are shown in Google login form.\n```\nREACT_APP_HOSTED_DOMAIN=instea.co\nREACT_APP_CLIENT_ID=914978031481-bk8e8bj1ur0vhq4qlh7n7875drin9r0e.apps.googleusercontent.com\n```\n\n## Running the tests\n\n```\nyarn test\n```\n\n### Coding style tests\n\nThe project uses ESLint for docing style tests. You can run them by:\n\n```\nyarn lint\n```\n\nAutomatic fixing can be done by running:\n\n```\nyarn format\n```\n\n## Deployment\n\nBuild docker\n\n```\n# assumes build env variables are set\ndocker build --build-arg REACT_APP_HOSTED_DOMAIN --build-arg REACT_APP_CLIENT_ID -t cestaky:master .\n\n# just example: needs -e params to work properly\ndocker run --rm --name cestaky -v \"/$(pwd)/secrets:/opt/app/secrets\" -p 4100:4100 cestaky:master\n```\n\n## See also\n\n[Subproject for leaves management](angular/README.md)\n\n## Built With\n\n* [create-react-app](https://github.com/facebookincubator/create-react-app)\n  * React - Web application framework\n  * Webpack - build system\n* [MongoDB](https://www.mongodb.com/) - NoSQL database\n* [Mongoose](http://mongoosejs.com/) - ORM library for MongoDB in javascript\n* [express](https://expressjs.com/) - Back-end web framework\n* [express-graphql](https://github.com/graphql/express-graphql) - GraphQL server\n* [apollo-client](https://github.com/apollographql/apollo-client) - GraphQL client\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstea%2Fcestovne-prikazy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstea%2Fcestovne-prikazy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstea%2Fcestovne-prikazy/lists"}