A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

GreenCity

Teach people in a playful and challenging way to have an eco-friendly lifestyle.
https://github.com/ita-social-projects/greencity

Category: Sustainable Development
Sub Category: Education

Keywords from Contributors

archiving transforms measur generic optimize observation compose conversion projection animals

Last synced: about 3 hours ago
JSON representation

Repository metadata

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.

README.md

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:
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
  1. 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.

  1. Navigate to localhost:8060/swagger-ui.html.
  2. Find "own-security controller" tab, open it.
  3. find POST /ownSecurity/signUp endpoint.
  4. Register user and click "Execute". The example of user data can be seen above
  5. 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>;
  6. Navigate to /ownSecurity/signIn endpoint and input your data.
    You will need to enter captcha code,
    you can generate one here.
  7. When you log in, you will receive similar output to the one above.
    Copy accessToken and proceed to GreenCity Swagger web interface.
  8. Press authorize, input access token and you're done!
    On successful login, you will see "authorized" text.

  9. 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 metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 5,257
Total Committers: 152
Avg Commits per committer: 34.586
Development Distribution Score (DDS): 0.954

Commits in past year: 1,039
Committers in past year: 39
Avg Commits per committer in past year: 26.641
Development Distribution Score (DDS) in past year: 0.9

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
MarDatsko d****r@g****m 68
Nazar Vladyka n****0@g****m 68
VinuVicho v****d@g****m 66
olenapetryshak p****4@g****m 64
airetOK s****y@g****m 63
MarianMilian m****n@m****u 60
Yurii Savchenko 4****9 60
MarianDiakiv m****v@g****m 57
yuriikoval1997 y****7@g****m 57
and 122 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 487
Total pull requests: 203
Average time to close issues: 7 months
Average time to close pull requests: 6 days
Total issue authors: 92
Total pull request authors: 27
Average comments per issue: 0.28
Average comments per pull request: 1.37
Merged pull request: 152
Bot issues: 0
Bot pull requests: 9

Past year issues: 381
Past year pull requests: 137
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 6 days
Past year issue authors: 55
Past year pull request authors: 18
Past year average comments per issue: 0.15
Past year average comments per pull request: 1.93
Past year merged pull request: 101
Past year bot issues: 0
Past year bot pull requests: 9

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ita-social-projects/greencity

Top Issue Authors

  • OlesiaLabunska (36)
  • ChernenkoVitaliy (28)
  • MilaKomisarenko (24)
  • kryzanivska-nastya (22)
  • oleksandra-bulhakova (18)
  • KulishValeriia (17)
  • yuliiakaras (16)
  • GuN41K (14)
  • NataliaDovgan (13)
  • TanFedoriv25 (12)
  • YanaTarasiuk (12)
  • OHurkova (12)
  • nmakotkina (11)
  • maks741 (10)
  • Andrii-Danylenko (9)

Top Pull Request Authors

  • maks741 (20)
  • ChernenkoVitaliy (16)
  • Andrii-Danylenko (16)
  • oleksandra-bulhakova (12)
  • KostashchukIryna (12)
  • VasylyshynDmytro (12)
  • GuN41K (11)
  • nazarvladyka (11)
  • RostyslavKhasanov (10)
  • DmytroDovhal (9)
  • RomanZahorui (9)
  • dependabot[bot] (9)
  • Cr1stal423 (8)
  • MarianMilian (7)
  • NazarVavrushchak (6)

Top Issue Labels

  • Bug (204)
  • back-end (166)
  • front-end (131)
  • Pri: medium (128)
  • UBS (102)
  • Functional (99)
  • UI (98)
  • GreenCityUBS (77)
  • ubs-user (70)
  • GreenCity (68)
  • UBS Client (66)
  • Pri: high (63)
  • UBS orders (57)
  • sev:medium (57)
  • User story (53)
  • Pri: low (47)
  • Sev: minor (41)
  • UBS courier (39)
  • type: subtask (34)
  • Technical tasks (33)
  • User Profile (33)
  • API (32)
  • Edit Profile (32)
  • Notifications (31)
  • Change request (28)
  • Admin (26)
  • PROD (25)
  • UBS admin (23)
  • Sev: trivial (19)
  • User data (19)

Top Pull Request Labels

  • back-end (20)
  • type: subtask (11)
  • Admin (11)
  • dependencies (9)
  • go (7)
  • Pri: medium (4)
  • java (4)
  • Technical tasks (3)
  • Create habit (2)
  • type: enhancement (2)
  • GreenCity (2)
  • Pri: high (1)
  • Events (1)
  • Filter (1)
  • Bug (1)

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

Score: 12.009522338485485