ᅠ ᅠ
Developers: Daniil Livitn, Roman Soldatov
This is the repository with Backend code for the InnoTutor project. The backend is designed as REST API, so you need the frontend part to access it. Alternatively, you can use Postman or Swagger. The main description of the project is available here
Technical Stack:
For this open-source project, we used the simplest registration way via Google Firebase
- as a website user, you need to have a Google account
- as a developer, who is going to host this project version, you need to get your own Google credentials.
In case of using this project in Innopolis University we'll change authentication to innopolis email login page.
There is documentation with all requests which backend supports. You can read about API documentation here
We use Docker and PostgreSQL for the database. Here is the database diagram
URL
, username
and password
.
To log in, you need to provide your Google credentials created here.
Then open application.properties file and input your JSON Google credentials file as a single string in GOOGLE_CREDENTIALS
field.
You can use this online service to convert JSON into a string with escape characters: link
In case of any problems refer to this guide
We use Heroku to host the backend. Here is the deployed version of it.
For continuous integration, we have to make a pull request into the main
branch. Then Heroku will automatically deploy a new version on the server.
To build the project on Heroku's server you need to provide config vars: DATABASE_URL
and GOOGLE_CREDENTIALS
. Also, add this buildpack https://github.com/buyersight/heroku-google-application-credentials-buildpack.git
Guide how to work with config vars: link
InnotutorBackendApplication
java class and press ctrl+R
Guide how to run Spring project: link
Another way of install project but without IDE (note: you should have Maven installed)
1) Clone this repository to your machine using:
https://github.com/InnoTutor/Backend.git
2) You need to create a database and specify the path to it in theapplication.properties
. Besides this, you need to specify your username, password and google credentials.
Note: Path toapplication.properties
: application.propertiesspring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/innotutor} spring.datasource.username=${SPRING_DATASOURCE_USERNAME:postgres} spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:root} ... GOOGLE_CREDENTIALS=<Your Google Credentials>
3) Using the command line, navigate to the root folder of the project and run the command:
mvn clean install
4) After a successful build, you need to run the command:
java -jar .target/innotutor_backend-0.0.1-SNAPSHOT.jar
or
java -jar target/innotutor_backend-0.0.1-SNAPSHOT.jar
# Code analysis
* [The result of PMD static analyzer](https://github.com/InnoTutor/README/blob/main/StaticAnaylyzer/result.md). Do not be scared by such a huge number of violations. We fixed all the violations that we could fix. Other violations can not be fixed due to spring framework-specific code which requires to follow special name convention, so the framework could understand fields and create particular [Beans](https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-definition).
# Want to contribute?
You can contribute to this project. Just fork the repository from the `develop` branch, implement changes you want to propose and make a pull request.
Also, there are [issues](https://github.com/InnoTutor/Backend/issues), so feel free to submit a new one or participate in existing.