Welcome 👋 friends to this new blog post where I will teach you how to connect railway and nextjs with the help of Prisma.
Nextjs Project (Frontend Framework)
Railway.app (This is for the database)
Prisma (I will tell you how to install it.) (ORM tool)
Step1: Make a railway.app project
Then make a postgress database.
Step2: Open your nextjs project.
Then open a terminal and write this command.
yarn add @prisma/client
Then you will find a new folder called **Prisma **in your root folder.
Then go to .env
Before changing anything in .env , go to
Then change this in your .env file.
Now you can see this tutorial:
Now you have two situations. Either you have tables or you don’t have any tables inside your database.
Just write the command
prisma db pull
Then check out the ‘schema.prisma’ file
prisma db push
For example, write this command in your ‘schema.prisma’ to make tables.
Now, you have to write the command
prisma migrate dev
Then it will ask you for your migration name.
You can write there anything you want.
Then you will see one folder as **Migrations **in your **Prisma **directory.
You can check your database and see the results.
Thanks for reading this blog.
If any question arises in your mind, feel free to ask here 👇
Join the Next Dev Discord Server!
If you want to see a video tutorial in Hindi: