ex-shop

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发、 常用JavaScript包
软件类型 开源软件
地区 不详
投 递 者 壤驷阳冰
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Authentic Pixels

Digital goods shop & blog created using Phoenix Framework (Elixir)

This is the source code for my new website - Authentic Pixels.Through Authentic Pixels, I plan to deliver high quality free & premium web resources including Bootstrap HTML templates, startup landing pages, UI kits, mockups & themes for Ghost & Wordpress.


Demo & Screenshots

View the live website here - Authentic Pixels

Here are some screenshots of the admin area.

This project has been a great learning experience for me. Coming from Ruby on Rails, there are a lot of things that are done differently in Elixir/Phoenix and building this app has helped me understand the "Elixir way" of doing things.

Some of the things that this project helped me wrap my head around are -

  1. Nested records & associations (e.g: Product has many variants)
  2. Handling many-to-many associations and validating them
  3. Uploading images
  4. Testing
  5. Switching to Webpack from Brunch
  6. Creating Sitemaps and running a cron task to regularly run the sitemap generation task
  7. Deploying (to a Digital Ocean box using Dokku)
  8. Sending HTML emails.
  9. Separating admin area from frontend using differnt layouts and scopes in router.ex

I will be writing about this is a lot more detail on my blog soon.


Installation

  1. Clone the repository and install the dependencies
git clone git@github.com:authentic-pixels/exshop.git
cd exshop
mix deps.get
npm install
  1. Create the database and run the migrations
mix ecto.create
mix ecto.migrate
  1. Create an admin user. You can change the email and password in priv/repo/seeds.exs file.
mix run priv/repo/seeds.exs
  1. Add your Cloudinary keys. Create a file called dev.secret.exs inside config folder with the following contents. Be sure to change the 'name', 'api_key' and 'api_secret' fields.
use Mix.Config
config :cloudini,
  api_key: "CHANGE_ME",
  api_secret: "CHANGE_ME",
  name: "CHANGE_ME",
  stub_requests: false,
  http_options: [timeout: 15000]
  1. Start the server
iex -S mix phoenix.server

Now visit http://localhost:4000/ to see the frontend version. To access the admin area, visit http://localhost:4000/admin. You can login with the email and password set in priv/repo/seeds.exs.


Running tests

  1. Set up your test database
MIX_ENV=test mix ecto.reset
  1. Run all the tests on file change
mix test.watch

Todo

  • Create sitemaps
  • Cron task to update sitemaps frequently
  • Add archives page to blog
  • Create RSS feeds
  • Explore Google AMP versions for product/post pages
  • Write integration tests for admin area

Credits

The Elixir/Phoenix community is really welcoming & responsive. There are tons of nice examples and packages that helped me with my learning. Here are some of the elixir packages that I am using in this project -

  • Comeonin for password hashing
  • test.watch for running tests
  • Bamboo for sending emails
  • Cloudini for uploading images to Cloudinary
  • Quantum for running cron tasks
  • Curtail for truncating HTML snippets
  • XML builder for generating Sitemaps
  • Kerosene for pagination

For any questions/comments/suggestions, drop me a line at - bharani@authenticpixels.com or send me a tweet.

Thanks,

Bharani,Authentic Pixels - Free & Premium Web Resources

  • 去年秋天,眼见着我们离开中国的日子越来越近了,我开始考虑是不是干脆放弃中文课算了。毕竟,我想做的事情太多了,进一步提高中文似乎也没有太大的意义。不过,我后来还是选择继续下去,这在很大程度上是因为我的中文老师何丽英已经成了我的好朋友,我很享受每周和她聊天的时光。我们的中文课越来越像是社交拜访。这中间有一次,她突然告诉了我一个惊人的消息:“我们可能也会去纽约。”Alan PaulAlan Paul在美

  •   E - Knapsack 2 Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100 points Problem Statement There are NN items, numbered 1,2,…,N1,2,…,N. For each ii (1≤i≤N1≤i≤N), Item ii has a weight of wiwi a

  • ** C#调用PhotoShop打开指定路径图片 ** C#调用PhotoShop打开指定路径图片 传入照片路径,检测计算机中的PhotoShop,并打开指定图片 private void GetSoftWarePath(string imgpath) { int i = 0; //找到所有安装程序 u

  • “抠图”用英文怎么说 今天突然被“抠图”这个单词给难住了,“ image segmentation ”,“ image cut ”,“ image crop ”,“ image clip ”好像都不太对 另外,“抠图爱好者”用英文应该怎么说? re:f_ck photo (明显是错误的回答) re: @Hopetree #1 请不要将 photoshop ( PS )用于动词以在普遍意义上指代任何

 相关资料
  • br-ex 核心接口有两个。 一个是挂载的物理接口上,如 eth0,网包将从这个接口发送到外部网络上。 另外一个是 qg-xxx 这样的接口,是连接到 router 服务的网络名字空间中,里面绑定一个路由器的外部 IP,作为 nAT 时候的地址,另外,网络中的 floating IP 也放在这个网络名字空间中。 Bridge br-ex Port "eth0"

  • Quartz EX 相当于是集群版的 Quartz 。 这是 Terracottra 收购 Quartz后推出的精简版集群Quartz,该产品名为Terracottra Quartz EX,为Quartz提供了新的Terracotta任务存储能力(即Terracotta Job Store for Quartz),针对以非集群方式运行应用程序的Quartz用户,还提供了跨节点任务调度功能。对于正使

  • 使用 (R)?ex 你可以从一个中心点通过完整的配置管理和软件发布流程来管理所有的机器 (R)?ex 使用 SSH 作为默认的传输层,无需在服务器端安装任何软件,只需要一个可使用 ssh 的帐号。

  • Rabbit 是使用 Elixir 语言编写的同步视频播放软件,可以在不同组员之间同步播放视频。

  • Ex-Crawler 是一个网页爬虫,采用 Java 开发,该项目分成两部分,一个是守护进程,另外一个是灵活可配置的 Web 爬虫。使用数据库存储网页信息。

  • Money Manager Ex 是一款免费的个人帐务管理软件,它本身具有多种分类项目,如银行账户、股票、基金、工作收入...等,方便使用者可以依据这些项目来记录自己的收入与支出状况,并且也允许使用者自己新建项目,让软件更具弹性。而使用者也能够每隔一段时间试算自己个人的财物报表,让自己能够更进一步掌握自己的财务状况。