https://github.com/alexchurkin/lightschool-homework-api
Homework API for LightSchool
https://github.com/alexchurkin/lightschool-homework-api
php php7 simple-api
Last synced: 10 months ago
JSON representation
Homework API for LightSchool
- Host: GitHub
- URL: https://github.com/alexchurkin/lightschool-homework-api
- Owner: alexChurkin
- License: apache-2.0
- Created: 2018-10-30T07:45:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-20T11:11:26.000Z (over 6 years ago)
- Last Synced: 2025-01-29T11:33:42.446Z (11 months ago)
- Topics: php, php7, simple-api
- Language: PHP
- Size: 64.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-en.md
- License: LICENSE
Awesome Lists containing this project
README
LightSchool API
===============
Today we present you a fast and convenient way to share homework between classmates – LightSchool API!
For easy setup, we'll need:
- Device with LightSchool and Internet connection
- Hosting which supports PHP + MySql and the ability to connect via FTP
## Сonfiguring the server:
Download the necessary files here (click **Clone or download** -> **Download ZIP**)
Our API is located in the API folder.
Then in phpMyAdmin create a new MySql database and a table with any convenient name (for example table_homework).
Then change some constants in the **config.php** file.
**HOST** can be changed if something else is specified on the hosting instead of localhost;
**DBNAME** – the name of the database we will use;
**USERNAME** – the username from a MySql (which we have entered in php);
**PASS** – password used to log into MySql;
**ADMIN_TOKEN** – here you must enter the password to add / change / delete homework;
**TABLE** – name of the table we created.
Connect via FTP, upload all these files to any publicly visible folder on the server. Next, go to phpMyAdmin, create a table by this command:
```sql
CREATE TABLE `database_name`.`table_homework` ( `id` INT NOT NULL AUTO_INCREMENT , `timestamp` INT NOT NULL , `subject` TEXT NOT NULL , `hometask` TEXT NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;
```
The server is successfully configured!
## Configuring the application:
Go to **Settings** -> **Homework**, select "**Server administration mode**".
In the field **"Full server url"** specify the address of the folder where we put our API files. For example: http://api.lightschool.com/homework/
In the **"Administrator token"** field enter ADMIN_TOKEN which we have written to the config.php.
It's time to write your first homework. Click on the plus sign in the upper right corner, write a subject and a homework.
Excellent, everything is ready to use.

If your classmates don't have devices on Android, they can receive homework by direct server url which was mentioned above :)