Here is the repo: Barebones Phoenix 1.5.1 Project Using Guardian for Authentication
The protected route is
/products. All other routes are free to access.
For some weird reason, the project won’t compile under Windows since it requires Argon2_elixir (which requires native compilation that is not easy to set up).
To get the project working, I used WSL from within VS Code and everything works 100%.
Installing Elixir and Its Tools in WSL
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && sudo dpkg -i erlang-solutions_2.0_all.deb sudo apt-get update sudo apt-get install esl-erlang sudo apt-get install elixir sudo apt-get install build-essential mix archive.install hex phx_new 1.5.1 sudo apt-get install -y inotify-tools curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bas nvm install --lts
In case you need to access a PostgreSQL instance that you installed inside Windows, you can do:
sudo apt install postgresql-client-common sudo apt-get install postgresql-client psql -h 127.0.0.1 -p 5432 -U postgres
To start your Phoenix server:
- Install dependencies with
- Create and migrate your database with
- Install Node.js dependencies with
cd assets && npm install
- Start Phoenix endpoint with
Now you can visit
localhost:4000 from your browser.
Ready to run in production? Please check our deployment guides.
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix
comments powered by Disqus
You might also like
10 Ways to Ensure You Write Future Proof Code as a Developer
Show Correct http or https Url in Django Rest Framework (DRF) Browsable Api for Hyperlinked Serializers
Building a Better Web By Improving Performance and Speed to Enhance User Experience
How to Start Programming - Learning for a Self-Taught Software Engineer, Developer or Programmer
The Tools I Have Used for Web, Desktop and Mobile App Development so Far
Deploying/Hosting Django on a Virtual Private Server (VPS) Like Digital Ocean or Upcloud Using Caddy, Docker and Docker Compose
Phoenix Framework - Developing in WSL to Avoid Compilation Issues
How to Backup Your PostgreSQL Database to Google Drive Automatically Using Bash