|
1 | | -# Timetable Manager Frontend |
| 1 | +# Timetable Manager |
2 | 2 |
|
3 | | -## Pre-requisites |
| 3 | +Timetable Manager is a web application designed to help educational institutions create, manage, and view timetables efficiently. |
4 | 4 |
|
5 | | -- Bunjs https://bun.sh/ |
6 | | -- Sanity |
7 | | -- Common Sense |
8 | | -- A good sense of humour |
9 | | -- A brain |
| 5 | +## Features |
10 | 6 |
|
11 | | -## Installation |
| 7 | +* **Timetable Generation**: Dynamically generate timetables based on various inputs. |
| 8 | +* **Multiple Timetable Views**: View timetables by Division, Teacher, or Classroom. |
| 9 | +* **Slot Management**: Add, update, and delete individual slots in the timetable. |
| 10 | +* **Data Management**: Manage related data such as subjects, teachers, classrooms, batches, and subdivisions. |
| 11 | +* **PDF Export**: Export timetables to PDF format for easy sharing and printing. |
| 12 | +* **Interactive UI**: User-friendly interface for easy navigation and timetable manipulation. |
| 13 | +* **Responsive Design**: Adapts to different screen sizes. |
12 | 14 |
|
13 | | -1. Unzip the folder |
14 | | -2. Open the folder in the IDE of your choice |
15 | | -3. Open a terminal and run `bun install` |
16 | | -4. Run `bun dev` to start the development server |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +* [Bunjs](https://bun.sh/) |
| 18 | +* [MariaDB](https://mariadb.org/) |
| 19 | + |
| 20 | +## Getting Started |
| 21 | + |
| 22 | +### Cloning the Repository |
| 23 | + |
| 24 | +```bash |
| 25 | +git clone https://github.com/MatricalDefunkt/timetable-manager |
| 26 | +cd timetable-manager |
| 27 | +``` |
| 28 | + |
| 29 | +### Installation |
| 30 | + |
| 31 | +1. Open the project folder in your IDE. |
| 32 | +2. Open a terminal and run: |
| 33 | + ```bash |
| 34 | + bun install |
| 35 | + ``` |
| 36 | + |
| 37 | +### Running the Development Server |
| 38 | + |
| 39 | +To start the development server, run: |
| 40 | + |
| 41 | +```bash |
| 42 | +bun dev |
| 43 | +``` |
| 44 | +This will start the frontend on `http://localhost:5173` and the backend server using PM2, or attempt to install pm2 if it does not already exist. |
| 45 | + |
| 46 | +## Project Structure |
| 47 | + |
| 48 | +The project is organized into two main parts: |
| 49 | + |
| 50 | +* `src/frontend/`: Contains the React-based user interface, built with TypeScript and Vite. |
| 51 | + * `Components/`: Reusable UI components. |
| 52 | + * `Pages/`: Top-level page components. |
| 53 | + * `context/`: React context for state management. |
| 54 | +* `utils/`: Utility functions and type definitions. |
| 55 | +* `src/backend/`: Contains the BunJS and ElysiaJS based API. |
| 56 | + * `controllers/`: Logic for handling API requests. |
| 57 | + * `api/routes/`: Defines the API routes. |
| 58 | + * `database/`: Models and database interaction logic. |
| 59 | +* `SAMPLE_DATA/`: Contains CSV files for sample data. |
| 60 | +* `public/`: Static assets. |
| 61 | +* `.env`: Environment variable configuration (ensure you have this set up locally, it's not committed to git). |
| 62 | +
|
| 63 | +## Technologies Used |
| 64 | +
|
| 65 | +* **Frontend**: |
| 66 | + * React |
| 67 | + * TypeScript |
| 68 | + * Vite |
| 69 | + * Material-UI (MUI) |
| 70 | +* **Backend**: |
| 71 | + * BunJS |
| 72 | + * ElysiaJS |
| 73 | + * TypeScript |
| 74 | +* **Runtime**: |
| 75 | + * Bun |
| 76 | +* **Database**: |
| 77 | + * MariaDB Server. |
| 78 | +
|
| 79 | +## API Endpoints |
| 80 | +
|
| 81 | +The backend API is served from `http://localhost:3000`. The following are some of the main endpoints available in the [OpenAPI specification](src/backend/openapi.yaml): |
| 82 | +
|
| 83 | +**Data Retrieval (Getters):** *(See [getTables.ts](src/backend/api/routes/getTables.ts))* |
| 84 | +
|
| 85 | +* `GET /academicYears`: Get all academic years. |
| 86 | + * `GET /departments/:id/subjects`: Get subjects by department. |
| 87 | + * *(Parameters: `departmentId`)* |
| 88 | + * `GET /academicYears/:id/classrooms`: Get all classrooms by academic year. |
| 89 | + * *(Parameters: `academicYearId`)* |
| 90 | + * `GET /academicYears/:id/teachers`: Get all teachers by academic year. |
| 91 | + * *(Parameters: `academicYearId`)* |
| 92 | + * `GET /subject/:id/teachers`: Get teachers for a specific subject. |
| 93 | + * *(Parameters: `subjectId`)* |
| 94 | + * `GET /academicYears/:id/batches`: Get all batches by academic year. |
| 95 | + * *(Parameters: `academicYearId`)* |
| 96 | + * `GET /departments/:id/divisions`: Get all divisions by department. |
| 97 | + * *(Parameters: `departmentId`)* |
| 98 | + * `GET /batches/:id/departments`: Get all departments by batch. |
| 99 | + * *(Parameters: `batchId`)* |
| 100 | + |
| 101 | +**Timetable Viewing:** |
| 102 | +
|
| 103 | +* `GET /subdivisions/:id/timetable`: Get timetable for a subdivision. |
| 104 | + * *(Parameters: `subdivisionId`)* |
| 105 | +* `GET /divisions/:id/timetable`: Get timetable for a division. |
| 106 | + * *(Parameters: `divisionId`)* |
| 107 | +* `GET /teachers/:id/timetable`: Get timetable for a teacher. |
| 108 | + * *(Parameters: `teacherId`)* |
| 109 | +* `GET /classrooms/:id/timetable`: Get timetable for a classroom. |
| 110 | + * *(Parameters: `classroomId`)* |
| 111 | +
|
| 112 | +**Availability Checks:** |
| 113 | +
|
| 114 | +* `GET /available/teachers`: Get available teachers for a given slot and subject. |
| 115 | + * *(Parameters: `subjectId`, `slotId`)* |
| 116 | + * *(Controller logic likely in [`getAvailableTeachers`](src/backend/controllers/index.ts) and routed via `available.ts`)* |
| 117 | +* `GET /available/classrooms`: Get available classrooms for a given slot and subject. |
| 118 | + * *(Parameters: `subjectId`, `slotId`)* |
| 119 | + * *(Controller logic likely in [`getAvailableClassrooms`](src/backend/controllers/index.ts) and routed via `available.ts`)* |
| 120 | +* `GET /available/subdivisions`: Fetch available subdivisions. *(This was in the previous README, check `available.ts` or `openapi.yaml` for confirmation and parameters)* |
| 121 | + * *(Controller logic might be in [`getAvailableSubdivisions`](src/backend/controllers/index.ts))* |
| 122 | +
|
| 123 | +
|
| 124 | +**Timetable Slot Management (Editing):** |
| 125 | +*(These are inferred from `editing.ts` and previous README structure; paths might vary slightly. Check `editing.ts` routes for exact paths)* |
| 126 | +
|
| 127 | +* `POST /slotDatas/update`: Add data to a timetable slot. |
| 128 | + * *(Controller: [`addSlotData`](src/backend/controllers/index.ts), routed via `editing.ts`)* |
| 129 | +* `PUT /slotDatas/:id`: Update data for an existing timetable slot. |
| 130 | + * *(Controller: [`updateSlotData`](src/backend/controllers/index.ts), routed via `editing.ts`)* |
| 131 | +* `DELETE /slotDatas/:id`: Delete data from a timetable slot. |
| 132 | + * *(Controller: [`deleteSlotData`](src/backend/controllers/index.ts), routed via `editing.ts`)* |
| 133 | +
|
| 134 | +**Data Management & Generation:** |
| 135 | +
|
| 136 | +* Endpoints for **CSV data upload** are available, routed via `addCsv.ts`. |
| 137 | + * *(Refer to [addCsv.ts](src/backend/api/routes/addCsv.ts))* |
| 138 | +* Endpoints for **[timetable generation](https://github.com/pranav-suri/timetable-generator)** are available, routed via `generate.ts`. |
| 139 | + * *(Refer to [generate.ts](src/backend/api/routes/generate.ts))* |
0 commit comments