Skip to content

AnastasiaKosovets/ak-fsd-backend-ConcertToYou

Repository files navigation

Welcome to my final rpoject - backen part

PHP-LARAVEL final project in Geekshubs Academy FSD 04-2023

headerpict

Index
  1. About the project
  2. Stack
  3. Diagram
  4. Local installation
  5. Process
  6. Project structure
  7. Endpoints
  8. Future functionalities
  9. License
  10. Webgraphy
  11. Gratitudes
  12. Contact

About the project

From GeeksHub we were asked to create the backend of my final project. From the creation of the business logic to take it to production. I have chosen a theme related to music, a functional web so that both user and music (besides the admin) can manage it. As a user you will be able to save in your favorites concerts that have caught your attention and book your ticket, plus if you have a group could register it on my website. As a musician you will have the benefit of being able to promote your concerts through my website, controlling your personal data, band data, your concerts and publish your concerts. As an admin you will have access to all the management in order to have the best control of the functionality internally.

Stack

Technologies that has been used:

Diagram

BBDD

Local installation

Steps to make it work on your local computer:

  1. Clone the project on your computer with git bash: $git clone 'url-repository'

  2. Install all dependencies with the following command: $ compose install

  3. Create a .env file following the template .env.example provided and type all credentials. If you cannot get them, change the parameters for your own local database set up running in docker.

  4. Start the server with: $ php artisan serve

  5. Connect the repository with the database with the following commands: $ php artisan migrate $ php artisan db:seed

  6. Import this file in postman to get the endpoints we have created:

Run in Postman

Process

In order to start the project you had to establish the logic it needs. First I made a sketch of the database tables, to better understand what kind of relationship I will need for each table, where to create the intermediate tables and foreign keys. First I made the web flow, after that I started to create and test (visually) the database tables:

WEB

This has allowed me to see what exactly my database needs, what fields and relationships, and to have a good template to start creating it.

Start

Project structure

The project is structured using the Model-View-Controller (MVC) pattern and basic CRUD (Create, Read, Update and Delete) functionality has been implemented. The structure of the project is described below:

  • Migrations. Migrations are used to define the structure of the tables in the database, including all their columns and types.
  • Models. Models represent the relationships between the tables in the database and the type of relationship that exists between them.
  • Controllers. Two middlewares have been implemented in this web application: one for the administrator role and one for the group role.
  • Middlewares. This web needed two middlewares: admin and of the group.
  • Seeders. Seeders have been created, which are example data used to populate the database once the application is running.
  • api. In the api.php file, all the routes and their relationship to the corresponding controllers and endpoints have been defined.
  • .env In the .env file all the environment variables that the application needs to run correctly have been defined.

Endpoints

This project has 32 endpoints. Here are some examples:

User:

User
  • Login user:

    • Manage login in the API. The information is passed via body in Postman containing the email and password:

        POST:   https://ak-fsd-backend-concert-to-you-njjo.vercel.app/api/api/login 
      

      body:

         {
          "email": "[email protected]",
          "password": "password",
          }
  • Register User:

    • Manage of the register in our API:

        POST:  https://ak-fsd-backend-concert-to-you-njjo.vercel.app/api/api/register
      

      body:

      {
          "firstName": "Name",
          "lastName": "Surname",
          "email": "[email protected]",
          "password": "password",
          "address": "Address",
          "document": "11111111M",
          "dateOfBirth": "00/00/0000",
          "phoneNumber": "111111111",
      }

User also can:

-   Logout
-   Register Group(if user have a group)
-   View of Profile
-   Get My Tickets
-   Delete profile
-   Book ticket
-   Put in favorites
-   Get my favorites

General endpoints:

General

Without login you can: - View of all groups - View of all concerts - Search concerts by title or group name - View of Conctacts page - View of About Us page

User(as musician):

Musician
  • Create concert:
    • Musician can public his concert in the web.

        POST:   https://ak-fsd-backend-concert-to-you-njjo.vercel.app/api/api/createConcert
      

      body:

      {
          "image": "URL",
          "title": "Title",
          "date": "0000/00/00 00:00",
          "groupName": "Name",
          "description": "Description",
          "programm": "Programm",
      }

Also can:

-   Get my concerts
-   Get my group
-   Update my group

Admin part:

Admin
  • Get all users:
    GET: https://ak-fsd-backend-concert-to-you-njjo.vercel.app/api/api/users

  • Get user by name or surname:

    • Obtains information faster.

        GET:   https://ak-fsd-backend-concert-to-you-njjo.vercel.app/api/api/user?lastName=&firstName=
      
  • Update group:

    • Update only some information.

        PUT:   https://ak-fsd-backend-concert-to-you-njjo.vercel.app/api/api/user?lastName=&firstName=/api/groups/admin/8
      

    body: ``` bash { "description": "Description" }

      ```
    
  • Delete Concert:

    • Deletes concert by it´s id.

        DELETE:    https://ak-fsd-backend-concert-to-you-njjo.vercel.app/api/api/concert/delete/16
      

Also admin can:

-   Restore & Delete user
-   Restore & Delete concert
-   Restore & Delete Group

Future functionalities

As future features I would like to develop the user interface in more depth, having more options for managing personal data, in addition to the collaborations and to be able to introduce real sale of tickets, are some examples of the general idea.

License

This project is belonging to license Creative Commons Legal Code.

Webgraphy

To achieve the goal we have collected information from:

Gratitudes

I thank my teachers for their time dedicated to this project:

  • Dani

  • Jose

  • David

  • Mara

Contact

{ Anastasia Kosovets }

About

Final Project in GeeksHubs Academy : ConcertToYou - Backend PHP Laravel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published