Skip to content

Commit

Permalink
feat(build): add Makefile with seed command and update README for set…
Browse files Browse the repository at this point in the history
…up instructions
  • Loading branch information
batugkocak committed Jan 10, 2025
1 parent 73be773 commit 8e815e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.PHONY: seed

seed:
go build -o bin/seed cmd/migrate/seed/main.go
./bin/seed
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Social Media API
# Social-Go

A Go-based REST API for a social media platform with user management and post creation capabilities.
A simple social media backend application built with Go.

## Description
This project implements a basic social media backend with user management, posts, and interactions.

## Features

Expand All @@ -16,16 +19,15 @@ A Go-based REST API for a social media platform with user management and post cr
- Docker and Docker Compose
- [Goose](https://github.com/pressly/goose) for database migrations

## Getting Started

### 1. Clone the repository
## Setup

1. Clone the repository
```bash
git clone https://github.com/batugkocak/social-go.git
cd social-go
```

### 2. Environment Setup
2. Environment Setup

Create a `.env` file in the root directory:

Expand All @@ -38,15 +40,15 @@ DB_MAX_IDLE_CONNS=30
DB_MAX_IDLE_TIME=15min
```

### 3. Start Docker Services
3. Start Docker Services

```bash
docker-compose up -d
```

This will start the PostgreSQL database on port 5432.

### 4. Database Migrations
4. Database Migrations

Install Goose:

Expand All @@ -71,7 +73,12 @@ To create a new migration:
goose create name_of_your_migration sql
```

### 5. Run the Application
5. Seed the database (optional)
```bash
make seed
```

6. Run the Application

```bash
# Run directly
Expand Down

0 comments on commit 8e815e6

Please sign in to comment.