anitab-org / mentorship-backend

Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the backend of this system.
https://mentorship-backend-temp.herokuapp.com/
GNU General Public License v3.0
196 stars 449 forks source link

Setup an initial database for local development #275

Open isabelcosta opened 4 years ago

isabelcosta commented 4 years ago

Is your feature request related to a problem?

This feature is to ease a developer's life when running the app for simple testing, or to test a specific feature.

I want to have a way to setup an initial database, when I run the project. If I run the project I don't want to have always to setup the entire dataset, I want the option to use an existing database.

Example: I want to clone run the project with the option to use dataset 1 with 3 users, 2 of them in a mentorship relation with a couple of tasks. Once this is loaded, when I run the project, I can test the local app knowing I have these already created.

Describe the solution you'd like

Not sure about the solution to be honest. Open for suggestions!

Describe alternatives you've considered

Broadly speaking... have a local environment variable to say if a data is to be loaded, and have a part of the code, such as feature toggle, that if that is set a specific dataset is loaded.

Be aware that, for user emails, this can be configured at anytime. Imagining i'm using temporary emails, not everyday I will have the same emails to work with, so emails should not be "set in stone".

Additional context

Maybe this can be solved in a way with #78 ... I'm not sure, but its worth mentioning.

If anyone needs more clarification I'd be more than happy to help with this

bartekpacia commented 4 years ago

Hi @isabelcosta, what do you think of using Flask-Script? It looks like a right tool for this job 🛠.

Along with script populating database, I will try to implement what you asked for in #78

isabelcosta commented 4 years ago

@bartekpacia seems good :) I'm open to ideas 👐

bartekpacia commented 4 years ago

Okay, I'm working on the early implementation :)