GoCommunityAPI is a backend API service for a community website. It provides various endpoints to manage users, articles, and comments. This service can be built and deployed using Docker Compose.
GET /api/user/:email
Retrieve a user's information by their email address.
POST /api/user/
Create a new user.
POST /api/user/login
Authenticate a user and generate an access token.
GET /api/article
Retrieve a list of articles by page.
GET /api/article/:id
Retrieve an article's information by its ID.
POST /api/article/
Upload a new article.
PUT /api/article/:id
Update an existing article by its ID.
DELETE /api/article/:id
Delete an existing article by its ID.
GET /api/comment/articleId/:articleId
Retrieve a list of all comments for a specific article.
POST /api/comment/
Upload a new comment for a specific article.
DELETE /api/comment/:id
Delete an existing comment by its ID.
To build and run this project, you will need to have Docker and Docker Compose installed on your machine.
- Clone this repository:
git clone <repository-url>
- Navigate to the project directory:
cd <project-directory>
- Start the Docker Compose services:
This will create the API service and a MYSQL database[root:12345@tcp(communitymysql:3306)].
docker-compose up
- Access the API endpoints via
http://localhost:3000
.
This README.md file provides an overview of the GoCommunityAPI service and its API endpoints. By following the Getting Started instructions, you can quickly build and run this service on your local machine.