City Gardens
A Le Wagon team project for finding community gardens, reserving parcels and joining garden events.
Ruby on Rails · PostgreSQL · Active Record · JavaScript
The problem
A visitor needs to find a garden and understand which parcel or event they can join. Garden information, users and reservations need to refer to the same records.
My contribution
Shared Le Wagon team project, 2023. My merged work included parcel reservations (PR #37), the add-event button (#38), logout (#39), event-index partials, a search bar, Cloudinary for event photos, and styling (#47, #50). I did not build the whole schema alone, and the app is not maintained as a product.
The intended user journey
- The intended visitor flow starts by browsing or searching for a garden.
- Open a garden to inspect its description, parcels and events.
- Sign in through Devise before creating a reservation or event booking.
- A controller associates the new record with the current user and the selected parcel or event.
- The profile and garden views read those related records back from PostgreSQL. This is a code walkthrough, not a verified live demo.
How the data was organised
| Component | Depends on | Responsibility |
|---|---|---|
| users | Devise authentication | Accounts referenced by gardens, bookings, bookmarks, reviews and parcel reservations. |
| gardens | gardens.user_id → users.id | Garden details and location; a garden has parcels and events. |
| parcels | gardens through garden_id | A parcel belongs to one garden. |
| parcel_reservations | users and parcels through user_id and parcel_id | Connects a member to a reserved parcel; includes status and duration. |
| events | gardens through garden_id | Event details, date and capacity. |
| bookings | users and events through user_id and event_id | Connects an attendee to an event and records attendee count. |
| bookmarks and reviews | A user plus a garden or reviewable record | Saved gardens and feedback; reviews use a polymorphic target. |
| Photos and maps | Active Storage/Cloudinary and geocoding integration | Media and coordinates support the views; external configuration is required. |
Implementation, step by step
- Start with the visitor journey: find a garden, inspect it, make a reservation.
- Translate the nouns into models and foreign keys before building the screens.
- Use Rails routes to send an HTTP request to a controller action.
- Use Active Record to load or validate related records and write to PostgreSQL.
- Render the result in a view and test ownership, validation and failure paths, not only the happy path.
Limits and unfinished work
The current README is only a Cloudinary snippet. Inspection also found a missing reservation-parameter method, a User-to-parcels association that does not match the schema, and duplicated garden callbacks. I have not altered the shared repository or presented these paths as verified. Use this project as historical team and data-modelling evidence.