https://github.com/mateus-dev-me/go-ama-api
A question and answer API, similar to an AMA system.
https://github.com/mateus-dev-me/go-ama-api
go postgresql rest-api
Last synced: about 2 months ago
JSON representation
A question and answer API, similar to an AMA system.
- Host: GitHub
- URL: https://github.com/mateus-dev-me/go-ama-api
- Owner: mateus-dev-me
- Created: 2024-08-13T02:28:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T20:15:00.000Z (almost 2 years ago)
- Last Synced: 2026-01-12T05:26:11.813Z (6 months ago)
- Topics: go, postgresql, rest-api
- Language: Go
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **AMA API**
 
> A REST API developed in Golang for managing questions and answers, similar to an AMA (Ask Me Anything) system. The API allows users to ask questions and have those questions answered by administrators.
## **Index**
1. [Project Overview](#project-overview)
2. [Project Structure](#project-structure)
3. [Installation](#installation)
4. [Usage](#usage)
5. [API Documentation](#api-documentation)
6. [Contribution](#contribution)
## **Project Overview**
This project aims to provide a platform where users can ask questions and get answers. It is ideal for scenarios where audience interaction is valued, such as Q&A sessions, discussion forums, or online communities.
### **Main Features:**
- User registration and authentication.
- Creation, reading, updating and deletion (CRUD) of questions and answers.
- Filtering and searching questions by tags and categories.
- Moderation of questions and answers.
## **Project Structure**
```bash
.
├── internal
│ ├── api
│ │ ├── spec
│ │ │ └── swagger.json
│ │ ├── utils.go
│ │ └── api.go
│ └── store
│ └── pgstore
│ ├── models.go
│ ├── queries
│ │ └── queries.sql
│ ├── queries.sql.go
│ ├── migrations
│ │ ├── tern.conf
│ │ ├── 002_create_messages_table.sql
│ │ └── 001_create_rooms_table.sql
│ ├── sqlc.yaml
│ └── db.go
├── docs
│ ├── 01.jpg
│ ├── 02.jpg
│ └── 03.jpg
├── cmd
│ ├── tools
│ │ └── terndotenv
│ │ └── main.go
│ └── app
│ └── main.go
├── gen.go
├── go.mod
├── go.sum
├── Dockerfile.yml
├── compose.yml
├── .env.example.yml
└── README.md
```
## **Installation**
### **Prerequisites:**
- **Go** (version 1.23.0 or higher)
- **Docker** (for containerized setup)
- **PostgreSQL** (or other supported database)
### **Installation Steps:**
1. Clone the repository:
```bash
git clone https://github.com/mateus-dev-me/ama-api.git
cd ama-api
```
2. Set environment variables:
Create a `.env` file based on the `.env.example` file and set your credentials and database parameters.
3. Install dependencies:
```bash
go mod tidy
```
4. Perform database migrations:
```bash
go generate
```
## **Usage**
### **Start Server:**
```bash
go run ./cmd/app/main.go
```
The API will be available at `http://localhost:8080/api`
## API Documentation
The documentation file is at `./internal/api/spec/swagger.json`



## **Contribution**
1. Fork the project.
2. Create a branch for your feature (git checkout -b feature/nova-feature).
3. Commit your changes (git commit -m 'Add new feature').
4. Push your branch to the remote repository (git push origin feature/nova-feature).
5. Open a Pull Request.