8000 GitHub - badung7576x/elixir_gist_practice
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

badung7576x/elixir_gist_practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElixirGist

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Course

Learn Course: https://www.youtube.com/playlist?list=PL2Rv8vpZJz4x1Svv79WdT0Da42kWt_hQ0

Checklist:

  • Introduction to Kickstart Your Elixir Journey
  • Part 1: Project Design
  • Part 2: Setting Up and User Authentication
  • Part 3: Generating Our Schemas
  • Part 4: Crafting the Navigation Bar
  • Part 5: Animating Dropdown Menu with JS.toggle
  • Part 5b: Collapsing Dropdown Menu (when click outside menu)
  • Part 6: Creating the Footer
  • Part 7: Crafting the 'Create Gist' View
  • Part 8: Form Creation with LiveView and HEEx
  • Part 9: Form Validation and Database Persistence
  • Part 10: Adding Line Count Feature
  • Part 11: Sync Scrolling Between Textareas

Database Design

Database Design

Develop notes

1. Create project

$ mix phx.new elixir_gist --binary-id

2. Add authentication with phx.gen.auth

$ mix phx.gen.auth Accounts User users
$ mix deps.get
$ mix ecto.setup

3. Run server

$ mix phx.server

4. Create context

Command:

$ mix phx.gen.context <Context> <Schema> <table> <fields>

Read more about context: https://hexdocs.pm/phoenix/Mix.Tasks.Phx.Gen.Context.html

Contexts: The context is an Elixir module that serves as an API boundary for the given resource.
Schema: The schema is responsible for mapping the database fields into an Elixir struct.

Read more about schema: https://hexdocs.pm/ecto/Ecto.Schema.html
-> Change relationship in schema.

# Table gists
$ mix phx.gen.context Gists Gist gists user_id:references:users name:string description:text markup_text:text
$ mix phx.gen.context Gists SavedGist saved_gists user_id:references:users gist_id:references:gists
$ mix phx.gen.context Comments Comment comments user_id:references:users gist_id:references:gists markup_text:text
$ mix ecto.migrate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0