Follow the below steps to run the app locally:
Clone the repository by running git clone git@github.com:moaqz/hackernews.git
.
Copy the .env.example
file to .env
by running cp .env.example .env
and update the credentials in the .env
file.
Install the dependencies by running pnpm install
.
Generate a migration with pnpm db:generate
. This creates a new folder called migrations
which contains the SQL queries to create the database tables.
Push the migration with pnpm db:up
. If this fails (or nothing happens) and your database isn't updated with all the tables, run the SQL queries that were generated in the migrations
folder from the previous step manually.
If you are not using the default port to run a Redis database, go to the src/lib/redis.js
file and uncomment the section of code that includes the environment variable.
Run the development server by running pnpm dev
.
Open http://localhost:5173/ with your browser to see the result.