Introduction (you can skip it)
Hello dear Elixir community,
I am very new to programming, I never did any studies around it, and I even don’t have a scientific background.
Now, I have a nice project idea and I’m not alone thinking it is nice.
It would be an application to make you able to reference products you own, and then send you notifications for their good maintenance. I’m from France, and in France, data says 50% of failures come from a lack of maintenance. It represents 14 millions household appliances per year.
I’m not a passionate of programming as many of you probably are.
But I’m a hard working person when I believe in what I do, and I truly believe my project can bring something good to the world, by making us able to keep longer the products we own. The long-term vision is also far bigger, because such a tool with many products referenced and accounted could become a global observatory to gain more transparency about our products life (the data which are currently kept private inside after-sale services).
I’m at the very begining, but I’m pressed, cause the world isn’t waiting. I already made an app (in french) that I could translate and show you if you’re interested.
But this app is currently all made on Adalo, which is a no-code tool that allow you to create and then publish native apps (which is crucial to send push notifications).
But Adalo doesn’t allow me to develop the feature I want, and for that, I’ll need to make my own back-end, and plug it to my Adalo app through an API.
My brother is a developer, and he is really really good at what he does.
He helped me for other side projects (mostly artistic ones) by the past.
He will also help me in the future with this current project.
But I also need to put hands in the mechanics of programming if I want my application to advance as fast as I need it. To be transparent, I’m currently full time on this project, and I estimate that I only have 17 months to make it viable. My brother is not at all full-time on it, and he will be able to allow me only a few hours per week, so I have to be more autonomous on what I’m doing.
More succint problem description
I’m a newbie on programming. I’m currently starting with Elixir and Phoenix framework to developp an API for a native application (and then probably a full native application).
I’m following Phoenix Guides (which I adapt to my project), and I’m currently stucked at the Context Guide.
More precisely, I did the first steps and things are working correctly, except:
- Adding Catalog Functions: I don’t see the view updating on the screen. However, logs seems to be exactly what is described in the guide.
↳ PrepairWeb.ProductController.show/2, at: lib/prepair_web/controllers/product_controller.ex:32
[debug] QUERY OK source="products" db=0.4ms queue=0.5ms idle=1790.1ms
UPDATE "products" AS p0 SET "views" = p0."views" + $1 WHERE (p0."id" = $2) RETURNING p0."views" [1, 1]
↳ Prepair.Data.inc_page_views/1, at: lib/prepair/data.ex:116
-
In-context Relationships: I can see the correct
select form
I put in theproduct_form.html.heex
template, and it contains the samplecategories
I put in theseeds.exs
. I can only select one category as I modified themultiple
option to false. But I can select a category. It seems OK.
However, after I added (or updated) a product, the categorylist item
I put in theshow.html.heex
template is empty from any value.
In the logs below, I can see the link with theproduct_categories
join in the database seems to happen.
[debug] Processing with PrepairWeb.ProductController.show/2
Parameters: %{"id" => "1"}
Pipelines: [:browser]
[debug] QUERY OK source="products" db=0.8ms idle=635.5ms
SELECT p0."id", p0."bought_new", p0."country_of_origin", p0."date_of_purchase", p0."date_of_registration", p0."description", p0."end_year", p0."image", p0."in_service", p0."manufacturer_name", p0."name", p0."notifications", p0."original", p0."parts", p0."profile", p0."reference", p0."serial_number", p0."start_year", p0."user", p0."user_manual", p0."warranty_duration", p0."views", p0."inserted_at", p0."updated_at" FROM "products" AS p0 WHERE (p0."id" = $1) [1]
↳ Prepair.Data.get_product!/1, at: lib/prepair/data.ex:40
[debug] QUERY OK source="categories" db=1.0ms idle=636.5ms
SELECT c0."id", c0."average_lifetime", c0."image", c0."name", c0."notifications", c0."product", c0."inserted_at", c0."updated_at", p1."product_id"::bigint FROM "categories" AS c0 INNER JOIN "product_categories" AS p1 ON c0."id" = p1."category_id" WHERE (p1."product_id" = ANY($1)) ORDER BY p1."product_id"::bigint [[1]]
↳ PrepairWeb.ProductController.show/2, at: lib/prepair_web/controllers/product_controller.ex:32
[debug] QUERY OK source="products" db=0.7ms idle=637.8ms
UPDATE "products" AS p0 SET "views" = p0."views" + $1 WHERE (p0."id" = $2) RETURNING p0."views" [1, 1]
↳ Prepair.Data.inc_page_views/1, at: lib/prepair/data.ex:116
I’m a bit lost, so any help is very welcome!
I’ll very probably have other questions soon as my project will go further