This repo is a clone of Ben Awad's lireddit app that he built during his 14h tutorial on Youtube.
However, this version uses Prisma instead of TypeORM for database access.
git clone git@github.com:nikolasburk/lireddit.git
cd lireddit
To set up the server, you need to install the npm dependencies and configure your environment variables.
cd server
npm install
Open .env
and adjust the environment variables to match the setup on your own machine.
This project uses PostgreSQL as a database and assumes that you already have a PostgreSQL database server running. If you don't have a PostgreSQL database server running right now, you can use SQLite instead (expand below for setup instructions).
To create your database tables, you can use Prisma Migrate via the following commands:
npx prisma migrate save --create-db --name "init" --experimental
npx prisma migrate up --experimental
Expand if you don't have a PostgreSQL database server
You can use SQLite instead of PostgreSQL for a faster setup. To do so, open the server/prisma/schema.prisma
file and adjust the datasource
configuration to look as follows:
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
Now you can run the same commands and a new SQLite database file will be created for you:
npx prisma migrate save --create-db --name "init" --experimental
npx prisma migrate up --experimental
npx prisma generate
npm run dev2
To start the app, you have to navigate into the web
directory, install dependencies and run the app.
cd ../web
npm install
npm run dev
You can use the app at http://localhost:3000.