Coder Social home page Coder Social logo

y-moshe / todo-ai Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 85 KB

Todo-AI, .NET WebAPI project with basic authentication configured using MySQL Database, rest API and with OpenAI API(ChatGPT).

Home Page: https://todo-ai-app.netlify.app/

C# 99.96% Procfile 0.04%

todo-ai's Introduction

Todo AI - RESTful API Project

.NET WebAPI project with basic authentication configured using MySQL Database, RESTful API, and OpenAI API(ChatGPT).

Getting Started

Requirements:

  1. .NET 7 SDK installed.
  2. Docker installed. (Required only for MySQL Database, if you have already MySQL installed, you can skip to step 3 of Running the app but you need to update the appsettings.Development.json connection strings)

Running the app

  1. Using Docker secrets, in the root of the project create a text file named db_root_password.txt and fill the content as the database root password, you should set the password to toor12345, if you choose something else you need to update the appsettings.Development.json!
  2. Run docker-compose up -d to add & install MySQL container to Docker.

The application uses .NET "Secret manager" More info can be found here

  1. cd into API project / folder and run the following command to set up the required secret key for this app:
  2. dotnet user-secrets set "OpenAPIKey" "[Value]"

This command will create a secrets.json on your local machine that will be used only for this app!
As mentioned in the documentation, that will be stored in:

  • For windows - %APPDATA%\Microsoft\UserSecrets\0889f9dd-f77a-406d-9163-55089035a422\secrets.json
  • For Linux/macOs - ~/.microsoft/usersecrets/0889f9dd-f77a-406d-9163-55089035a422/secrets.json
  1. Run dotnet watch --project .\API\ or any other running command, just make sure you run the API as an entry project.

Deployment steps

The application is configured to be deployed and hosted in AWS Elastic Beanstalk using CodePipeline together with CodeBuild and CodeDeploy services to archive CI/CD a software development best practice and in order to prevent too frequent deployments it has been set up to track any changes to production branch, so any change to production branch will trigger a new deployment process.

To trigger a new deployment process:

  1. Do any changes to master branch and test it, make sure it works, once that ready make a git commit.
  2. Switch to production branch then make a git merge master to sync with the master branch.
  3. Upload the changed code to production branch using git push -u origin production command.
  4. Done. Switch back to master to avoid mistakes.

Sources

  1. https://aws.amazon.com/blogs/devops/building-net-7-applications-with-aws-codebuild/ - as for the current project building time, support for .NET 7.0 on AWS yet to be released and a manual installation is required and archived by connecting to the AWS Elastic Beanstalk instance with SSH Client using AWS EC2 service with a Key Pair.
  2. https://codewithmukesh.com/blog/deploying-aspnet-core-web-api-to-aws-elastic-beanstalk-using-aws-codepipeline/

Swagger API Documentation

http://todo-ai-server.us-east-1.elasticbeanstalk.com/swagger/index.html

todo-ai's People

Contributors

y-moshe avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

gear273

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.