Skip to content

HyPolDev/Proyecto-Laravel

Repository files navigation

Lara Games Project

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

Lara games Img

🛠️ Tech&Tolls used

Laravel Logo

💾 Local installation

  1. Clone the repository
  2. $ php artisan install
  3. Set the .env file and adjust the params for the database.
  4. Connect to the database.
  5. $ php artisan migrate
  6. $ php artisan db:seed "here put the name of the seed"
  7. $ php artisan serve

⚙️ Endpoints

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"
    }

✒️ The team

  • Marina Escrivá - Project Developer & Designer
  • Pol Montero - Project Developer & Documentarian
  • Ana Pacheco - Project Developer & Tester
  • Ramiro Poblete - Project Developer & Pagination Manager

🎓 Special Thanks

  • To Geekshubs Academy for the trust, encouragement and knowledges to make us able to colaborate and develop this project

☑️ Add Ons - Bugs and Dreams

  • To this date there is no pagination for most GET endpoints

📄 License

This project is under a MIT license. Check out the LICENSE file for more and extended details about it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages