The first goal of this project is to create an LFG web application, backend for now, that allows employees to contact other colleagues to form groups to play a video game, with the aim of being able to share some leisure time after work. The project will be made using the Laravel framework and a SQL database
- Clone the repository
$ php artisan install
- Set the .env file and adjust the params for the database.
- Connect to the database.
$ php artisan migrate
$ php artisan db:seed "here put the name of the seed"
$ php artisan serve
All endpoints start with /api/
Example
Post server.ip/api/register
🟢Auth
User Registration
-
Register new user
Registers a new user. The username and email must be unique.
POST /register
Body:
{ "userName": "User", "email": "[email protected]", "password": "password" }
User Login
-
Logs a user in
POST /register
Body:
{ "email": "[email protected]", "password": "password" }
User Logout
-
Logs out the user
DELETE /logout
🟢Users
User Management
-
Retrieve active usernames
Retrieves active usernames. Default page is 5 and default page size is 5. If the user is an admin, retrieves all usernames.
GET /user
Parameters:
pageSize
: Number of usernames per page (optional | default : 5)
Get self Profile
-
Retrieves self profile
GET /user/profile
Update Profile
-
Logs a user in
PUT /user/profile
Body:
{ "userName": "user" }
Delete User
-
Deletes User
DELETE /user/{id}
Parameters:
id
: userId
🟢Chats
Create Chat
-
Creates new Chat
POST /chat
Body:
{ "name": "Chat Name", "description": "Chat description", "game_id": "12345678" }
Get all chats
-
Retrieves all chats
GET /chat
Get Chat by id
-
Retrieves Chat on params id
GET /chat/{id}
Parameters:
id
: chat Id
Delete Chat
-
Deletes chat on params id
DELETE /chat/{id} Parameters:
id
: chat Id
Search chats by game
-
Retrieves chats from a game
GET /chat/game/{id} Parameters:
id
: game Id
Enter a chat
-
Enters chat on params
POST /user_chats
Body:
{ "chat_id": "2345678" }
Leave a chat
-
Leave Chat on body
Detele /user_chats
Body:
{ "chat_id": "2345678" }
🟢Messages
Create Message in chat
-
Creates message in chat given by id on body
POST /chat/message
Body:
{ "text": "Example Text", }
Update Message in chat
-
Updates message in chat given by id on body
POST /chat/message/{id}
Parameters:
id
: game Id
Body:
{ "text": "Example Text", "chat_id": "12345678" }
Delete Message in chat
-
Creates message in chat given by id on params
DELETE /chat/message/{id}
Parameters:
id
: message Id
Get messages from chat
-
Retrieves chats from a game
GET /messages/{id} Parameters:
id
: game Id
🟢Games
Get all games
-
Retrieves all games
GET /game
Create Game
-
Registers a game in the database
POST /game
Body:
{ "gameName": "Your favourite RPG", "description": "Brief description", "urlImg": "https//:gameImage.net" }
Delete Game
-
Deletes game by id given on params
DELETE /game/{id}
Parameters:
id
: game Id
Update Game
-
Updates Game by id given on params
PUT /game/{id}
Parameters:
id
: game Id
Body:
{ "gameName": "Your favourite RPG", "description": "Brief description", "urlImg": "https//:gameImage.net" }
- Marina Escrivá - Project Developer & Designer
- Pol Montero - Project Developer & Documentarian
- Ana Pacheco - Project Developer & Tester
- Ramiro Poblete - Project Developer & Pagination Manager
- To Geekshubs Academy for the trust, encouragement and knowledges to make us able to colaborate and develop this project
- To this date there is no pagination for most GET endpoints
This project is under a MIT license. Check out the LICENSE
file for more and extended details about it.