https://github.com/gopibabus/php-restapi-app
Restful web services using simple vanilla functional PHP.
https://github.com/gopibabus/php-restapi-app
mysql php rest-api sql
Last synced: about 2 months ago
JSON representation
Restful web services using simple vanilla functional PHP.
- Host: GitHub
- URL: https://github.com/gopibabus/php-restapi-app
- Owner: gopibabus
- Created: 2019-09-06T02:10:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-07T10:07:17.000Z (almost 5 years ago)
- Last Synced: 2025-03-31T22:44:03.271Z (about 1 year ago)
- Topics: mysql, php, rest-api, sql
- Language: PHP
- Homepage:
- Size: 3.54 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

> This project focuses on implementing Restful web services using simple **vanilla PHP**.
## Scenario
- Build a task list system that will allow users to log in and create, update and delete tasks.
- Each user’s tasks will be private to them and other users will not be able to view them.
- We are responsible for database backend, the web services and Authentication module.
- We are not responsible for the front end or the server setup.
## API Requirements - Tasks
- Return JSON response for all APIs and allow caching where appropriate
- A task should have an ID, title, description, deadline date, completion status
- Return a list of details for all tasks for a user using a URL of: **/tasks**
- Return a list of details for all tasks for a user with pagination using a URL of : **/tasks/page/{:page}**
- Return a list of details for all tasks for a single task for a user using a URL of : **/tasks/{:taskid}**
- Return a list of details for all incomplete tasks for a user using URL of: **/tasks/incomplete**
- Return a list of details for all complete tasks for a user using URL of: **/tasks/complete**
- Delete a task for a user using URL of: **/tasks/{:taskid}**
- Update title, description, deadline date or completion status and return updated task using a URL of : **/tasks/{:taskid}**
- Create a task and return the details for the new task using a URL of : **/tasks**
## API Requirements - Authentication
- Return a JSON response for all APIs
- A user has an ID, full name, unique username, hashed password, user active status and login attempts
- A user can login in on more than one device and should not logout a previous device **(Sessions)**
- Create a new user using URL of : **/users**
- Login a user using a URL of : **/sessions**
- Logout a user using a URL of : **/sessions/{:sessionid}**
- Limited lifetime of a session access token, refreshed using a URL of : **/sessions/{:sessionid}**
[What is RESTful API](./REFERENCE.md)
## ✈TODO
- [ ] Add CORS (Cross-Origin Resource Sharing).
- [ ] Amending the API to allow you to upload files (images).
- [ ] Convert functional parts of the project into to OOPs.