0% found this document useful (0 votes)
11 views6 pages

Elixir & Vue Setup

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views6 pages

Elixir & Vue Setup

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Create Vue Project:

1. Node js download LTS format


2. npm install -g @vue/cli
3. Vue create my-project
4. cd my-project
5. Vue add vuetify
6. npm run serve

Create Elixir Project:


1] goto file path and open cmd prompt and paste link and enter:
1. cmd /K "C:\Program Files (x86)\Microsoft
VisualStudio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64
2.mix phx.new employee --no-html --no-assets
3.any error means run below 2 commends:
1. mix local.hex
2. mix archive.install hex phx_new

Create Table Commends:


1.mix phx.gen.json Master Emp emp name:string dob:date department:string
salary:integer
2.resource paste for router.ex into /api below
3.resources paste after goto cmd and migrate comments below,
1. mix ecto.migrate (or)
2. mix triplex.migrate
4.mix phx.server
Push Commends:
step 1: git branch
step 2: git status
step 3: git add .
step 4: git commit -m "changes"
step 5: git push
step 6: git pull origin main
step 7: git push
push after run frontend:
set NODE_ENV="local" && npm run serve
push after run backend:
every time pull after use this commend: mix triplex.migrate --all
after use this commend: mix phx.server

GitHub download:
1.https://git-scm.com/downloads

Frontend Setup:
1] Nodejs download and install for LTS format
Download Link: https://nodejs.org/en/download/
2] Create Clone And Branch:
Clone:
1. git clone (go to github copy code link and paste)
Branch:
1. git branch *branchname* - to create new branch
2. git checkout *branchname* - switch to your branch
3. git branch - to check which is the current branch
Run Vue Server:
1. npm install - to install deps / newly added deps
2. npm run serve - to start the server
Ex:

Backend Setup:
1] vs code tools 2022 :
1.https://visualstudio.microsoft.com/downloads/
2] erlong otp 24 install:
1.https://www.erlang.org/patches/otp-24.0
3] elixir install:
1.https://elixir-lang.org/install.html#windows [version 1.13.0]
4] postgres 12 install (two times install):
Hints: postgres and dbeaver give same password
1.enterprisedb.com/postgresql-tutorial-resources-training?uuid=03b13357-9281-4985-
baea-17b72a0febc3&campaignId=7012J000001F5IIQA0
5] dbeaver install:
1.https://dbeaver.com/docs/wiki/Data-transfer/22.3/
6] Create Clone And Branch:
Clone:
1. git clone (go to github copy code link and paste)
Branch:
1. git branch *branchname* - to create new branch
2. git checkout *branchname* - switch to your branch
3. git branch - to check which is the current branch
Run Elixir Server:
1. mix deps.get -> get dependencies
2. mix deps.compile -> compiles
3.mix phx.server -> for running the server
Compile error :
Use this comments:
cmd /K "C:\Program Files\Microsoft Visual
Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cmd /K "C:\Program Files\Microsoft Visual
Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
cmd /K "C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64

mix deps.get -> get dependencies


mix deps.compile -> compiles them
mix phx.routes -> this can be used after adding a new route
mix ecto.migrate -> for migration
mix triplex.migrate -> for tenant migration
mix ecto.reset -> resets the db
mix phx.server -> for running the server
mix triplex.migrate
mix ecto.setup

psql -U postgres
create user tectaliktrade;
alter user tectaliktrade with encrypted password 'tectaliktrade@123';
GRANT ALL PRIVILEGES ON DATABASE tectalik_trade_api_dev to tectaliktrade ;
ALTER USER tectaliktrade WITH SUPERUSER;

belongs_to Elixir :
1] cmd prompt:
public -> mix ecto.gen.migration <<your desc>>
tenant -> mix triplex.gen.migration <<your desc>>
ex: mix triplex.gen.migration alter_first_table
2] alter table(:customer) do
add :routeno_id, references(:routeno, on_delete: :nothing)
end
3] belongs_to :routeno, RouteNo for customer.ex
4] routeno_id: customer.routeno_id, for customer.view
5] Mix ecto.migrate or Mix triplex.migrate

Alter_table Query:
1] cmd prompt:
public -> mix ecto.gen.migration <<your desc>>
tenant -> mix triplex.gen.migration <<your desc>>
ex: mix triplex.gen.migration alter_table_name
2] def change do
alter table("customer") do
add :ucc_name, :string
end
end
3] add col_name for customer.ex
4] add field for customer_view.ex
5] Mix ecto.migration or Mix triplex.migration

You might also like