An open API service indexing awesome lists of open source software.

https://github.com/jmcamposdev/integralprojectizv

Zawee Web Application for managing an Institute with Teachers, Training Levels, Modules, Groups and Lessons
https://github.com/jmcamposdev/integralprojectizv

api-rest expressjs jwt jwt-token mysql nodejs reactjs reacttable tailwindcss

Last synced: 5 months ago
JSON representation

Zawee Web Application for managing an Institute with Teachers, Training Levels, Modules, Groups and Lessons

Awesome Lists containing this project

README

          

# Work inter-modules (Zawee)

https://github.com/jmcamposdev/integralProjectIZV/assets/108521775/7b52f263-2408-49f0-9352-1c03699547da

## Project Link 🌐
Access to the website here -> [Zawee](https://zawee.jmcampos.dev)

## Table of Contents
* [General Info](#general-info)
* [Technologies](#technologies)
* [Setup](#setup)
* [Project Structure](#project-structure)
* [RESTful API](#restful-api)
* [Key Features](#key-features)

## General Info
The Inter-module Project was carried out during the last 2 months of class before the FCT.

The project consists of the **Lesson Assignment to Professors of the Department**. It will also implement roles and we will have 3 types
* Administrator: Can perform any operation on the tables.
* Registered User: Can consult all the data without making modifications.
* Unregistered User: Can consult the group structure of the current course.

### Entity Relationship Diagram
![Integral Project IZV Diagram](https://github.com/jmcamposdev/integralProjectIZV/assets/108521775/d994cb94-a544-4aef-823d-b2aea052a847)

## Technologies

Project is created with:




FRONTEND





BACKEND





TOOLS






HTML
CSS
Tailwind CSS
JavaScript
React
Vite
Babel


Node.js
Express
MySQL


REST
Git
GitHub
npm
Postman

## Setup

### Prerequisites
1. Node.js and npm installed
2. MySQL installed and configured

### Steps to Start the Application
To clone and run this applicaion, you'll need [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/en/download) (which comes with [npm](https://www.npmjs.com/)) installed on you computer.

Next you'll need to create the ```eduAssignment``` database created

```
# Clone this repository
$ git clone https://github.com/jmcamposdev/integralProjectIZV.git

# Go into the repository
$ cd integralProjectIZV

# Install dependencies on the Server and Client
$ cd client && npm i
$ cd ../server && npm i

# Run the app
$ npm run dev // On the Client and Server
```

## Project Structure

```bash
integralProjectIZV/
β”‚
β”œβ”€β”€ client/
β”‚ β”œβ”€β”€ public/
β”‚ β”‚ └── ... (React public files)
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ components/
β”‚ β”‚ β”‚ └── ... (React components)
β”‚ β”‚ β”œβ”€β”€ pages/
β”‚ β”‚ β”‚ └── ... (React pages)
β”‚ β”‚ β”œβ”€β”€ App.js
β”‚ β”‚ └── index.js
β”‚ β”‚
β”‚ β”œβ”€β”€ .gitignore
β”‚ β”œβ”€β”€ package.json
β”‚ └── README.md
β”‚
β”œβ”€β”€ server/
β”‚ β”œβ”€β”€ controllers/
β”‚ β”‚ └── ... (Node.js controllers)
β”‚ β”œβ”€β”€ models/
β”‚ β”‚ └── ... (Database models)
β”‚ β”œβ”€β”€ routes/
β”‚ β”‚ └── ... (Express routes)
β”‚ β”œβ”€β”€ index.js
β”‚ β”‚
β”‚ β”œβ”€β”€ .gitignore
β”‚ β”œβ”€β”€ package.json
β”‚ └── README.md
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
└── ...
```

## RESTful API
Welcome to the Integral Project RESTful API. This API provides access to the management of all available resources.

### Base URL
The API can be accessed through the following base URL:
[https://api.zawee.jmcampos.dev](https://api.zawee.jmcampos.dev)

### Authentication

To access certain resources, authentication is required. Be sure to include the `x-access-token` header with a valid token in the relevant requests.

### Endpoints

#### Auth
- `POST /auth/signin`: Sign in a user. Returns a `JSON` object with the user's data and a token. Requires a `JSON` object with the user's data.

#### User
- `GET /users`: Get all users. Returns a `JSON` array of all users. `x-access-token` header required.
- `GET /users/:id`: Get a user by ID. Returns a `JSON` object with the user's data. `x-access-token` header required.
- `POST /users`: Create a new user. Returns a `JSON` object with the new user's data. Requires a `JSON` object with the user's data. `x-access-token` header required.
- `PUT /users/:senecaUser`: Update a user by ID. Returns a `JSON` object with the updated user's data. Requires a `JSON` object with the user's data. `x-access-token` header required.
- `DELETE /users/:id`: Delete a user by ID. Returns a `JSON` object with the deleted user's data. `x-access-token` header required.

#### Professor
- `GET /professors`: Get all professors. Returns a `JSON` array of all professors.
- `GET /professors/:id`: Get a professor by ID. Returns a `JSON` object with the professor's data.
- `GET /professors/:id/lessons`: Get all lessons assigned to a professor by ID. Returns a `JSON` array of all lessons.
- `POST /professors`: Create a new professor. Returns a `JSON` object with the new professor's data. Requires a `JSON` object with the professor's data. `x-access-token` header required.
- `PUT /professors/:id`: Update a professor by ID. Returns a `JSON` object with the updated professor's data. Requires a `JSON` object with the professor's data. `x-access-token` header required.
- `DELETE /professors/:id`: Delete a professor by ID. Returns a `JSON` object with the deleted professor's data. `x-access-token` header required.

#### Formation
- `GET /formations`: Get all formations. Returns a `JSON` array of all formations.
- `GET /formations/:id`: Get a formation by ID. Returns a `JSON` object with the formation's data.
- `GET /formations/:id/groups`: Get all groups of a formation by ID. Returns a `JSON` array of all groups.
- `GET /formations/:id/modules`: Get all modules of a formation by ID. Returns a `JSON` array of all modules.
- `POST /formations`: Create a new formation. Returns a `JSON` object with the new formation's data. Requires a `JSON` object with the formation's data. `x-access-token` header required.
- `PUT /formations/:id`: Update a formation by ID. Returns a `JSON` object with the updated formation's data. Requires a `JSON` object with the formation's data. `x-access-token` header required.
- `DELETE /formations/:id`: Delete a formation by ID. Returns a `JSON` object with the deleted formation's data. `x-access-token` header required.

#### Module
- `GET /modules`: Get all modules. Returns a `JSON` array of all modules.
- `GET /modules/:id`: Get a module by ID. Returns a `JSON` object with the module's data.
- `GET /modules/:id/lessons`: Get all lessons of a module by ID. Returns a `JSON` array of all lessons.
- `POST /modules`: Create a new module. Returns a `JSON` object with the new module's data. Requires a `JSON` object with the module's data. `x-access-token` header required.
- `PUT /modules/:id`: Update a module by ID. Returns a `JSON` object with the updated module's data. Requires a `JSON` object with the module's data. `x-access-token` header required.
- `DELETE /modules/:id`: Delete a module by ID. Returns a `JSON` object with the deleted module's data. `x-access-token` header required.

#### Group
- `GET /groups`: Get all groups. Returns a `JSON` array of all groups.
- `GET /groups/:id`: Get a group by ID. Returns a `JSON` object with the group's data.
- `GET /groups/:id/lessons`: Get all lessons of a group by ID. Returns a `JSON` array of all lessons.
- `POST /groups`: Create a new group. Returns a `JSON` object with the new group's data. Requires a `JSON` object with the group's data. `x-access-token` header required.
- `PUT /groups/:id`: Update a group by ID. Returns a `JSON` object with the updated group's data. Requires a `JSON` object with the group's data. `x-access-token` header required.
- `DELETE /groups/:id`: Delete a group by ID. Returns a `JSON` object with the deleted group's data. `x-access-token` header required.

#### Lesson
- `GET /lessons`: Get all lessons. Returns a `JSON` array of all lessons.
- `GET /lessons/:id`: Get a lesson by ID. Returns a `JSON` object with the lesson's data.
- `GET /lessons-current-year`: Get all lessons of the current year e.g. 2024/2025
- `POST /lessons`: Create a new lesson. Returns a `JSON` object with the new lesson's data. Requires a `JSON` object with the lesson's data. `x-access-token` header required.
- `POST /lessons-generate`: Automatically generates as many lessons as possible with the available groups and modules by assigning the teacher to null.
- `PUT /lessons/:id`: Update a lesson by ID. Returns a `JSON` object with the updated lesson's data. Requires a `JSON` object with the lesson's data. `x-access-token` header required.
- `DELETE /lessons/:id`: Delete a lesson by ID. Returns a `JSON` object with the deleted lesson's data. `x-access-token` header required.

### Example
```bash
# Request
GET /professors/

# Response
[
{
"id": 1,
"senecaUser": "josemariacampos",
"name": "JosΓ© MarΓ­a",
"firstSurname": "Campos",
"lastSurname": "Trujillo",
"specialty": "FP",
},
{
"id": 2,
"senecaUser": "carloshernandez",
"name": "Carlos",
"firstSurname": "HernΓ‘ndez",
"lastSurname": "Palma",
"specialty": "Secundary",
},
]

# Request
POST /professors/
Headers: x-access-token:
{
"seneceUser": "davidluque",
"name": "David",
"firstSurname": "Luque",
"lastSurname": "Vegas",
"specialty": "FP"
}

# Response - 201 Created
{
"id": 3,
"senecaUser": "davidluque",
"name": "David",
"firstSurname": "Luque",
"lastSurname": "Vegas",
"specialty": "FP"
}
```

## Key Features
- Management of five tables: Professor, Formation, Module, Group, Lesson.
- Administrators can perform any operation on the tables.
- Registered users can view data without making modifications.
- Unregistered users can view the structure of groups in the current school year.

## Lesson Generation
1. Enter data into the Professor, Formation, and Module tables.
2. Register data in the Group table.
3. Create lessons for the school year, leaving the professor_id field blank (null).

## Important Considerations
1. Multiple lessons can be created for a module, assigned to different professors.
2. Create lessons to ensure no hours are left untaught in any module.

## Interactive Lesson Assignment Web Page
- Administrators can filter and assign professors to lessons.
- Authenticated users can check the progress of lesson assignments.

## License
This project is under the MIT License - see the [LICENSE](LICENSE) file for details.

## Authors
Campos Trujillo, JosΓ© MarΓ­a - [jmcamposdev](https://github.com/jmcamposdev)

Carlos Hernandez Palma - [carloshpdev](https://github.com/carloshpdev)

Luque Vegas, David - [Daviiid999](https://github.com/Daviiid999)

Capdevila RodrΓ­guez, VΓ­ctor - [vilacprd](https://github.com/vilacprd)

RodrΓ­guez JareΓ±o, Manuel - [Manabimassu](https://github.com/Manabimassu)

## Acknowledgments
We appreciate the collaboration of IES ZaidΓ­n-Vergeles in this project.