Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How it run #52

Closed
BogdanJak opened this issue Apr 21, 2024 · 8 comments
Closed

How it run #52

BogdanJak opened this issue Apr 21, 2024 · 8 comments
Assignees
Labels
documentation Improvements or additions to documentation medium
Milestone

Comments

@BogdanJak
Copy link

Hi

Do you have any instructions on how to run your project?

Bogdan

@FritzTheCat9
Copy link
Owner

The application is still in development, but some features are working and You can run the app. The are some problems with running all the containers in docker, but You can set up it manually to make it work.

  1. Download app source code.
  2. Have Visual Studio downloaded to run newest blazor and .net projects (.NET 8)
  3. Set multiple project startup:
    image
    Select Api and Blazor project
    image
  4. Also You will need to setup database on docker. I user docker-compose and have it all set up.
    In YoutubeLinks.Shared/Scripts.md You have some commands and scripts to set up this project.
    Use docker-compose file to set up containers but for now only database one is working properly:
    cd C:\Users\bartl\source\repos\YoutubeLinks
    docker compose up --build -d
    docker ps
    Run only database container:
    image
    Then create and update the database:
    cd C:\Users\bartl\source\repos\YoutubeLinks\YoutubeLinks.Api
    dotnet ef database update
    You will need to create database inside this container:
    image
    image
    In YoutubeLinks.Shared/Scripts.md there is info about which credentials are used to set up the database and on which ports the applications are running:
    image
  5. If database is running on the docker container and Api and Blazor project are running inside Visual Studio You can login to the app with credentials:
    image
    Admin:
    Email: ytlinksapp@gmail.com
    Password: Asd123!
    User:
    Email: ytlinksapp1@gmail.com
    Password: Asd123!
  6. Only register function will not work because in appsettings my appllication email is linked to send registration emails:
    You can change it to use another email credentials if You want.
    image
    I will try to fix Api and Blazor docker containers and provide better setup instruction. Also database setup should be more clear and the setup instrucion.

Sorry for this a bit messy instruction. If You have any more questions feel free to ask me.

@FritzTheCat9 FritzTheCat9 self-assigned this Apr 21, 2024
@FritzTheCat9 FritzTheCat9 added documentation Improvements or additions to documentation medium labels Apr 21, 2024
@FritzTheCat9 FritzTheCat9 added this to the 1.0 milestone Apr 21, 2024
@FritzTheCat9
Copy link
Owner

I guess i fixed Api and Blazor containers issues, there were some problems with yt-dlp library that i use.
Now You should be able to start all containers from docker-compose file no need to start them manually from Visual Studio.

Also when using database from docker you must change connection string in appsettings.json:
image

Fixed issue: #21

Thank You for helping me to improve my project.
Also i will try to make setting database faster.

@FritzTheCat9
Copy link
Owner

Fixed issue: #58 (Database should be created and migrations applied on application start)
Updated readme.
You should be able to run my app with one command:
docker compose up --build -d

@BogdanJak
Copy link
Author

BogdanJak commented May 8, 2024 via email

@FritzTheCat9
Copy link
Owner

Wpisujesz te dwie komendy w terminalu:

cd C:\Users\bartl\source\repos\YoutubeLinks
docker compose up --build -d

image

Na docker desktop powinny być widoczne 4 odpalone kontenery:
image

Pod tymi linkami są dostępne aplikacje (baza danych powinna sama się utworzyć, nic nie trzeba robić):

Jak odpalam tak aplikację to wszystko mi działa.
Możesz podesłać mi jakiś zrzut ekranu?

Server error może wystąpić jak nie działa Api:
image
Jak ten kontener jest wyłączony to będzie sypało server errorami (bo Api nie jest włączone):
image
Można podejrzeć logi z kontenera (wtedy widać gdzie jest błąd lub gdzie coś się wywaliło w aplikacji):
image

@BogdanJak
Copy link
Author

BogdanJak commented May 8, 2024 via email

@FritzTheCat9
Copy link
Owner

Sposób na odpalenie aplikacji bez dockera:

  • Ustawiamy aplikacje które mają startować (wybieramy w Api http i Blazor http, potem zaznaczamy je jako multiple project startup).

  • YoutubeLinks.Api -> appsettings.json -> podmieniamy connection string na:
    "ConnectionString": "Server=(localdb)\\mssqllocaldb;Database=YoutubeLinks;Trusted_Connection=True;"

  • Na serwerze: "(localdb)\mssqllocaldb" powinna utworzyć się baza danych o nazwie YoutubeLinks (po starcie aplikacji).

  • Startujemy aplikację

Filmik z podmianą connection stringa:
https://github.com/FritzTheCat9/YoutubeLinks/assets/62745092/8ca8f879-2c77-4da7-8985-c248bd8fa63e

Filmik z odpalenia apki:
https://github.com/FritzTheCat9/YoutubeLinks/assets/62745092/79f0241c-0cf6-41e0-83e7-bb9af69fa2f3

@BogdanJak
Copy link
Author

BogdanJak commented May 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation medium
Projects
None yet
Development

No branches or pull requests

2 participants