The powerful backend powering the WorkOps system. A clear, performant, and RESTful API offering comprehensive employee management capabilities.
- Overview
- Features
- Tech Stack
- Getting Started
- Project Structure
- API Endpoints
- Frontend
- License
- Author
The WorkOps API handles all business logic, data persistence, and authentication for the platform. It provides a secure and scalable foundation for managing associates, departments, tasks, and social interactions.
Key Capabilities:
- 🔐 Robust Authentication: Secure session management and JWT handling.
- 👥 Associate Management: CRUD operations for employee data.
- ⚙️ Process Automation: Workflows for tasks, approvals, and time-off requests.
- ❤️ Social Graph: Managing "Give Thanks" posts, likes, and comments.
- 📊 Analytics Data: Serving aggregated data for frontend dashboards.
- Associates: Create, read, update, delete functionality for employee records.
- Offices & Departments: Management of organizational structure entities.
- Hierarchy Awareness: Logic to understand reporting lines and team structures.
- Task Management: Endpoints for creating and processing approval tasks (e.g., salary increases).
- Time Off: Managing vacation and leave requests with approval status flow.
- Document Categories: Taxonomy management for employee documents.
- Thanks Feed: CRUD for recognition posts.
- Interactions: Toggling likes and managing threaded comments on posts.
- Menu Permissions: Granular control over UI element visibility.
- System Settings: Global configuration endpoints (e.g., default password).
- Go (Golang) 1.24 - Performant, statically typed system language.
- Chi Router - Lightweight, idiomatic, and composable router config.
- MySQL Driver - Robust database connectivity.
- Standard Lib - Heavy use of Go's powerful standard library (
net/http,database/sql).
- MySQL - Relational database for structured data storage.
- Go 1.24+
- Docker & Docker Compose
- MySQL instance (local or containerized)
-
Clone the repository
git clone <repository-url>
-
Environment Variables The application expects a database connection string. By default (in Docker), this is handled via
DSN. -
Run Locally (Requires running MySQL)
go run cmd/api/main.go
The server will start on port
8081.
The recommended way to run the API is via Docker Compose from the project root:
# From project root
docker compose up --build -d apiapi/
├── cmd/
│ └── api/ # Application entrypoint
│ ├── main.go # Server initialization
│ ├── routes.go # Route definitions
│ ├── handlers.go # Request handlers (Controllers)
│ └── middleware.go # HTTP middleware (CORS, Auth)
├── internal/
│ └── data/ # Data access layer (Models)
│ ├── models.go # Model definitions
│ └── *.go # Database operations
├── db/ # Database schemas and migrations
│ └── init.sql # Initial seeding script
├── go.mod # Module definition
└── Dockerfile # Container definition
POST /login- Authenticate userPOST /register- Register a new account
GET /associates- List all associatesPOST /associates- Create new associateGET /associates/{id}- Get specific associatePUT /associates/{id}- Update associate detailsPUT /associates/{id}/password- Change password
GET /thanks- Get recognition feedPOST /thanks- Create recognition postPOST /thanks/{id}/like- Like a postPOST /thanks/{id}/comment- Comment on a post
...and many more for Tasks, Time Off, Offices, etc.
- Frontend: WorkOps Frontend
This project is licensed under the MIT License - see the LICENSE file for details.
Richie Zhou
- GitHub: @arunike