POST /memberships/sign-up- Register new userPOST /memberships/login- User loginPOST /memberships/logout- Logout userPOST /memberships/refresh-token- Refresh access token
GET /posts- Get paginated list of postsPOST /posts/create- Create new postGET /posts/:postID- Get post detailsPOST /posts/comment/:postID- Add comment to postPUT /posts/user_activity/:postID- Like/unlike post
The application uses a YAML configuration file located at internal/configs/config.yaml. Configurable settings include:
- Service port
- Database connection
- JWT secret key
- Logging settings
Example configuration:
service:
port: ":9876"
secretJWT: "yoursecret"
database:
dataSourceName: "<username>:<password>@tcp(<host>:<port>)/<dbname>?parseTime=true"- Go 1.23.2 or higher
- MySQL
- Make (for running migration commands)
Create new migration:
make migrate-create name=migration_nameApply migrations:
make migrate-upRollback migrations:
make migrate-downThe project follows a clean architecture pattern with the following layers:
- Handlers (HTTP request handling)
- Services (Business logic)
- Repositories (Data access)
- Models (Data structures)
- JWT-based authentication
- Password hashing using bcrypt
- Refresh token mechanism for session management
- Middleware for protected routes