greencity

The main aim of “GreenCity” project is to teach people in a playful and challenging way to have an eco-friendly lifestyle. A user can view on the map places that have some eco-initiatives or suggest discounts for being environmentally aware (for instance, coffee shops that give a discount if a customer comes with their own cup). А user can start doing an environment-friendly habit and track their progress with a habit tracker.

https://github.com/ita-social-projects/greencity

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords from Contributors

projection interactive serializer measurement cycles packaging charts network-simulation archival shellcodes
Last synced: 10 months ago · JSON representation

Repository

The main aim of “GreenCity” project is to teach people in a playful and challenging way to have an eco-friendly lifestyle. A user can view on the map places that have some eco-initiatives or suggest discounts for being environmentally aware (for instance, coffee shops that give a discount if a customer comes with their own cup). А user can start doing an environment-friendly habit and track their progress with a habit tracker.

Basic Info
  • Host: GitHub
  • Owner: ita-social-projects
  • License: mit
  • Language: Java
  • Default Branch: dev
  • Homepage:
  • Size: 40.2 MB
Statistics
  • Stars: 73
  • Watchers: 27
  • Forks: 83
  • Open Issues: 1,125
  • Releases: 2
Created almost 7 years ago · Last pushed 11 months ago
Metadata Files
Readme License

README.md

SoftServe IT Academy. GreenCity project

GreenCity License: MIT GitHub release Build Status Coverage Github Issues Pending Pull-Requests

Copyright 2020 Softserve IT Academy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1. About the project

The main aim of “GreenCity” project is to teach people in a playful and challenging way to have an eco-friendly lifestyle. A user can view on the map places that have some eco-initiatives or suggest discounts for being environmentally aware (for instance, coffee shops that give a discount if a customer comes with their own cup). А user can start doing an environment-friendly habit and track their progress with a habit tracker.

2. Where to find front-end part of the project

Here is the front-end part of our project: https://github.com/ita-social-projects/GreenCityClient.

dev branch of the back-end corresponds to dev branch on the front-end. The same thing with master branches.

3. How to contribute

You're encouraged to contribute to our project if you've found any issues or missing functionality that you would want to see. Here you can see the list of issues and here you can create a new issue.

Before sending any pull request, please discuss requirements/changes to be implemented using an existing issue or by creating a new one. All pull requests should be done into dev branch.

Though there are two GitHub projects (GreenCity for back-end part and GreenCityClient for front-end part) all of the issues are listed in the first one - GreenCity.

NOTE: make sure that your code passes checkstyle. Otherwise your pull request will be declined. See paragraph Setup Checkstyle.

4. Start the project locally

4.1. Required to install

  • Java 21
  • PostgreSQL 9.5 or higher

4.2. How to run

  1. You should open in IntelliJ IDEA File -> New Project -> Project From Version Control -> Repository URL -> URL (https://github.com/ita-social-projects/GreenCity.git) -> Clone.

  2. Open Terminal write git checkout -b dev (this will create new local branch "dev").

  3. After this git pull origin dev (for update last version from branch dev)

  4. You should create database greencity.

  5. Add Configuration -> + -> Application.

  • Name : GreenCityApplication.
  • Use classpath of modules:core
  • JRE : 21.
  1. Enviroment variables:

env-vars

  1. Go to dao -> src -> test -> resources -> sql, find file insert.sql, open it, press Ctrl + A -> RMB -> Execute. (that will run script which fill your db)

  2. Run Application

  3. If you did everything correctly, you should be able to access swagger by this URL: http://localhost:8080/swagger-ui.html#/

4.3. How to work with Swagger UI in our project

[!IMPORTANT] The user authentication and authorization logic is contained in separate project, GreenCityUser. You will need to clone it as well to get going with GreenCity.

git clone https://github.com/ita-social-projects/GreenCityUser.git

[!WARNING] Endpoints are subject to change, so if you cannot find some of the specified below, please contact project members.

  1. Create database called "greencity". Here's example with Docker CLI: shell docker run -d --name greencity_postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB="greencity" -e POSTGRES_USER="greencity_admin" docker.io/postgres
  2. Run GreenCityUser project with all necessary environment variables in place. > [!NOTE] > If you start your project locally, don't forget to change DATASOURCE_URL > environment variable so that it points to localhost:5432.
  3. Navigate to localhost:8060/swagger-ui.html.
  4. Find "own-security controller" tab, open it.
  5. find POST /ownSecurity/signUp endpoint.
  6. Register user and click "Execute". The example of user data can be seen above
  7. Change your status in the database to activated, using command UPDATE users SET user_status = 2 WHERE id = <your_user_id>;. Also, you will need to delete the email verification record. This is done with the following SQL statement: DELETE FROM verify_emails WHERE user_id = <your_user_id>;
  8. Navigate to /ownSecurity/signIn endpoint and input your data. You will need to enter captcha code, you can generate one here.
  9. When you log in, you will receive similar output to the one above. Copy accessToken and proceed to GreenCity Swagger web interface.
  10. Press authorize, input access token and you're done! On successful login, you will see "authorized" text.
  11. Now you can use swagger UI to test REST API. Some controllers require ADMIN role. By default, new registered users have role USER. To overcome this you need to update record that corresponds to your user in the local database. For example, UPDATE users SET role = 1 WHERE id = <your_user_id>;.

Additional note for adding new endpoints

If you add a new endpoint, ensure that it is also added to the configuration file (application.property) for proper functioning.

4.5. Connect with front-end

There is no special configurations required. Just clone GreenCityClient and run it. If you want to sign in with Google account, it's mandatory to set google.clientId. Read more about how to obtain Google client id, it's free.

5. Setup Checkstyle

Here you can read more about how to set up checkstyle;

Here you can read more about SonarLint;

Owner

  • Name: ITA-Social-Projects
  • Login: ita-social-projects
  • Kind: organization
  • Email: ita.social.projs@gmail.com

GitHub Events

Total
  • Create event: 318
  • Issues event: 1,592
  • Watch event: 6
  • Delete event: 293
  • Member event: 2
  • Issue comment event: 1,069
  • Push event: 1,261
  • Gollum event: 7
  • Pull request review comment event: 778
  • Pull request event: 575
  • Pull request review event: 1,437
  • Fork event: 6
Last Year
  • Create event: 319
  • Issues event: 1,601
  • Watch event: 6
  • Delete event: 293
  • Member event: 2
  • Issue comment event: 1,073
  • Push event: 1,263
  • Gollum event: 7
  • Pull request review comment event: 778
  • Pull request event: 577
  • Pull request review event: 1,440
  • Fork event: 6

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 5,319
  • Total Committers: 161
  • Avg Commits per committer: 33.037
  • Development Distribution Score (DDS): 0.954
Past Year
  • Commits: 917
  • Committers: 42
  • Avg Commits per committer: 21.833
  • Development Distribution Score (DDS): 0.887
Top Committers
Name Email Commits
ospodaryk o****1@g****m 244
forestik o****0@g****m 222
Lena Sotnik l****k@L****l 189
SashkoMolodec s****4@g****m 174
Markiyan Derevetskyi m****5@g****m 143
RostyslavKhasanov r****v@g****m 143
Taras t****1@g****m 122
Danylo Hlynskyi d****y@g****m 122
studroma s****a@g****m 112
K4sik k****7@g****m 104
Viktoriia Herchanivska v****a@g****m 92
Nazar Stasyuk n****k@g****m 91
Anton Bondar b****l@g****m 88
DmytroDmytruk 9****k 85
Skyere 7****e 84
Maryna m****0@g****m 84
Kate Horokh r****h@g****m 83
greatpanda1603 o****k@g****m 82
Skajl-dev b****9@g****m 80
Yurii 5****i 79
Warded120 g****1@g****m 76
Nazar Vladyka n****0@g****m 68
MarDatsko d****r@g****m 68
VinuVicho v****d@g****m 66
olenapetryshak p****4@g****m 64
airetOK s****y@g****m 63
Yurii Savchenko 4****9 60
MarianMilian m****n@m****u 60
MarianDiakiv m****v@g****m 57
yuriikoval1997 y****7@g****m 57
and 131 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1,919
  • Total pull requests: 800
  • Average time to close issues: 11 months
  • Average time to close pull requests: 21 days
  • Total issue authors: 320
  • Total pull request authors: 97
  • Average comments per issue: 0.25
  • Average comments per pull request: 1.05
  • Merged pull requests: 527
  • Bot issues: 2
  • Bot pull requests: 35
Past Year
  • Issues: 1,011
  • Pull requests: 537
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 5 days
  • Issue authors: 92
  • Pull request authors: 48
  • Average comments per issue: 0.09
  • Average comments per pull request: 1.24
  • Merged pull requests: 364
  • Bot issues: 0
  • Bot pull requests: 24
Top Authors
Issue Authors
  • willuloveme (42)
  • yuliiakaras (39)
  • Vitaliia8303 (39)
  • IraKryzhanivska (38)
  • kryzanivska-nastya (37)
  • Olgatariel (36)
  • OMGaranina (31)
  • OlesiaLabunska (31)
  • Phobos13bdrive (30)
  • nazarvasko (29)
  • ChernenkoVitaliy (29)
  • MilaKomisarenko (29)
  • YuliyaTymkiv (28)
  • kovalsofiia1 (27)
  • LatyshevaBaranovska (23)
Pull Request Authors
  • maks741 (66)
  • holotsvan (53)
  • oleksandra-bulhakova (44)
  • Maryna-511750 (36)
  • HelenSotnik (36)
  • dependabot[bot] (35)
  • Andrii-Danylenko (34)
  • KizerovDmitriy (28)
  • ChernenkoVitaliy (24)
  • VasylyshynDmytro (24)
  • ToriForH (23)
  • DmytroDmytruk (23)
  • urio999 (23)
  • IliaWithHat (21)
  • KostashchukIryna (19)
Top Labels
Issue Labels
Bug (1,091) Pri: medium (431) back-end (364) UI (344) UBS (328) Functional (308) GreenCity (288) Pri: high (275) GreenCityUBS (266) front-end (235) Sev: minor (230) UBS admin (212) UBS orders (199) Pri: low (199) sev:medium (190) User story (186) API (184) UBS Client (145) Sev: major (143) ubs-user (136) Events (128) UBS courier (125) GreenCityUser (100) UBS Personal Cabinet (100) GreenCityEvent (96) Change request (94) Sev: trivial (84) Admin (79) PROD (75) Create event (72)
Pull Request Labels
Bug (46) back-end (37) dependencies (35) java (22) Pri: medium (18) go (17) GreenCity (12) UI (12) Functional (11) Admin (9) sev:medium (9) Notifications (9) API (9) UBS (9) UBS admin (7) type: subtask (6) Pri: high (6) Events (6) GreenCityUBS (6) User story (6) GreenCityEvent (5) Pri: low (5) PROD (5) Sev: minor (5) front-end (5) Technical tasks (4) Pickup city UBS Admin cabinet (4) type: enhancement (4) Comments (4) Sev: trivial (4)

Dependencies

.github/workflows/main.yml actions
  • JamesIves/github-pages-deploy-action 3.7.1 composite
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • docker/build-push-action v3.0.0 composite
  • docker/login-action v2.0.0 composite
  • dorny/test-reporter v1.5.0 composite
Dockerfile docker
  • openjdk 11.0.15-jre build
chart-test/go.mod go
  • cloud.google.com/go v0.83.0
  • github.com/Skyere/helm-testing v1.7.0
  • github.com/aws/aws-sdk-go v1.40.56
  • github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc
  • github.com/cpuguy83/go-md2man/v2 v2.0.0
  • github.com/davecgh/go-spew v1.1.1
  • github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c
  • github.com/ghodss/yaml v1.0.0
  • github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0
  • github.com/go-logr/logr v0.2.0
  • github.com/go-sql-driver/mysql v1.4.1
  • github.com/gogo/protobuf v1.3.2
  • github.com/golang/protobuf v1.5.2
  • github.com/google/gofuzz v1.1.0
  • github.com/google/uuid v1.2.0
  • github.com/googleapis/gnostic v0.4.1
  • github.com/gruntwork-io/go-commons v0.8.0
  • github.com/gruntwork-io/terratest v0.40.17
  • github.com/hashicorp/errwrap v1.0.0
  • github.com/hashicorp/go-multierror v1.1.0
  • github.com/imdario/mergo v0.3.11
  • github.com/jmespath/go-jmespath v0.4.0
  • github.com/json-iterator/go v1.1.11
  • github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326
  • github.com/mitchellh/go-homedir v1.1.0
  • github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
  • github.com/modern-go/reflect2 v1.0.1
  • github.com/pmezard/go-difflib v1.0.0
  • github.com/pquerna/otp v1.2.0
  • github.com/russross/blackfriday/v2 v2.1.0
  • github.com/spf13/pflag v1.0.5
  • github.com/stretchr/testify v1.8.0
  • github.com/urfave/cli v1.22.2
  • golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
  • golang.org/x/net v0.0.0-20210614182718-04defd469f4e
  • golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
  • golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e
  • golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
  • golang.org/x/text v0.3.6
  • golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
  • google.golang.org/appengine v1.6.7
  • google.golang.org/protobuf v1.26.0
  • gopkg.in/inf.v0 v0.9.1
  • gopkg.in/yaml.v2 v2.4.0
  • gopkg.in/yaml.v3 v3.0.1
  • k8s.io/api v0.20.6
  • k8s.io/apimachinery v0.20.6
  • k8s.io/client-go v0.20.6
  • k8s.io/klog/v2 v2.4.0
  • k8s.io/utils v0.0.0-20201110183641-67b214c5f920
  • sigs.k8s.io/structured-merge-diff/v4 v4.0.3
  • sigs.k8s.io/yaml v1.2.0
chart-test/go.sum go
  • 621 dependencies
core/pom.xml maven
  • greencity:service-api 1.0-SNAPSHOT compile
  • com.fasterxml.jackson.core:jackson-core 2.12.1
  • com.fasterxml.jackson.core:jackson-databind 2.12.1
  • com.fasterxml.jackson.datatype:jackson-datatype-jsr310
  • com.github.ben-manes.caffeine:caffeine 2.8.1
  • com.google.api-client:google-api-client 1.30.7
  • com.google.cloud:google-cloud-storage 1.105.0
  • commons-codec:commons-codec 1.14
  • commons-fileupload:commons-fileupload 1.3
  • commons-io:commons-io 2.7
  • greencity:dao 1.0-SNAPSHOT
  • greencity:service 1.0-SNAPSHOT
  • io.jsonwebtoken:jjwt 0.9.1
  • io.springfox:springfox-bean-validators 2.9.2
  • io.springfox:springfox-swagger-ui 2.9.2
  • io.springfox:springfox-swagger2 2.9.2
  • net.java.dev.jna:jna ${net.java.dev.jna.version}
  • org.apache.commons:commons-lang3 3.10
  • org.apache.poi:poi 4.1.2
  • org.apache.poi:poi-ooxml 4.1.2
  • org.jetbrains.kotlin:kotlin-stdlib 1.7.0
  • org.liquibase:liquibase-maven-plugin 3.8.4
  • org.modelmapper:modelmapper ${modelmapper.version}
  • org.postgresql:postgresql
  • org.projectlombok:lombok
  • org.springframework.boot:spring-boot-devtools
  • org.springframework.boot:spring-boot-starter-amqp
  • org.springframework.boot:spring-boot-starter-cache
  • org.springframework.boot:spring-boot-starter-security
  • org.springframework.boot:spring-boot-starter-web
  • org.springframework.boot:spring-boot-starter-websocket
  • org.springframework.social:spring-social-core 1.1.6.RELEASE
  • org.springframework.social:spring-social-facebook 2.0.3.RELEASE
  • org.thymeleaf.extras:thymeleaf-extras-java8time 3.0.4.RELEASE
  • org.thymeleaf:thymeleaf-spring5 3.0.11.RELEASE
  • com.tngtech.java:junit-dataprovider 1.13.1 test
  • org.junit.jupiter:junit-jupiter-engine ${junit-jupiter.version} test
  • org.mockito:mockito-core ${mockito-core.version} test
  • org.mockito:mockito-junit-jupiter ${mockito-junit-jupiter.version} test
  • org.powermock:powermock-api-mockito2 2.0.4 test
  • org.springframework.boot:spring-boot-starter-test test
  • org.springframework.security:spring-security-test test
  • org.springframework:spring-test test
  • org.testcontainers:junit-jupiter ${test.containers.version} test
  • org.testcontainers:postgresql ${test.containers.version} test
dao/pom.xml maven
  • greencity:service-api 1.0-SNAPSHOT compile
  • javax.validation:validation-api 2.0.1.Final
  • org.hibernate:hibernate-jpamodelgen
  • org.projectlombok:lombok
  • org.springframework.boot:spring-boot-starter-data-jpa
  • com.h2database:h2 1.4.200 test
  • org.junit.jupiter:junit-jupiter-engine 5.4.2 test
  • org.liquibase:liquibase-maven-plugin 3.8.4 test
  • org.mockito:mockito-junit-jupiter test
  • org.postgresql:postgresql 42.2.5 test
  • org.springframework.boot:spring-boot-starter-test test
  • org.testcontainers:postgresql 1.15.0-rc2 test
pom.xml maven
service/pom.xml maven
  • com.google.cloud:google-cloud-storage 1.105.0 compile
  • greencity:dao 1.0-SNAPSHOT compile
  • greencity:service-api 1.0-SNAPSHOT compile
  • org.modelmapper:modelmapper ${modelmapper.version} compile
  • org.springframework.social:spring-social-facebook 2.0.3.RELEASE compile
  • com.azure:azure-storage-blob 12.7.0
  • com.google.maps:google-maps-services 2.0.0
  • commons-fileupload:commons-fileupload 1.3
  • commons-io:commons-io 2.6
  • org.apache.commons:commons-collections4 4.1
  • org.apache.commons:commons-lang3
  • org.apache.httpcomponents:httpclient 4.5.12
  • org.locationtech.jts:jts-core 1.19.0
  • org.projectlombok:lombok
  • org.springframework.amqp:spring-rabbit
  • org.springframework.boot:spring-boot-starter-web
  • org.awaitility:awaitility 3.1.6 test
  • org.junit.jupiter:junit-jupiter-engine ${junit-jupiter.version} test
  • org.junit.jupiter:junit-jupiter-params ${junit-jupiter.version} test
  • org.mockito:mockito-core ${mockito-core.version} test
  • org.mockito:mockito-inline ${mockito-core.version} test
  • org.mockito:mockito-junit-jupiter ${mockito-junit-jupiter.version} test
  • org.springframework.boot:spring-boot-starter-test test
service-api/pom.xml maven
  • io.jsonwebtoken:jjwt 0.9.1 compile
  • com.google.code.gson:gson
  • javax.validation:validation-api 2.0.1.Final
  • org.apache.tomcat.embed:tomcat-embed-core
  • org.hibernate.validator:hibernate-validator
  • org.projectlombok:lombok
  • org.springframework.boot:spring-boot-starter-validation
  • org.springframework.data:spring-data-commons
  • org.springframework.security:spring-security-core
  • org.springframework:spring-beans
  • org.springframework:spring-context
  • org.springframework:spring-web
  • org.junit.jupiter:junit-jupiter-engine ${junit-jupiter.version} test
  • org.junit.jupiter:junit-jupiter-params test
  • org.mockito:mockito-core ${mockito-core.version} test
  • org.mockito:mockito-junit-jupiter ${mockito-junit-jupiter.version} test