You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Cosmo Router plugin for course management and enrollment. This plugin provides a GraphQL API for managing courses, instructors, and student enrollments using gRPC service implementation.
4
+
5
+
## Features
6
+
7
+
- Course creation and management
8
+
- Instructor course assignments
9
+
- In-memory data storage with mock data
10
+
11
+
## Testing
12
+
13
+
The tests validate all functionality of the plugin including:
14
+
15
+
- Course querying (all courses and by ID)
16
+
- User lookup by ID (instructors and students)
17
+
- Course creation
18
+
- Student enrollment in courses
19
+
20
+
### Running Tests
21
+
22
+
```bash
23
+
cd cosmo-router/plugins/courses
24
+
make test
25
+
```
26
+
27
+
## Directory Structure
28
+
29
+
```
30
+
courses/
31
+
├── bin/ # Compiled plugin binaries
32
+
├── generated/ # Auto-generated gRPC code from schema
33
+
│ ├── service.pb.js
34
+
│ ├── service_grpc_pb.js
35
+
│ └── service.proto
36
+
├── src/ # Source code
37
+
│ ├── plugin.ts # Plugin implementation
38
+
│ ├── plugin.test.ts # Integration tests
39
+
│ ├── plugin-server.ts # gRPC server setup
40
+
│ └── schema.graphql # GraphQL schema definition
41
+
└── package.json # Dependencies
42
+
```
43
+
44
+
## GraphQL API
45
+
46
+
### Queries
47
+
48
+
-`courses`: List all courses
49
+
-`course(id: ID!)`: Get a course by ID
50
+
51
+
### Mutations
52
+
53
+
-`createCourse(input: CourseInput!)`: Create a new course
54
+
-`enrollUser(userId: ID!, courseId: ID!)`: Enroll a user in a course
0 commit comments