-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Track 3/9] Database setup #7
Comments
Finish |
Step 2/4 - Using database's dataEstimated time: 3 hoursIn this step, you'll connect your code with the database and create your first table using only Typescript 😎. Connecting with the databaseDo we have libraries to access our database? Of course we do. We use ORMs to make our work easier by writing Typescript to perform queries to the database. We'd like you to use the same ORM that is used on the project you're going to work, , so if you don't know yet which ORM you should use, please ask your tutors. Some time ago, our main ORM was TypeORM. Now we are more focused on Prisma, but we always keep an eye on the trends so it can even be a third one.
Note: don't forget to check if your docker container is running before connecting to the DB, otherwise it will fail. Now you can ask: "Do they have a tool to manage the data inside the database without code?" Of course we do, young padawan. Actually, we recommend these two apps: Feel free to choose one of these above, or any other app you want :D Creating your first entityAfter successfully connecting the ORM to your database, it's time to see it working by creating your first table. Guess what? It will be called
Note 2: too much for one step? Don't get stuck and feel free to ask anything to any Taqtiler 👍 Open a Pull RequestNow open a pull request for your |
Finish |
Step 3/4 - ReadmeRemember you created a
TIP: an excellent README is that one document that is sufficient for any developer to be able to run and contribute to your project. NOTE 2: For now on, you're going to create branches and Pull requests on your own. Pick good and clear branch names and try to open Pull Requests for one or only few steps. It's not a good practice to have too much code on a PR. 😅 |
Finish |
Step 4/4 - Rebasing your branchHere in Taqtile, before merging our revised (and approved) branches, we rebase it into the one we are attempting to merge. In this case, you'll rebase Too confusing? Here are some good links you can read about rebase: Note: after your The ideal setup we are trying to achieve with the rebases are something like below.: |
Finish |
Click here for your next track |
Step 1/4 - Containers everywhere
Estimated time: 2 hours
[Spoiler alert]: in the end of this onboard, you'll basically develop a CRUD of an entity called
User
. So, in order to store the user data in our app, let's create a real database.The database we use on most of our projects is PostgresSQL, an open-source relational database.
Creating the database containers
feature/setup-database
for the next 2 steps.There are a lot of setup so far right? In order to reduce the project setup time, we use Docker containers to create a database to work locally while developing. We'll create 2 databases: one for running server locally and another for (spoiler alert 2) the tests. Yeah, we will write tests. 🤓
First, make sure you have Docker installed on your machine. Just hit Command Space and type
Docker
. If not, you can download on their site.docker-compose.yml
file on your root project folder.docker-compose.yml
file. You can use this example if you want, just replace the values onenvironment
fields.$ docker compose up -d
on terminal to mount your containers.Note: Before run
docker-compose
commands, make sure that the docker is running on your mac. You can use again Command Space, typeDocker
and hit Enter.Note 2: If you want to stop your containers, you can run
$ docker-compose stop
command in your project's root folder.The text was updated successfully, but these errors were encountered: