yungifez / skuul

A multi school management system
https://yungifez.github.io/skuul.org/
MIT License
325 stars 97 forks source link

Add internal database next to Amazon's external database memory #230

Closed seti1212 closed 1 year ago

seti1212 commented 1 year ago

Hello If you can add an option to the configuration section, by activating it, the database type will be internal And if we give it an off value, the data storage location will be changed to database amazon

In general, my applying for is to use our own hosting spaces to store the files and not have the trouble of accessing the apis of the storage location.

Thankful

yungifez commented 1 year ago

Hello, please can you clarify that you mean amazon s3 for file storage?

seti1212 commented 1 year ago

Hello, please can you clarify that you mean amazon s3 for file storage?

Hello Now we need to fill the following api in the file .env so that our project will create the database in Amazon

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_USE_PATH_STYLE_ENDPOINT=

In this case, the database will be created on Amazon, but we want the project database to be created on our computer so that we can access it more easily.

For this reason,That's why I want an option to the .env file that if we give it the true value, the database will be created on our computer, and if we give it the false value Amazon will still be used as a database as before.

yungifez commented 1 year ago

I'm sorry, I still do not understand what you mean

Do you mean file system or database?

yungifez commented 1 year ago

Hello, please can you clarify that you mean amazon s3 for file storage?

Hello Now we need to fill the following api in the file .env so that our project will create the database in Amazon

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_USE_PATH_STYLE_ENDPOINT=

In this case, the database will be created on Amazon, but we want the project database to be created on our computer so that we can access it more easily.

For this reason,That's why I want an option to the .env file that if we give it the true value, the database will be created on our computer, and if we give it the false value Amazon will still be used as a database as before.

So you want a local database for testing? If so why do you want this ?

seti1212 commented 1 year ago

Can't say I want the project database space next to it for testing Because it has easier access and higher security, and it is also possible that the space provided by Amazon for information storage is limited

seti1212 commented 1 year ago

I'm sorry, I still do not understand what you mean Do you mean file system or database?

I mean changing the location of the database

yungifez commented 1 year ago

So let me get this right, you want to connect to an amazon database?

Or you want to connect to a local database?

yungifez commented 1 year ago

I'm sorry, I still do not understand what you mean Do you mean file system or database?

I mean changing the location of the database

You would love your database to be hosted locally?

seti1212 commented 1 year ago

Would you like your database to be hosted locally?

yes

So that by changing the value of a variable, the location of the database changes to Amazon or to our computer

for example :

#True for amazon and false for local  
Database_type=False
yungifez commented 1 year ago

You could just create .env.amazon and .env.local and fill in each detail. I don't take care of the database drivers and this looks like a problem unique to you

When you want to use your amazon database, you can just do something like this

Cp .env.amazon .env

And for local

Cp .env.local .env

This should work

seti1212 commented 1 year ago

You could just create .env.amazon and .env.local and fill in each detail. I don't take care of the database drivers and this looks like a problem unique to you

When you want to use your amazon database, you can just do something like this

Cp .env.amazon .env

And for local

Cp .env.local .env

This should work

Does this mean that the location of the database is changed from Amazon to local? And no need to import amazon apis to connect to its database?

seti1212 commented 1 year ago

And can the following code be used for other sources whose database is from Amazon so that their database is also changed from Amazon to local ?

Cp .env.local .env
yungifez commented 1 year ago

You could just create .env.amazon and .env.local and fill in each detail. I don't take care of the database drivers and this looks like a problem unique to you

When you want to use your amazon database, you can just do something like this

Cp .env.amazon .env

And for local

Cp .env.local .env

This should work

Does this mean that the location of the database is changed from Amazon to local? And no need to import amazon apis to connect to its database?

Connecting to amazons database should be identical to connecting to a regular database

See this for reference

https://laracasts.com/discuss/channels/laravel/how-do-i-connect-my-app-to-my-aws-rds-instance-from-my-aws-ec2-instance

You'd have to fill out the 2 env files to your wish, what I gave is only a suggestion

And note that subsequent updates may get rid of those files

yungifez commented 1 year ago

And can the following code be used for other sources whose database is from Amazon so that their database is also changed from Amazon to local ?

Cp .env.local .env

This just copies the values from one file to another

seti1212 commented 1 year ago

So why can't you help me to create a local database?

seti1212 commented 1 year ago

Because I want to not use Amazon as a database

yungifez commented 1 year ago

You don't want to use amazon as the database?

Those AWS credentials aren't for database connections

seti1212 commented 1 year ago

Really ? So what does this project use as a database? And is it mandatory to enter AWS credentials to run the project?

yungifez commented 1 year ago

Those AWS credentials are optional for amazon aws

Any mysql database can be used in this project

It is just a laravel app

https://laravel.com/docs/9.x/database#configuration

This should help

seti1212 commented 1 year ago

thanks for your help

Does this mean that the project does not need an api to connect to the database, and even if we do not fill in the following items, the project will still run?

The reason for asking my question was; Because I thought that Amazon could be used as a database

And your project link doesn't work https://skuul.vercel.app/

yungifez commented 1 year ago

I tried deploying on vercel. Didn't work

To connect to a database you need the following

The host, the port, the username, and finally the password

To simplify the installation process, run the following

Php artisan skuul:init
seti1212 commented 1 year ago

Thanks, I just have one more question and then I won't disturb your time anymore.

Can this project be implemented on sites like replit, heroku, and glitch?

Because I tried to run it on replit before, but every time I encountered various errors in the project link.

yungifez commented 1 year ago

I have not usrd any of these services

But a linux based host with access to command line would work

yungifez commented 1 year ago

There is no problem, you arent wasting my time

seti1212 commented 1 year ago

thanks for your help Hope to meet 🌹

yungifez commented 1 year ago

You can in fact host this on heroku by what I'm reading

seti1212 commented 1 year ago

So I go to heroku again