yumm

yumm

Hi all! I’m new to elixir and phoenix and am trying to run this project:
https://github.com/chvanikoff/reph2

I want to convert an existing react app (or at least the rest api for the database to elixir but every example project I find on Github has some sort or error regarding ecto. I’ve tried all the examples posted in https://forum.elixirforum.com/t/user-authentication-in-phoenix/118/81 but encounter similar errors to this:
could not compile dependency :phoenix_ecto, "mix compile" failed. You can recompile this dependency with "mix deps.compile phoenix_ecto", update it with "mix deps.update phoenix_ecto" or clean it with "mix deps.clean phoenix_ecto"

I’ve tried cleaning all my mix packages as well as mix.update --all.

Are all these projects just dead or am I missing something?

Also if anyone has suggestions of a working example of a elixir server with authentication (ideally with react as well) please do hesitate to share.

Thank you to the elixir developers I can see the magic in the bottle but still feel like I’m taping on the glass.

Thank you for any/all suggestions/ideas/setting me straight

Showing Posts 1 to 9

NobbZ

NobbZ

Even though I can compile the dependencies on my system (Arch linux), it fails currently with the router and prints out about a billion of warnings.

Also the particular example you posted is written in phoenix 1.1, so it will give you a false sense of how things are done today.

You should search for examples that use a more current phoenix (1.3).

Sadly I can’t give you any links to small example projects, but only to a fully grown application: The hex.pm website.

yurko

yurko

This one seems to work, I’ve just tested it locally GitHub - chernyshof/react-phoenix-users-boilerplate: Elixir/Phoenix + React + users template/boilerplate. · GitHub and it uses Phoenix 1.3

One thing to note is that you’d have to use admin@admin.com and not just admin as stated in the readme in order to log in.

voger

voger

Here is a toy project of mine GitHub - voger/GQLardian: Playground to learn about Guardian and Absinthe · GitHub
Very incomplete, very abandoned, very learning toy but fairly new. A very stupid blog app that I abandoned when doing permissions. No react. Just absinthe, guardian and off course the Ecto you are interested at.

yumm

yumm OP

Thank you all for your insightful responses. They all provide great references to study.

@yurko were you able to get this one running? I’ve tried but am receiving this error when I follow the install instructions on their README:
08:31:47.792 [error] GenServer #PID<0.4925.0> terminating ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2 (connection) lib/connection.ex:622: Connection.enter_connect/5 (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3 Last message: nil State: Postgrex.Protocol ** (Mix) The database for Boilerplate.Repo couldn't be created: an exception was raised: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2 (connection) lib/connection.ex:622: Connection.enter_connect/5 (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

This looks to me like postgres is not installed. Am I correct in assuming I should first install posgres on my machine (OSx 10.13) then retry the install? Also am I safe using the postgres 10.4 or should I use a older version?

Regardless you have already been more then helpful thank you very much.

yumm

yumm OP

The problem was that postgres had to be installed. However now that I have done this I am encountering a new error: `** (Mix) The database for Boilerplate.Repo couldn’t be created: FATAL 28P01 (invalid_password): password authentication failed for user “postgres”

09:41:21.773 [error] GenServer pid<0.4925.0> terminating
** (Postgrex.Error) FATAL 28P01 (invalid_password): password authentication failed for user “postgres”
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol`

when running mix ecto.create

Is there a specific postgres password i need to use so that it will be compatible with ecto? or does it have to be blank? although that seems unsecure..

Regardless thank you again for all the help and while I will greatly appreciate replies I understand your all very busy so I’m mostly using this thread to think through the errors I encounter and document results for others to reference.

Thanks

yurko

yurko

Yes, you need postgres and then you need to set up the connection, edit your dev config and set up username, password etc, s. react-phoenix-users-boilerplate/config/dev.exs at master · chernyshof/react-phoenix-users-boilerplate · GitHub

Your local database doesn’t have to be secure unless it’s open to the outside world. If you want to set the password you can do something like this:

sudo -u postgres psql
ALTER USER "postgres" WITH PASSWORD 'new_password';
yumm

yumm OP

@yurko Thank you so much this worked. For others All I had to do was change the database name from ‘boilerplate_dev’ to ‘postgres’ this is the name of the default database that was created when I installed postgres with the enterpriseDB installer.

Thank you all again for helping.

voger

voger

This doesn’t seem right. When you run mix ecto.create it should create that database for you.

yumm

yumm OP

@voger your correct. I was able to duplicate my project and use ‘boilerplate_dev’ as database name. please ignore the previous version of this reply as that error was simply due to a node.js server interfering with phoenix.

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
subsaharancoder
I’ve followed the Phoenix LiveView file upload code here Uploads — Phoenix LiveView v1.0.0-rc.7 and so far everything works just fine wit...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews