{"id":20972423,"url":"https://github.com/roodbaraky/examgenie-be","last_synced_at":"2026-04-13T03:01:41.716Z","repository":{"id":251769005,"uuid":"836280570","full_name":"Roodbaraky/ExamGenie-be","owner":"Roodbaraky","description":"An exam preparation tool built using TypeScript, NodeJS, ExpressJS and React which allows users to query a bank of past exam questions and generate custom learning materials relevant to the required skill level, subject and position in the academic year.","archived":false,"fork":false,"pushed_at":"2024-11-27T20:31:58.000Z","size":12660,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T05:02:04.236Z","etag":null,"topics":["expressjs","nodejs","postgresql","supabase","supabase-auth","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Roodbaraky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-07-31T14:11:49.000Z","updated_at":"2024-11-27T20:34:07.000Z","dependencies_parsed_at":"2024-09-14T23:50:35.742Z","dependency_job_id":null,"html_url":"https://github.com/Roodbaraky/ExamGenie-be","commit_stats":null,"previous_names":["roodbaraky/examgenie-be"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roodbaraky%2FExamGenie-be","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roodbaraky%2FExamGenie-be/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roodbaraky%2FExamGenie-be/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roodbaraky%2FExamGenie-be/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Roodbaraky","download_url":"https://codeload.github.com/Roodbaraky/ExamGenie-be/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243368075,"owners_count":20279724,"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","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":["expressjs","nodejs","postgresql","supabase","supabase-auth","typescript"],"created_at":"2024-11-19T04:08:05.735Z","updated_at":"2026-04-13T03:01:41.632Z","avatar_url":"https://github.com/Roodbaraky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExamGenie API\n\n## Overview\n\nThis project is a backend API for a ExamGenie, a learning aid for generating bespoke revision materials specific to a scheme of work. It provides endpoints for managing questions, schemes of work (SoW), classes, and tags. The API is built with Express.js and TypeScript, using Supabase / PostgreSQL as the database.\n\n## Features\n\n- Question management (CRUD operations)\n- Scheme of Work (SoW) management\n- Class management\n- Tag management\n- User authentication and authorization\n- Error handling middleware\n\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js (v14 or later)\n- npm\n- Supabase account and project\n\n### Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/Roodbaraky/ExamGenie-be\n   cd ExamGenie-be\n   ```\n\n2. Install dependencies:\n   ```\n   npm install\n   ```\n\n3. Set up environment variables:\n   Create a `.env` file in the root directory and add the following:\n   ```\n   SUPABASE_URL=your_supabase_project_url\n   SUPABASE_KEY=your_supabase_anon_key\n   SUPABASE_SERVICE_KEY=your_supabase_service_key\n   PORT=3000\n   ```\n\n4. Start the development server:\n   ```\n   npm run dev\n   ```\n\n## API Documentation\n\n\u003c!--  --\u003e\n\n## Project Structure\n\n- `src/`: Source code\n  - `controllers/`: Request handlers\n  - `models/`: Data models and database operations\n  - `middleware/`: Custom middleware (error handling, authentication)\n  - `types/`: TypeScript type definitions\n  - `utils/`: Utility functions\n  - `database/`: Database client and seed data\n- `__tests__/`: Test files\n\n## Main Endpoints\n\n- `/questions`: Manage questions\n- `/sow`: Manage Schemes of Work\n- `/classes`: Manage classes\n- `/tags`: Manage tags\n- `/weeks`: Get weeks for a class\n\n## Authentication\n\nThe API uses JWT for authentication. Include the JWT token in the Authorization header for protected routes.\n\n## Error Handling\n\nThe API includes centralized error handling middleware that provides consistent error responses with appropriate HTTP status codes.\n\n## Testing\n\nAt the moment, tests are incomplete. Please refrain from running the existing tests as they will cause the database and storage buckets to be wiped clean, resulting in a loss of uploaded data.\n\n## \n\n## A note to the next dev\n\nThis project was developed as a rapid prototype to present the concept to the exam board. It is not built with inherent scalability in mind, but I am more than happy to work with you to get it there.\n\nI have included a Postgres dump file \"\"\"database_dump.sql\"\"\", as I understand, this can be imported to reproduce and populate the tables according to the schema in Supabase, but if there are any issues I'm happy to migrate the Supabase project to your organisation. This may be necessary for the storage buckets which hold question and answer data, I am unsure.\n\nSome aims I have for the project in the future, which you can treat as suggestions:\n- I believe this back-end repo is mostly replacable with database functions, which you can use the Supabase client to invoke via *.rpc()*. It may actually be possible to have this be a standalone front-end application and use Supabase's REST API to fill in the gaps where postgres functions don't cut it.\n- The previous allows you to mitigate latency / costs from hosting the API separately, which was and continues to be an issue for me.\n- Rebuild this with OOP. Currently, it's very loosely built with functional programming and I undoubtedly violate these principles throughout. As I learn more about OOP in Java, I see how much better I could have structured my methods for unit testing, and integration testing without side-effects - I had real trouble mocking the Supabase client using Jest, what worked for some tests seemed to make real calls to the database in others.\n- Rebuild with / retrofit TDD: I raced to complete this as a prototype and with the little testing I did do, I noticed glaring refactoring opportunities which improved the code dramatically. I think the result would be much more performant and much fewer lines of much more readable code.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froodbaraky%2Fexamgenie-be","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froodbaraky%2Fexamgenie-be","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froodbaraky%2Fexamgenie-be/lists"}