Skip to content

Plastic Origins 'all in one' Backend - API for data upload from app or website.

License

Notifications You must be signed in to change notification settings

surfriderfoundationeurope/po-mobile-backend

Repository files navigation

po-mobile-backend

Proudly Powered by SURFRIDER Foundation Europe, this open-source initiative is a part of the PLASTIC ORIGINS project - a citizen science project that uses AI to map plastic pollution in European rivers and share its data publicly. Browse the project repository to know more about its initiatives and how you can get involved. Please consider starring ⭐ the project's repositories to show your interest and support. We rely on YOU for making this project a success and thank you in advance for your contributions.


Welcome to the Plastic Origins 'all in one' backend that allows the Plastic Origins Mobile app (available on Android & IOS) and Web app (data labelling tool www.trashroulette.com) to consume their main APIs that support:

  • User CRUD on our PostgreSQL database.

  • Upload images (images to be labelled though our data labelling tool www.trashroulette.com).

  • Upload video (videos to be analysed by our AI litter detection model).

  • Parse JSON files coming from our Plastic Origins Mobil app and store data in our PostgreSQL database.

  • Read and update images listed in the label scheme of our PostgreSQL database.

Getting Started

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed .Net Core 3.1 or lastest
  • You have installed the latest version of Azure Emulator if you want to use on your local machine
  • You have a PostgreSQL 11.6 minimum database for local use on your machine.

Technical stack

  • Language: C#
  • Framework: .Net Core
  • Unit test framework: XUnit

Settings file

Create a local.settings.json within the functions folder. Paste this content and obviously replace with your values.

{
	"IsEncrypted": false,
	"Values": {
		"TraceStorage": "UseDevelopmentStorage=true;",
		"AzureWebJobsStorage": "UseDevelopmentStorage=true;",
		"JwtTokenKey": "jsutAVeryLongRandomString",
		"PostgresqlDbConnectionString": "",
		"MailjetApiKey": "",
		"MailjetApiSecret": "",
		"BaseFunctionUrl": "http://localhost:7071"
	},
	"Host": {
		"CORS": "*"
	}
}
  • Replace TraceStorage value with either the local Azure Storage Explorer emulator (or Azurite container), or the development storage account
  • Replace AzureWebJobsStorage value with the local Azure Storage Explorer emulator (or Azurite container).

Remarks: MailjetApiKeys are only required for sending emails.

API references

SOON: To see API specification used by this repository browse to the Swagger documentation (currently not available).

Build and Test

Build the Project

dotnet restore 
dotnet build

Launch the program

dotnet run 
http://localhost:7071/

Test

dotnet test

Contributing

It's great to have you here! We welcome any help and thank you in advance for your contributions.

  • Feel free to report a problem/bug or propose an improvement by creating a new issue. Please document as much as possible the steps to reproduce your problem (even better with screenshots). If you think you discovered a security vulnerability, please contact directly our Maintainers.

  • Take a look at the open issues labeled as help wanted, feel free to comment to share your ideas or submit a pull request if you feel that you can fix the issue yourself. Please document any relevant changes.

Maintainers

If you experience any problems, please don't hesitate to ping:

Special thanks to all our Contributors.

License

We’re using the MIT License. For more details, check LICENSE file.

About

Plastic Origins 'all in one' Backend - API for data upload from app or website.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published