GO Rest API (Documentation)
This is a documentation Go-lang article API based on project Workshop WAOW Tel-U Surabaya.
Find Repositories here :
System Flow
Authentication Layer
The system uses a JWT-based authentication flow. All users must authenticate through the /auth endpoints :
- New users register via /auth/register
- Existing users authenticate via /auth/login
- Admin registration is handled separately via /auth/admin/register
Regular User Access
This is handled by AuthMiddleware() through /api routes. Regular users can :
- View all categories and individual category details
- View all articles and individual article details
- Create new articles linked to their user account
- Edit and delete only their own articles
Admin Access
Admin routes protected by AuthMiddleware() and AdminMiddleware() to ensure dual verification of authentication and authorization. Administrators privileges :
- Full CRUD operations on categories (create, read, update, delete)
- Full CRUD operations on all articles regardless of author
- Full user management capabilities (view, create, update, delete)

Database Design
Consists of 3 table; user, category, and article. User-to-Article relationship are One-to-Many, and Categories-to-Article are also One-to-Many
