https://github.com/k0kishima/golang-realworld-example-app
An implementation of the Realworld backend API using Golang.
https://github.com/k0kishima/golang-realworld-example-app
realworld realworld-backend realworld-example
Last synced: 5 months ago
JSON representation
An implementation of the Realworld backend API using Golang.
- Host: GitHub
- URL: https://github.com/k0kishima/golang-realworld-example-app
- Owner: k0kishima
- Created: 2024-03-04T11:44:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-17T10:23:08.000Z (almost 2 years ago)
- Last Synced: 2024-08-18T10:03:56.826Z (almost 2 years ago)
- Topics: realworld, realworld-backend, realworld-example
- Language: Go
- Homepage:
- Size: 470 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 
> ### Golang implementation of RealWorld app that adheres to the [RealWorld](https://github.com/gothinkster/realworld) spec and API.
### [Demo](https://github.com/gothinkster/realworld) [RealWorld](https://github.com/gothinkster/realworld)
This is a RealWorld example application built with Gin and the Ent framework. It demonstrates a backend implementation for a blogging platform with features such as articles, comments, tags, and user profiles.
You might also check out [the Frontend implementation in Nuxt3](https://github.com/k0kishima/nuxt3-realworld-example-app).
For more information on how to this works with other frontends/backends, head over to the [RealWorld](https://github.com/gothinkster/realworld) repo.
## Getting Started
### Prerequisites
- Docker and Docker Compose
- Go 1.16 or higher
### Setting Up the Development Environment
#### 1. Start the MySQL database container:
Use the provided `docker-compose.yml` file to start a MySQL container:
```bash
$ docker-compose up -d
```
This will create a new MySQL database named golang_realworld.
#### 2. Configure environment variables:
Copy the example environment file and edit it to match your local setup:
```bash
$ cp .env.example .env
$ vim .env
```
#### 3. Start the server:
Run the following command to start the server:
```bash
$ go run main.go
```
The server will automatically create the required database schema if the connection to the database is successful.
### Running Tests
To run the end-to-end tests, execute the following command:
```bash
$ make test-e2e
```