{"id":31693785,"url":"https://github.com/monkymars/pws","last_synced_at":"2026-05-14T20:31:02.179Z","repository":{"id":315041124,"uuid":"1057850470","full_name":"MonkyMars/PWS","owner":"MonkyMars","description":"PWS: een geoptimaliseerde elektronische leeromgeving voor leerlingen én docenten","archived":false,"fork":false,"pushed_at":"2025-10-01T11:46:20.000Z","size":450,"stargazers_count":1,"open_issues_count":16,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-01T13:24:34.609Z","etag":null,"topics":["elektronische-leeromgeving","fiber-go","go","golang","monolith","pws","react-router","school-project"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MonkyMars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T09:38:31.000Z","updated_at":"2025-10-01T11:46:22.000Z","dependencies_parsed_at":"2025-09-16T11:53:08.380Z","dependency_job_id":"4a4bd87a-1b40-4102-97b8-a88bcb18ef75","html_url":"https://github.com/MonkyMars/PWS","commit_stats":null,"previous_names":["monkymars/pws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MonkyMars/PWS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonkyMars%2FPWS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonkyMars%2FPWS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonkyMars%2FPWS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonkyMars%2FPWS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MonkyMars","download_url":"https://codeload.github.com/MonkyMars/PWS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonkyMars%2FPWS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278972328,"owners_count":26078017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elektronische-leeromgeving","fiber-go","go","golang","monolith","pws","react-router","school-project"],"created_at":"2025-10-08T15:53:14.699Z","updated_at":"2026-05-14T20:31:02.171Z","avatar_url":"https://github.com/MonkyMars.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PWS (Profiel werkstuk)\n\nA modern, full-stack web application built with Go backend and React frontend. The application features a robust API server with comprehensive response handling, configuration management, and a responsive user interface.\n\n## Architecture Overview\n\nPWS follows a monorepo structure with clearly separated frontend and backend applications:\n\n```\nPWS/\n├── apps/\n│   ├── server/          # Go backend API server\n│   │   ├── main.go      # Application entry point\n│   │   ├── api/         # API layer (routes, middleware, responses)\n│   │   ├── config/      # Configuration management\n│   │   ├── database/    # Database connection and models\n│   │   ├── lib/         # Helper functions\n│   │   ├── services/    # Business logic services\n│   │   └── types/       # Shared type definitions\n│   └── ui/              # React frontend application\n│       ├── app/         # React Router v7 application\n│       ├── public/      # Static assets\n│       └── build/       # Production build output\n├── LICENSE              # Project license\n└── README.md           # This documentation\n```\n\n## Technology Stack\n\n### Backend (Go Server)\n\n- **Go 1.25.0** - High-performance programming language\n- **Fiber v3.0.0-rc.1** - Express-inspired web framework\n- **slog** - Structured logging (Go standard library)\n- **goccy/go-json** - High-performance JSON encoding\n- **godotenv** - Environment variable management\n\n### Frontend (React UI)\n\n- **React 19** - Modern UI library with latest features\n- **React Router v7** - File-based routing with SSR support\n- **TypeScript** - Type safety and developer experience\n- **Tailwind CSS v4** - Utility-first CSS framework\n- **Vite** - Fast build tool and development server\n- **Bun** - Package manager and runtime\n\n## Quick Start\n\n### Prerequisites\n\n- **Go 1.25.0** - [Download Go](https://golang.org/dl/)\n- **Bun** (recommended) or **Node.js 18+** - [Install Bun](https://bun.sh/)\n- **Git** - For version control\n\n### Development Setup\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone git@github.com:MonkyMars/PWS.git\n   cd PWS\n   ```\n\n2. **Start the backend server**:\n\n   ```bash\n   cd apps/server\n\n   # Install dependencies\n   go mod tidy\n\n   # Copy environment configuration\n   cp .env.example .env\n\n   # Start development server\n   go run main.go\n   ```\n\n   The API server will be available at `http://localhost:8080`\n\n3. **Start the frontend application** (in a new terminal):\n\n   ```bash\n   cd apps/ui\n\n   # Install bun\n   npm install -g bun\n\n   # Install dependencies\n   bun install\n\n   # Start development server\n   bun run dev\n   ```\n\n   The UI will be available at `http://localhost:5173`\n\n### Production Build\n\n**Backend**:\n\n```bash\ncd apps/server\ngo build -o server main.go\n./server\n```\n\n**Frontend**:\n\n```bash\ncd apps/ui\nbun run build\nbun run start\n```\n\n## Application Components\n\n### Backend Architecture\n\n#### Configuration Management (`/config/`)\n\n- **Environment Variables**: Centralized loading and validation\n- **Logging Setup**: Structured logging configuration with slog\n- **Fiber Configuration**: Web server setup with optimized settings\n- **Singleton Pattern**: Thread-safe access to configuration\n\n#### Response Handling (`api/response/`)\n\n- **Standardized Responses**: Consistent API response format\n- **Builder Pattern**: Fluent API for response construction\n- **Error Handling**: Structured error responses with codes and details\n- **Pagination Support**: Built-in pagination for list endpoints\n\n#### Middleware (`api/middleware/`)\n\n- **CORS**: Cross-origin resource sharing configuration\n- **Extensible Design**: Easy addition of new middleware components\n- **Request/Response Processing**: Standardized middleware patterns\n\n#### Routes (`api/routes/`)\n\n- **RESTful Design**: Standard REST API patterns\n- **Route Organization**: Feature-based route grouping\n- **Handler Functions**: Clean separation of route logic\n\n#### Internal (`api/internal/`)\n\n- **Logic**: Contains all the business logic in an organized way\n- **Core**: The core of the server\n- **Health**: Clean health routes logic\n\n### Frontend Architecture\n\n#### Component Structure (`app/`)\n\n- **Root Layout**: Base HTML structure and global providers\n- **Route Components**: File-based routing with React Router v7\n- **Welcome Component**: Landing page with responsive design\n- **TypeScript Integration**: Full type safety throughout\n\n#### Styling (`app/app.css`)\n\n- **Tailwind CSS**: Utility-first styling approach\n- **Responsive Design**: Mobile-first breakpoints\n- **Component Styling**: Scoped styles with CSS modules support\n\n## API Reference\n\n### Response Format\n\nAll API endpoints return paginated responses in the following format:\n\n```json\n{\n  \"success\": true,\n  \"message\": \"Operation completed successfully\",\n  \"data\": {\n    // Response data\n  },\n  \"pagination\": {\n    \"page\": 1,\n    \"limit\": 10,\n    \"total\": 100,\n    \"pages\": 10\n  },\n  \"timestamp\": \"2024-01-15T10:30:00Z\"\n}\n```\n\n### Error Responses\n\n```json\n{\n  \"success\": false,\n  \"message\": \"Error description\",\n  \"error\": {\n    \"code\": \"ERROR_CODE\",\n    \"message\": \"Detailed error message\",\n    \"details\": {\n      // Additional error context\n    }\n  },\n  \"timestamp\": \"2024-01-15T10:30:00Z\"\n}\n```\n\n### Health Check Endpoints\n\nThese endpoints are only available in the development environment\n\n- `GET /health` - Basic server health check\n- `GET /health/database` - Ping the database and check for errors\n\n## Development Guidelines\n\n### Backend Development\n\n1. **Follow Go Conventions**: Use standard Go naming and structure conventions\n2. **Document Public APIs**: Include Go doc comments for all exported functions\n3. **Handle Errors Properly**: Use structured error responses with context\n4. **Write Tests**: Comprehensive test coverage for business logic\n5. **Use Structured Logging**: Include relevant context in all log messages\n\nExample handler function:\n\n```go\n// GetUsers retrieves a paginated list of users\nfunc GetUsers(c *fiber.Ctx) error {\n    users, total, err := userService.GetUsers(c.Context())\n    if err != nil {\n        return response.Error(c).\n            Message(\"Failed to retrieve users\").\n            Code(\"USER_FETCH_ERROR\").\n            Details(err.Error()).\n            Send()\n    }\n\n    return response.Success(c).\n        Message(\"Users retrieved successfully\").\n        Data(users).\n        Pagination(1, 10, total).\n        Send()\n    }\n```\n\n### Code Quality\n\n- **Go**: Use `go fmt`, `go vet`, `golangci-lint` and `gosec`:)\n- **TypeScript**: Use Prettier and ESLint for code formatting\n- **Testing**: Maintain test coverage above 80%\n- **Documentation**: Update README files for package changes\n\n## License\n\nThis project is licensed under the terms specified in the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkymars%2Fpws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkymars%2Fpws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkymars%2Fpws/lists"}