Skip to content

Commit 3d8910f

Browse files
committed
Initial
1 parent 33b7a72 commit 3d8910f

59 files changed

Lines changed: 954 additions & 10457 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.formatter.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
import_deps: [:ecto, :phoenix],
3+
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
4+
subdirectories: ["priv/*/migrations"]
5+
]

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
api_ecommerce-*.tar
24+
25+
# Since we are building assets from assets/,
26+
# we ignore priv/static. You may want to comment
27+
# this depending on your deployment strategy.
28+
/priv/static/

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,19 @@
1-
<p align="center">
2-
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
3-
</p>
1+
# ApiEcommerce
42

5-
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
6-
[travis-url]: https://travis-ci.org/nestjs/nest
7-
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
8-
[linux-url]: https://travis-ci.org/nestjs/nest
3+
To start your Phoenix server:
94

10-
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
11-
<p align="center">
12-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
13-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
14-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
15-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
16-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
17-
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a>
18-
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
19-
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
20-
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
21-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
22-
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
23-
</p>
24-
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
25-
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
5+
* Install dependencies with `mix deps.get`
6+
* Create and migrate your database with `mix ecto.setup`
7+
* Start Phoenix endpoint with `mix phx.server`
268

27-
## Description
9+
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
2810

29-
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
11+
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
3012

31-
## Installation
13+
## Learn more
3214

33-
```bash
34-
$ npm install
35-
```
36-
37-
## Running the app
38-
39-
```bash
40-
# development
41-
$ npm run start
42-
43-
# watch mode
44-
$ npm run start:dev
45-
46-
# production mode
47-
$ npm run start:prod
48-
```
49-
50-
## Test
51-
52-
```bash
53-
# unit tests
54-
$ npm run test
55-
56-
# e2e tests
57-
$ npm run test:e2e
58-
59-
# test coverage
60-
$ npm run test:cov
61-
```
62-
63-
## Support
64-
65-
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
66-
67-
## Stay in touch
68-
69-
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
70-
- Website - [https://nestjs.com](https://nestjs.com/)
71-
- Twitter - [@nestframework](https://twitter.com/nestframework)
72-
73-
## License
74-
75-
Nest is [MIT licensed](LICENSE).
76-
77-
## Notes
78-
79-
- Controllers
80-
- Providers (Not all provider are services) `@Injectable`
81-
- Services
15+
* Official website: http://www.phoenixframework.org/
16+
* Guides: https://hexdocs.pm/phoenix/overview.html
17+
* Docs: https://hexdocs.pm/phoenix
18+
* Mailing list: http://groups.google.com/group/phoenix-talk
19+
* Source: https://github.com/phoenixframework/phoenix

config/config.exs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This file is responsible for configuring your application
2+
# and its dependencies with the aid of the Mix.Config module.
3+
#
4+
# This configuration file is loaded before any dependency and
5+
# is restricted to this project.
6+
7+
# General application configuration
8+
use Mix.Config
9+
10+
config :api_ecommerce,
11+
ecto_repos: [ApiEcommerce.Repo],
12+
generators: [binary_id: true]
13+
14+
# Configures the endpoint
15+
config :api_ecommerce, ApiEcommerceWeb.Endpoint,
16+
url: [host: "localhost"],
17+
secret_key_base: "xpSGNOCTXLgEQy1K1X+Q9aGfZZXx5Y37FxaXsUgrqf/zKk4KZwpPDCK0nWlUNrOh",
18+
render_errors: [view: ApiEcommerceWeb.ErrorView, accepts: ~w(json)],
19+
pubsub: [name: ApiEcommerce.PubSub, adapter: Phoenix.PubSub.PG2]
20+
21+
# Configures Elixir's Logger
22+
config :logger, :console,
23+
format: "$time $metadata[$level] $message\n",
24+
metadata: [:request_id]
25+
26+
# Use Jason for JSON parsing in Phoenix
27+
config :phoenix, :json_library, Jason
28+
29+
# Import environment specific config. This must remain at the bottom
30+
# of this file so it overrides the configuration defined above.
31+
import_config "#{Mix.env()}.exs"

config/dev.exs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
use Mix.Config
2+
3+
# Configure your database
4+
config :api_ecommerce, ApiEcommerce.Repo,
5+
username: "postgres",
6+
password: "postgres",
7+
database: "api_ecommerce_dev",
8+
hostname: "localhost",
9+
show_sensitive_data_on_connection_error: true,
10+
pool_size: 10
11+
12+
# For development, we disable any cache and enable
13+
# debugging and code reloading.
14+
#
15+
# The watchers configuration can be used to run external
16+
# watchers to your application. For example, we use it
17+
# with webpack to recompile .js and .css sources.
18+
config :api_ecommerce, ApiEcommerceWeb.Endpoint,
19+
http: [port: 4000],
20+
debug_errors: true,
21+
code_reloader: true,
22+
check_origin: false,
23+
watchers: []
24+
25+
# ## SSL Support
26+
#
27+
# In order to use HTTPS in development, a self-signed
28+
# certificate can be generated by running the following
29+
# Mix task:
30+
#
31+
# mix phx.gen.cert
32+
#
33+
# Note that this task requires Erlang/OTP 20 or later.
34+
# Run `mix help phx.gen.cert` for more information.
35+
#
36+
# The `http:` config above can be replaced with:
37+
#
38+
# https: [
39+
# port: 4001,
40+
# cipher_suite: :strong,
41+
# keyfile: "priv/cert/selfsigned_key.pem",
42+
# certfile: "priv/cert/selfsigned.pem"
43+
# ],
44+
#
45+
# If desired, both `http:` and `https:` keys can be
46+
# configured to run both http and https servers on
47+
# different ports.
48+
49+
# Do not include metadata nor timestamps in development logs
50+
config :logger, :console, format: "[$level] $message\n"
51+
52+
# Set a higher stacktrace during development. Avoid configuring such
53+
# in production as building large stacktraces may be expensive.
54+
config :phoenix, :stacktrace_depth, 20
55+
56+
# Initialize plugs at runtime for faster development compilation
57+
config :phoenix, :plug_init_mode, :runtime

config/prod.exs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
use Mix.Config
2+
3+
# For production, don't forget to configure the url host
4+
# to something meaningful, Phoenix uses this information
5+
# when generating URLs.
6+
#
7+
# Note we also include the path to a cache manifest
8+
# containing the digested version of static files. This
9+
# manifest is generated by the `mix phx.digest` task,
10+
# which you should run after static files are built and
11+
# before starting your production server.
12+
config :api_ecommerce, ApiEcommerceWeb.Endpoint,
13+
url: [host: "example.com", port: 80],
14+
cache_static_manifest: "priv/static/cache_manifest.json"
15+
16+
# Do not print debug messages in production
17+
config :logger, level: :info
18+
19+
# ## SSL Support
20+
#
21+
# To get SSL working, you will need to add the `https` key
22+
# to the previous section and set your `:url` port to 443:
23+
#
24+
# config :api_ecommerce, ApiEcommerceWeb.Endpoint,
25+
# ...
26+
# url: [host: "example.com", port: 443],
27+
# https: [
28+
# :inet6,
29+
# port: 443,
30+
# cipher_suite: :strong,
31+
# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
32+
# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")
33+
# ]
34+
#
35+
# The `cipher_suite` is set to `:strong` to support only the
36+
# latest and more secure SSL ciphers. This means old browsers
37+
# and clients may not be supported. You can set it to
38+
# `:compatible` for wider support.
39+
#
40+
# `:keyfile` and `:certfile` expect an absolute path to the key
41+
# and cert in disk or a relative path inside priv, for example
42+
# "priv/ssl/server.key". For all supported SSL configuration
43+
# options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1
44+
#
45+
# We also recommend setting `force_ssl` in your endpoint, ensuring
46+
# no data is ever sent via http, always redirecting to https:
47+
#
48+
# config :api_ecommerce, ApiEcommerceWeb.Endpoint,
49+
# force_ssl: [hsts: true]
50+
#
51+
# Check `Plug.SSL` for all available options in `force_ssl`.
52+
53+
# Finally import the config/prod.secret.exs which loads secrets
54+
# and configuration from environment variables.
55+
import_config "prod.secret.exs"

config/prod.secret.exs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# In this file, we load production configuration and secrets
2+
# from environment variables. You can also hardcode secrets,
3+
# although such is generally not recommended and you have to
4+
# remember to add this file to your .gitignore.
5+
use Mix.Config
6+
7+
database_url =
8+
System.get_env("DATABASE_URL") ||
9+
raise """
10+
environment variable DATABASE_URL is missing.
11+
For example: ecto://USER:PASS@HOST/DATABASE
12+
"""
13+
14+
config :api_ecommerce, ApiEcommerce.Repo,
15+
# ssl: true,
16+
url: database_url,
17+
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
18+
19+
secret_key_base =
20+
System.get_env("SECRET_KEY_BASE") ||
21+
raise """
22+
environment variable SECRET_KEY_BASE is missing.
23+
You can generate one by calling: mix phx.gen.secret
24+
"""
25+
26+
config :api_ecommerce, ApiEcommerceWeb.Endpoint,
27+
http: [:inet6, port: String.to_integer(System.get_env("PORT") || "4000")],
28+
secret_key_base: secret_key_base
29+
30+
# ## Using releases (Elixir v1.9+)
31+
#
32+
# If you are doing OTP releases, you need to instruct Phoenix
33+
# to start each relevant endpoint:
34+
#
35+
# config :api_ecommerce, ApiEcommerceWeb.Endpoint, server: true
36+
#
37+
# Then you can assemble a release by calling `mix release`.
38+
# See `mix help release` for more information.

config/test.exs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use Mix.Config
2+
3+
# Configure your database
4+
config :api_ecommerce, ApiEcommerce.Repo,
5+
username: "postgres",
6+
password: "postgres",
7+
database: "api_ecommerce_test",
8+
hostname: "localhost",
9+
pool: Ecto.Adapters.SQL.Sandbox
10+
11+
# We don't run a server during test. If one is required,
12+
# you can enable the server option below.
13+
config :api_ecommerce, ApiEcommerceWeb.Endpoint,
14+
http: [port: 4002],
15+
server: false
16+
17+
# Print only warnings and errors during test
18+
config :logger, level: :warn

dist/app.module.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)