Compare commits
2 commits
fe480828f4
...
f60a6f1204
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f60a6f1204 | ||
|
|
dac9a26a3a |
3 changed files with 60 additions and 0 deletions
5
.env
Normal file
5
.env
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
WRSR_DATABASE_NAME="wsrs"
|
||||
WRSR_DATABASE_USER="postgres"
|
||||
WRSR_DATABASE_PASSWORD="123456789"
|
||||
WRSR_DATABASE_PORT=5432
|
||||
WRSR_DATABASE_HOST="localhost"
|
||||
24
README.md
Normal file
24
README.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Introduction
|
||||
|
||||
This project aims to create a AMA style page using `react` on frontend and `go` on backend.
|
||||
|
||||
## Initialize project
|
||||
|
||||
```bash
|
||||
$ go mod init forgejo.home.viniciussouza.me/learning/go-react-server
|
||||
```
|
||||
|
||||
## Database migrations
|
||||
|
||||
### Installing tern
|
||||
|
||||
```bash
|
||||
$ go install github.com/jackc/tern/v2@latest
|
||||
```
|
||||
|
||||
### Creating migrations
|
||||
|
||||
```bash
|
||||
$ tern new --migrations ./internal/store/pgstore/migrations create_rooms_table
|
||||
$ tern new --migrations ./internal/store/pgstore/migrations create_messages_table
|
||||
```
|
||||
31
compose.yml
Normal file
31
compose.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
services:
|
||||
db:
|
||||
image: postgres:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- ${WRSR_DATABASE_PORT:-5432}:5432
|
||||
environment:
|
||||
POSTGRES_USER: ${WRSR_DATABASE_USER}
|
||||
POSTGRES_PASSWORD: ${WRSR_DATABASE_PASSWORD}
|
||||
POSTGRES_DB: ${WRSR_DATABASE_NAME}
|
||||
volumes:
|
||||
- db:/var/lib/postgresql/data
|
||||
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:latest
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- 8081:80
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: admin@admin.com
|
||||
PGADMIN_DEFAULT_PASSWORD: password
|
||||
volumes:
|
||||
- pgadmin:/var/lib/pgadmin
|
||||
|
||||
volumes:
|
||||
db:
|
||||
driver: local
|
||||
pgadmin:
|
||||
driver: local
|
||||
Loading…
Reference in a new issue