{"id":13872163,"url":"https://github.com/Apodini/ApodiniXpenseExample","last_synced_at":"2025-07-16T01:33:01.357Z","repository":{"id":40580357,"uuid":"394200391","full_name":"Apodini/ApodiniXpenseExample","owner":"Apodini","description":"Apodini Xpense Example","archived":false,"fork":false,"pushed_at":"2023-06-28T06:39:54.000Z","size":1556,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2024-08-06T23:51:39.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Apodini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/MIT.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-09T07:51:59.000Z","updated_at":"2022-01-02T13:13:24.000Z","dependencies_parsed_at":"2023-01-20T18:19:05.217Z","dependency_job_id":null,"html_url":"https://github.com/Apodini/ApodiniXpenseExample","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apodini%2FApodiniXpenseExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apodini%2FApodiniXpenseExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apodini%2FApodiniXpenseExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apodini%2FApodiniXpenseExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apodini","download_url":"https://codeload.github.com/Apodini/ApodiniXpenseExample/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226090030,"owners_count":17572114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-05T23:00:35.525Z","updated_at":"2024-11-23T19:31:38.276Z","avatar_url":"https://github.com/Apodini.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"\u003c!--\n\nThis source file is part of the Apodini Xpense Example open source project\n\nSPDX-FileCopyrightText: 2018-2021 Paul Schmiedmayer and project authors (see CONTRIBUTORS.md) \u003cpaul.schmiedmayer@tum.de\u003e\n\nSPDX-License-Identifier: MIT\n\n--\u003e\n\n# Apodini Xpense Example\n\n[![Build and Test](https://github.com/Apodini/ApodiniXpenseExample/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/Apodini/ApodiniXpenseExample/actions/workflows/build-and-test.yml)\n[![Build Docker Compose](https://github.com/Apodini/ApodiniXpenseExample/actions/workflows/docker-compose.yml/badge.svg)](https://github.com/Apodini/ApodiniXpenseExample/actions/workflows/docker-compose.yml)\n\nThis repository includes an example Apodini web service, a shared Swift Package, and an iOS App that can be used as a starting point for an Apodini web service.  \n\n## Run the Xpense Example System\n\nYou can start the Apodini example web services on any system that supports [docker](https://www.docker.com) and [docker compose](https://docs.docker.com/compose/). Follow the instructions on https://docs.docker.com/compose/install/ to install docker and docker compose.\nTo start and test the web service, you can run the `$ docker compose up` command to start the web service. \n\nXcode 13 (only available on macOS) is required to build and run the example client application. Follow the instructions on https://developer.apple.com/xcode/ to install the latest version of Xcode.\n\n1. Opening the *Xpense.xcworkspace*. The workspace bundles the web services and the client application.\n2. Select the *WebService* target, and then the *Xpense* target and start the web service as well as the app by following the instructions on [Running Your App in the Simulator or on a Device](https://developer.apple.com/documentation/xcode/running-your-app-in-the-simulator-or-on-a-device)\n\n## System Functionality\n\nThe example system features an example application to manage accounts and transactions to keep track of your expeses and income.\nPlease note that this is a demo system and does not include sophisticated authentication or authorization mechanisms.\nIt includes examples of sharing code between a web service and the client application.\n\n### Web Service API\n\nYou can test out the API by starting up the web service using the `$ docker compose up` command or use the `xpense` command line tool in the `Shared` Swift package.\n\n### Client Application\n\nYou can use the functionality of the web service using the bundled client application.\n\n## Apodini Deployer Functionality\n\nThe system also demonstrates the usage of the Apodini Deployer functionality provided by the Apodini Deployer subsystem.\nThe web service includes the support for the Localhost process-based and AWS FaaS-based Deployment Provider.\nYou can use the following scripts to deploy the web service using the different Deployment Providers.\n\n### Localhost Deployment Provider\n\n```console\n$ git clone https://github.com/Apodini/Apodini.git\n$ cd Apodini\n$ git checkout 0.8.0\n$ swift run LocalhostDeploymentProvider ../WebService --product-name WebService\n[...]\nnotice DeploymentTargetLocalhost : Compiling target 'WebService'\n[...]\ninfo DeploymentTargetLocalhost.ProxyServer : Server starting on 0.0.0.0:80\n[...]\ninfo org.apodini.application : Server starting on 0.0.0.0:52011\ninfo org.apodini.application : Server starting on 0.0.0.0:52003\ninfo org.apodini.application : Server starting on 0.0.0.0:52007\ninfo org.apodini.application : Server starting on 0.0.0.0:52005\ninfo org.apodini.application : Server starting on 0.0.0.0:52009\ninfo org.apodini.application : Server starting on 0.0.0.0:52001\ninfo org.apodini.application : Server starting on 0.0.0.0:52002\ninfo org.apodini.application : Server starting on 0.0.0.0:52012\ninfo org.apodini.application : Server starting on 0.0.0.0:52006\ninfo org.apodini.application : Server starting on 0.0.0.0:52000\ninfo org.apodini.application : Server starting on 0.0.0.0:52010\ninfo org.apodini.application : Server starting on 0.0.0.0:52004\ninfo org.apodini.application : Server starting on 0.0.0.0:52008\n```\n\n### AWS Lambda Deployment Provider\n\nYou need to install Docker on your machine to run the AWS Deployment Provider: https://docs.docker.com/get-docker/\nThe AWS Lambda Deployment providers needs valid AWS Credentials to deploy the web service to AWS Lambda functions.\nYou can create a credentials file by following the AWS CLI Documentation at https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html.\nYou have to create an S3 bucket that can be used to upload the AWS Lambda binaries.\nAWS Access Key ID and the AWS Secret Access Key need to have access to the S3 Bucket used to upload the compiled binary to, create an configure AWS Lambda functions, create and configure an AWS API Gateway, and configure IAM roles to set up the AWS Lambda deployment.\n\n```console\n$ git clone https://github.com/Apodini/Apodini.git\n$ cd Apodini\n$ git checkout 0.8.0\n$ swift run AWSLambdaDeploymentProvider deploy ../WebService --product-name WebService --s3-bucket-name apodinixpenseexample\n[...]\nnotice apodini.ApodiniLambda : Preparing docker image\n[...]\nnotice apodini.ApodiniLambda : Successfully built docker image. image name: apodini-lambda-builder\nnotice apodini.ApodiniLambda : Generating web service structure\n[...]\nnotice apodini.ApodiniLambda : Successfully generated web service structure\nnotice apodini.ApodiniLambda : Compiling SPM target 'WebService' for lambda\n[...]\nnotice apodini.ApodiniLambda : Deploying to AWS\n[...]\nnotice apodini.ApodiniLambda.AWSIntegration : Creating lambda package\nnotice apodini.ApodiniLambda.AWSIntegration : Zipping lambda package\nnotice apodini.ApodiniLambda.AWSIntegration : Uploading lambda package to s3://apodinixpenseexample/apodini-lambda/lambda.out.zip\nS3 upload done.\nnotice apodini.ApodiniLambda.AWSIntegration : Creating lambda functions for nodes in the web service deployment structure (#nodes: 13)\n[...]\nnotice apodini.ApodiniLambda.AWSIntegration : Importing API definition into the API Gateway\nnotice apodini.ApodiniLambda.AWSIntegration : Updating API Gateway name\nnotice apodini.ApodiniLambda.AWSIntegration : Deployed 13 lambdas to api gateway w/ id 'GATEWAY_ID'\nnotice apodini.ApodiniLambda.AWSIntegration : Invoke URL: https://GATEWAY_ID.execute-api.eu-central-1.amazonaws.com/\nnotice apodini.ApodiniLambda : Done! Successfully applied the deployment.\n```\n\nThe Deployment provider automatically decomposes the web service in 12 Lambda functions which are deployed behind an AWS Gateway.\nYou can delete the Lambda functions and API Gateway routes using the `remove-deployment` subcommand. If you keep the API Gateway you can use the Gateway ID in subsequent deployments instead of using `_createNew` as used in the commands above.\n```console\n$ swift run DeploymentTargetAWSLambda remove-deployment --api-gateway-api-id GATEWAY_ID --keep-api-gateway true\n``` \n\n## Contributing\nContributions to this project are welcome. Please make sure to read the [contribution guidelines](https://github.com/Apodini/.github/blob/main/CONTRIBUTING.md) and the [contributor covenant code of conduct](https://github.com/Apodini/.github/blob/main/CODE_OF_CONDUCT.md) first.\n\n## License\nThis project is licensed under the MIT License. See [License](https://github.com/Apodini/ApodiniXpenseExample/blob/develop/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FApodini%2FApodiniXpenseExample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FApodini%2FApodiniXpenseExample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FApodini%2FApodiniXpenseExample/lists"}