{"id":20790904,"url":"https://github.com/yarosj/simple-mern-app","last_synced_at":"2026-04-13T14:32:27.180Z","repository":{"id":177498871,"uuid":"119682848","full_name":"YarosJ/simple-MERN-app","owner":"YarosJ","description":"Simple Express + React application","archived":false,"fork":false,"pushed_at":"2018-07-16T07:03:35.000Z","size":9919,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-26T03:54:59.528Z","etag":null,"topics":["apidoc","express","graphql","nodejs","react","react-redux","react-router-v4","rest-api","webpack"],"latest_commit_sha":null,"homepage":"http://solv-express.herokuapp.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YarosJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-01-31T12:13:16.000Z","updated_at":"2022-01-22T12:27:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c41f6c9-e066-4e66-bd4a-54ea7145c8fa","html_url":"https://github.com/YarosJ/simple-MERN-app","commit_stats":null,"previous_names":["yarosj/simple-mern-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YarosJ/simple-MERN-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YarosJ%2Fsimple-MERN-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YarosJ%2Fsimple-MERN-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YarosJ%2Fsimple-MERN-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YarosJ%2Fsimple-MERN-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YarosJ","download_url":"https://codeload.github.com/YarosJ/simple-MERN-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YarosJ%2Fsimple-MERN-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31757477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["apidoc","express","graphql","nodejs","react","react-redux","react-router-v4","rest-api","webpack"],"created_at":"2024-11-17T15:38:42.361Z","updated_at":"2026-04-13T14:32:27.152Z","avatar_url":"https://github.com/YarosJ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express.js RESTful/GraphQL React.js SPA.\n\nThis is a simple single page application with registration and admin panel that manages access to resources. The resources in this application are recommendations (displayed in the carousel), users and pages of site.\n\n## Navigation:\n\n* [Dependencies](#dependencies)\n* [Installation](#installation)\n* [Test REST api](#test-rest-api-the-example-uses-a-postman)\n* [Test GraphQL api](#test-graphql-api)\n\n[Dependencies:](#dependencies)\n------------\n\nThe application requires `npm` version `6.1.0` or higher,  `node.js` version `10.4.1` or higher, Webpack version `4.5.0`, and MongoDB version `3.6.3`.\n\n[Installation:](#installation)\n----------------\n\nThe first step is to install dependencies:\n\n```sh\n$ npm i\n```\n\nThen perform build and launch the application:\n\n```sh\n$ DEBUG_COLORS=true DEBUG=app,controllers,auth,acl seedDB=true NODE_ENV=production npm start\n```\n\n`NODE_ENV`, `DEBUG_COLORS`, `DEBUG` and `seedDB` is optional parameters\n\nIf the application is started for the first time you need set `seedDB=true`\n\nNow you can go to the address: `localhost:3000`\n\nWork application instance: `http://solv-express.herokuapp.com/`\n\nAdmin email: `example@ex.com`\n\nAdmin password: `1111111`\n\n[Test REST api (the example uses a Postman):](#restApi)\n------------\n\n__Full api documentation here: https://yarosj.github.io/solvRestApiDoc__\n\nApi of this application supports the JWT (stateless) and session for authorisation.\n\nSessions will not be considered because they are not stateless.\n\nFor have access to protected resource you need to get JWT:\n\n`http://solv-express.herokuapp.com/login`\n\n```sh\nPOST /login HTTP/1.1\nHost: \u003cHost\u003e\nContent-Type: application/json\ntype: json\nAuthorization: login\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n\n{\n    \"email\": \"admin@ex.com\",\n    \"password\": \"1111111\"\n}\n```\n\nThe received refresh token should be stored for example in local storage and access token use to access resources. When access token expires, you need to get a new refresh token:\n\n`http://solv-express.herokuapp.com/refresh`\n\n```sh\nPOST /refresh HTTP/1.1\nHost: \u003cHost\u003e\nContent-Type: application/json\ntype: json\nAuthorization: \u003cRefresh token\u003e\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n```\n\n__Test the api for the resource testimonials:__\n\n- Get all testimonials: `http://solv-express.herokuapp.com/testimonials`\n\n- Create testimonial: `http://solv-express.herokuapp.com/testimonials/`\n\n```sh\nPOST /testimonials/ HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nContent-Type: application/json\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n\n{\n    \"title\": \"Test title\",\n    \"body\": \"Test body\",\n    \"autor\": \"Test autor\",\n    \"gender\": \"male\"\n}\n```\n\n- Update testimonial: `http://solv-express.herokuapp.com/testimonials/:id`\n\n```sh\nPUT /testimonials/:id HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nContent-Type: application/json\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n\n{\n    \"title\": \"Updated test title\",\n    \"gender\": \"female\"\n}\n```\n\n- Delete testimonial: `http://solv-express.herokuapp.com/testimonials/:id`\n\n```sh\nDELETE /testimonials/:id HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\n```\n\n__Test the api for the resource users:__\n\n- Get all users: `http://solv-express.herokuapp.com/users`\n\n```sh\nGET /users HTTP/1.1\nHost: \u003cHost\u003e\nContent-Type: application/json\ntype: json\nAuthorization: \u003cAccess token\u003e\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n```\n\n- Create user: `http://solv-express.herokuapp.com/users`\n\n```sh\nPOST /users HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nContent-Type: application/json\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n\n{\n    \"email\": \"test@ex.com\",\n    \"password\": \"1111111\"\n}\n```\n\n- Update user: `http://solv-express.herokuapp.com/users/:id`\n\n```sh\nPUT /users/:id HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nContent-Type: application/json\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n\n{\n    \"email\": \"test@ex.com\",\n    \"role\": \"admin\"\n}\n```\n\n- Delete user: `http://solv-express.herokuapp.com/users/:id`\n\n```sh\nDELETE /users/:id HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nContent-Type: application/json\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n```\n\n__Test the api for the resource roles:__\n\n\n- Get all roles: `http://solv-express.herokuapp.com/roles`\n\n```sh\nGET /roles HTTP/1.1\nHost: \u003cHost\u003e\nContent-Type: application/json\ntype: json\nAuthorization: \u003cAccess token\u003e\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n```\n\n- Get role permissions: `http://solv-express.herokuapp.com/roles/:role/permissions`\n\n```sh\nGET /roles/:role/permissions HTTP/1.1\nHost: \u003cHost\u003e\nContent-Type: application/json\ntype: json\nAuthorization: \u003cAccess token\u003e\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n```\n\n- Create role: `http://solv-express.herokuapp.com/roles`\n\n```sh\nPOST /roles HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nContent-Type: application/json\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n\n{\n\t\"role\": \"guest\",\n\t\"resource\": \"testResource\",\n\t\"permission\": [\"POST\",\"DELETE\"]\n}\n```\n\n- Delete role resource permission (method): `http://solv-express.herokuapp.com/roles/:role/resources/:resource/permissions/:permission`\n\n```sh\nDELETE /roles/:role/resources/:resource/permissions/:permission HTTP/1.1\nHost: \u003cHost\u003e\nAuthorization: \u003cAccess token\u003e\nContent-Type: application/json\nCache-Control: no-cache\nPostman-Token: \u003cPostman token\u003e\n```\n\n[Test GraphQL api:](#graphqlApi)\n------------\n\n__Full api documentation here: https://yarosj.github.io/solvGraphQLApiDoc__\n\nGraphQl api of this application supports the same as rest jwt authorization.\n\n__The graphQL schema is shown below:__\n\n- Queries:\n\n    User(id: ID!): User\n    \n        User {\n            _id: ID!\n            email: String\n            password: String\n            role: String\n            createdAt: String\n        }\n    \n    Users: [User]\n    \n        User {\n            _id: ID!\n            email: String\n            password: String\n            role: String\n            createdAt: String\n        }\n    \n    Testimonial(id: ID!): Testimonial\n    \n        Testimonial {\n            _id: ID!\n            title: String\n            body: String\n            gender: String\n            autor: String\n        }\n    \n    Testimonials: [Testimonial]\n    \n        Testimonial {\n            _id: ID!\n            title: String\n            body: String\n            gender: String\n            autor: String\n        }\n    \n    Roles: [Role]\n    \n        Role {\n            role: String\n            resources: JSON\n        }\n    \n    Role(role: String!): Role\n    \n        Role {\n            role: String\n            resources: JSON\n        }\n\n- Mutations:\n\n    addUser(data: UserInput!): User\n\n        UserInput {\n            email: String\n            password: String\n            role: String\n            createdAt: String\n        }\n    \n        User {\n            _id: ID!\n            email: String\n            password: String\n            role: String\n            createdAt: String\n        }\n    \n    removeUser(id: ID!): User\n   \n        User {\n            _id: ID!\n            email: String\n            password: String\n            role: String\n            createdAt: String\n        }\n        \n    updateUser(id: ID! data: UserInput!): User\n    \n        UserInput {\n            email: String\n            password: String\n            role: String\n            createdAt: String\n        }\n    \n        User {\n            _id: ID!\n            email: String\n            password: String\n            role: String\n            createdAt: String\n        }\n    \n    addTestimonial(data: TestimonialInput!): Testimonial\n    \n        TestimonialInput {\n            title: String\n            body: String\n            gender: String\n            autor: String\n        }\n    \n        Testimonial {\n            _id: ID!\n            title: String\n            body: String\n            gender: String\n            autor: String\n        }\n    \n    removeTestimonial(id: ID!): Testimonial\n    \n        Testimonial {\n            _id: ID!\n            title: String\n            body: String\n            gender: String\n            autor: String\n        }\n    \n    updateTestimonial(id: ID! data: TestimonialInput!): Testimonial\n    \n        TestimonialInput {\n            title: String\n            body: String\n            gender: String\n            autor: String\n        }\n    \n        Testimonial {\n            _id: ID!\n            title: String\n            body: String\n            gender: String\n            autor: String\n        }\n    \n    addPermissions(data: RoleInput!): Role\n    \n        RoleInput {\n            role: String!\n            resources: [String]\n            permissions: [String]\n        }\n    \n        Role {\n            role: String\n            resources: JSON\n        }\n    \n    removePermissions(role: String! permissions: [String]! resources: [String]): Role\n    \n        Role {\n            role: String\n            resources: JSON\n        }\n    \n    newToken(data: AuthenticationInput!): Authentication\n    \n        AuthenticationInput {\n            email: String\n            password: String\n            refreshToken: String\n        }\n    \n        Authentication {\n            accessToken: String\n            refreshToken: String\n        }\n    \n    refreshToken(refreshToken: String!): Authentication\n    \n        Authentication {\n            accessToken: String\n            refreshToken: String\n        }\n\n## License\n\nMIT License. Copyright 2018 Yaroslaw Zhuk\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyarosj%2Fsimple-mern-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyarosj%2Fsimple-mern-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyarosj%2Fsimple-mern-app/lists"}