Skip to content

Commit

Permalink
updated articles-app/README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarMaheshwary committed Dec 17, 2023
1 parent 431db30 commit 0346189
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions articles-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ go get github.com/gofor-little/env

### TABLES

Create tables that are required for this application:

```sql
CREATE TABLE users_1 (
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
Expand All @@ -30,7 +32,7 @@ CREATE TABLE users_1 (
```

```sql
CREATE TABLE articles_1 (
CREATE TABLE articles (
id BIGSERIAL PRIMARY KEY,
slug VARCHAR(120) NOT NULL UNIQUE,
title VARCHAR(120) NOT NULL,
Expand All @@ -42,8 +44,13 @@ CREATE TABLE articles_1 (
);
```

NOTE: we are not using the users table but it's built in a way that we can easily add user authentication in this app.

### RUNNING THE APPLICATION

Create a **.env** from **.env.example** in the project directory and add your database credentials.
Start the application with **go run** command:

```bash
go run main.go
```

0 comments on commit 0346189

Please sign in to comment.