Skip to content

FABallemand/ProjetDeveloppementWeb

Repository files navigation

πŸ›œ Projet Developpement Web: Trail Running Shoes

Pour l'Γ©valuation du projet voir EVAL.md and CHECKLIST.md

πŸ‘Ÿ Description

As a trail runner I really want to know the best shoes to buy. In order to perform an educated purchase I need to know what each model feels on the long run: How light are the shoes? Are they comfortable? Do they have a good grip? On rock? On dirt? What about rainning conditions? Will my ankle feel supported? Which size should I get?

Trail Running Shoes (TRS) is a community based website rencensing relevant data about trail running shoes. Athletes can share feedbacks, feelings or technical details about the shoes they own (and store in a cupboard) and browse the thoughts of other trail runners about other running sneackers. All athletes can easily display their favorite (or worst) shoes on shelves.

Register NOW to benefit from all the features of TRS!! πŸ”₯

βš™οΈ Technical Description

Created using:

  • php v8.1.2
  • Symfony v6.3.4
  • Tested with Mozilla Firefox v117.0 on Ubuntu 22.04 LTS
  • API interface (/api)
  • EasyAdmin interface (/admin) when connected as administrator

Association table between the type of entities in the data sheet, their real-life counterpart and the name used in the code:

Entity Type Entity Class Name
User Trail Runner User
Member Trail Runner Member
Object Trail Shoes Shoe
Inventory Cupboard Cupboard
Galerie Shelf Shelf

Class diagram:

classDiagram
Member *-- Cupboard : 0..*
Member *-- Shelf : 0..*
Cupboard *-- Shoe : 0..*
Shelf o-- Shoe : 0..*
User o-- Member : 1
User : int id
User : string email
User : string password
User : array roles
User : Member member
Member : int id
Member : User user
Member : string name
Member : int age
Member : Collection cupboards
Member : Collection shelves
Cupboard : int id
Cupboard : string name
Cupboard : Collection shoes
Cupboard : Member member
Shoe : int id
Shoe : string brand
Shoe : string model
Shoe : DateTimeInterface purchased
Shoe : Cupboard cupboard
Shoe : Collection shelves
Shoe : File imageFile
Shoe : string imageName
Shoe : int imageSize
Shoe : DateTimeImmutable updatedAt
Shelf : int id
Shelf : string name
Shelf : string description
Shelf : bool published
Shelf : Member member
Shelf : Collection shoes
Shelf : DateTimeInterface created
Shelf : DateTimeInterface updated

Implementation details:

  • A user can have up to two roles among: ROLE_USER (normal user with restricted permissions), ROLE_ADMIN (administrator, has access to every page and can edit/delete every entity)
  • The interface for galeries (Shelf), inventories (Cupboard) and objects (Shoe) are designed to display only buttons and links to actions that the user can perform
  • The interface for memberes (Member) is designed to display buttons and links to all actions but the user might be prompted to login or simply encounter an error message
  • The first command should be replaced by the second, which is a relatively new feature of php. However, the first command has been retained throughout the project in order to maximise compatibility.
// 1
$this->getUser()->getMember()
//2
$this?->getUser()?->getMember()

πŸ“ Step-by-step Description

See CHECKLIST.md for more details.

Step 1: New Symfony Project

  • Read technical specifications
  • Choose domain
  • Initialise working directory
  • Create new Symfony project

Step 2: First Entities

  • Prepare to add first entities
  • Configure database
  • Add support for data-fixtures
  • Add object (Shoe) and inventory (Cupboard) entities to data model
  • Add test data

Step 3: EasyAdmin interface & CRUD controllers

  • Add main CRUD controller
  • Add inventory (Cupboard) CRUD controller
  • Add object (Shoe) CRUD controller

Step 4: Add Member Entity

  • Add member (Member) entity
  • Add member-inventory link
  • Add member (Member) CRUD controller

Step 5: First Public Pages

  • Add inventory (Cupboard) controller
  • Add method to display list inventories (Cupboard)
  • Add method to browse an inventory (Cupboard)
  • Add link to browse in the displayed list of inventories (Cupboard)

Step 6: OneToMany Relations Administration Board

  • Add administration table for OneToMany relations

Step 7: Administration Board Improvements

  • Improve administration board

Step 8: Current Entities Administration Board

  • Add CRUD controller for all entities

Step 9: Pages Gabarits & Front-Office Display

  • Add display of an object (Shoe) inside an inventory (Cupboard) in the front-office

Step 10: Back-Office Display

  • Add page to display inventory (Cupboard)
  • Add list of the entities in the page

Step 11: CSS

  • Download and integrate Bootstrap in templates
  • Add menus for Bootstrap

Step 12: Add Galery Entity

  • Add galery (Shelf) entity

Step 13: Galery Administration Board

  • Add galery (Shelf) entities to administration board

Step 14: Galery Front-Office CRUD Controller

  • Add new CRUD controller for galeries (Shelf)
  • Improve display

Step 15: Front-Office Symfony Controllers Modifications Methods

  • ...

Step 16: Galery Browsing

  • Add context for galery (Shelf) browsing

Step 17: Acces Contextualisation & Permited Operations Restrictions

  • Add CRUD controller for member (Member) entity
  • Contextualise inventory (Cupboard) creation
  • Contextualise object (Shoe) creation

Step 18: Galerie's Objects Management

  • Contextualise galery (Shelf) creation
  • Contextualise public galeries (Shelf) display
  • Contextualise adding an object (Shoe) to a galery (Shelf)

Step 19: Authentification

  • Add authentification

Step 20: Acces Control

  • Read only access for members
  • Consulatation only access for owner and administrator
  • Write access to data owner
  • Access to non-public galeries (Shelf)
  • Access to objects (Shoe) inside non-public galeries (Shelf)

Step 21: Data Loading Contextualisation

  • Galeries (Shelf) display
  • Objects (Shoe) and inventories (Cupboard) display

Step 22: Data Removal

  • Remove objects (Shoe) from deleted inventories (Cupboard)
  • ManyToMany relations management

Step 23: Have fun!!

πŸ”— Useful Links

⌨️ Useful Commands (for developpement purpose...)

  1. Symfony version
symfony console -V
  1. List available Symfony commands
symfony console list
symfony console list app
  1. Informations related to the environment
symfony console about
  1. Help
symfony console help [command]
  1. Create Database
symfony console doctrine:database:create
symfony console doctrine:schema:create --dump-sql
symfony console doctrine:schema:create
  1. Update Database
symfony console doctrine:schema:update
  1. Delete Database
symfony console doctrine:database:drop --force
  1. Load Data Fixtures
symfony console doctrine:fixtures:load -n
  1. Do 7, 5 and 8 πŸš€
make reload_fixtures
  1. Access Symfony logs
tail -f var/log/dev.log # doctrine.DEBUG tags
  1. Clean Symfony project
symfony console cache:clear
rm -fr .project .settings/
make clean
  1. Really clean Symfony project
symfony console cache:clear
rm -fr composer.lock symfony.lock vendor/ var/cache/
rm -fr .project .settings/
make deep_clean
  1. Create and test project archive in Download folder
make prepar_to_send

πŸ“‹ Notes

  • Create and link entities -> TP2
  • Create and improve commands (ordered listings, entity creation, relations and uniqueness constraint...) -> TP2
  • Command arguments (list by year, unique...) -> TA1
  • Orphan removal -> TA1
  • TODO: private shelves are visible from member (let's consider it is a feature...)

πŸ‘€ Author

  • Fabien ALLEMAND

About

Trail Running Shoes (TRS) is a community based website rencensing relevant data about trail running shoes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published