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.
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.
- 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.
.
├── 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
- Go (version 1.23.0 or higher)
- Docker (for containerized setup)
- PostgreSQL (or other supported database)
-
Clone the repository:
git clone https://github.com/mateus-dev-me/ama-api.git cd ama-api
-
Set environment variables:
Create a .env
file based on the .env.example
file and set your credentials and database parameters.
-
Install dependencies:
go mod tidy
-
Perform database migrations:
go generate
go run ./cmd/app/main.go
The API will be available at http://localhost:8080/api
The documentation file is at ./internal/api/spec/swagger.json
- Fork the project.
- Create a branch for your feature (git checkout -b feature/nova-feature).
- Commit your changes (git commit -m 'Add new feature').
- Push your branch to the remote repository (git push origin feature/nova-feature).
- Open a Pull Request.