Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viniciusilveira/blog-api
https://github.com/viniciusilveira/blog-api
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/viniciusilveira/blog-api
- Owner: viniciusilveira
- Created: 2020-12-24T12:12:45.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-10T12:52:57.000Z (over 3 years ago)
- Last Synced: 2024-11-06T21:46:16.735Z (2 months ago)
- Language: Elixir
- Size: 69.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
Awesome Lists containing this project
README
# Blog
Aplication to management Blog posts.
> Elixir, Erlang, Postgres.
---
## Instalation guide
Clone project:
1. `git clone [email protected]:viniciusilveira/blog.git`
2. `cd blog`## Requisites
- `Elixir 1.11`
- `Erlang 23.0`
- `PostgreSQL 9.6+`#### 1. Install Postgres
> OsX:
```bash
brew install postgres
```> Ubuntu:
```bash
sudo apt update
sudo apt install postgresql postgresql-contrib
```#### 2. Install Erlang and Elixir
Follow instructions from the [installation guide](https://github.com/asdf-vm/asdf#setup) to install asdf.
And using `asdf` to install `Elixir` and `Erlang`:
```bash
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.gitasdf install erlang 23.0
asdf install elixir 1.11.2
```Set global versions:
```bash
asdf global erlang 23.0
asdf global elixir 1.11.2
```#### 3. Database Settings
Duplicate files `dev.secret.exs.example` and `test.secret.exs.example`:
```bash
cd blog
cp config/db/dev.secret.exs.example config/db/dev.secret.exs
cp config/db/test.secret.exs.example config/db/test.secret.exs
```
configure database user and password settings;create database:
```bash
mix ecto.create
mix ecto.migrate
```
Install dependencies:```bash
mix deps.get
```#### 4. Execute Application
Run server with:
```bash
mix phx.server
```Now you phoenix application is running in `http://localhost:4000`;
#### 5. Tests
run:
```bash
mix test
```## Install with docker
#### 1. Duplicate files `dev.secret.exs.example` and `test.secret.exs.example`:
```bash
cd blog
cp config/db/dev.secret.exs.example config/db/dev.secret.exs
cp config/db/test.secret.exs.example config/db/test.secret.exs
```Changes hostname to `"db"`
#### 2. Build and up application:
```bash
docker-compose build
docker-compose up
```Now you phoenix application is running in http://localhost:4000;
#### 3. Run tests
```bash
docker-compose run web mix test
```
## ContributeContributions are always welcome!
Please read the [contribution guidelines](contributing.md) first.