Skip to content

Commit

Permalink
Merge pull request #45 from ElectroAAC/feature/docker
Browse files Browse the repository at this point in the history
feat: added docker
  • Loading branch information
WalistonBelles authored Nov 20, 2022
2 parents 3993c43 + 4d12c2d commit 0c742a4
Show file tree
Hide file tree
Showing 12 changed files with 5,132 additions and 55 deletions.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ This repository follows the semantic commit pattern, with the addition of the ta

<br>

## 👨🏾‍💻 Build Setup

```bash
# Create containers, the api will open on port 3333 while the web_app will be on port 3000
$ docker-compose up --build

# go to paste
$ cd api

# Create your .env file using .env.example as an example

# Install Dependencies
$ yarn install

# Create database structure
$ node ace migration:run
$ node ace db:seed
```

<br>

## Contributing

Contributions are more than welcome.
Expand All @@ -98,8 +119,9 @@ Pull requests should be made to the <strong>develop</strong> branch as that is t

## 👨🏾‍💻 Techs

<h3> Front-end </h3>
<br>

<h3> Front-end </h3>
<ul>
<li> Vue.js </li>
<ul>
Expand Down
10 changes: 10 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:16-alpine

WORKDIR /home/backend
COPY package*.json yarn.* ./
RUN chown -R root:root /home/backend/
RUN yarn install
COPY . .

EXPOSE 3333
CMD [ "yarn", "dev" ]
6 changes: 3 additions & 3 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# go to paste
$ cd backend

# Create container with MySQL
$ docker-compose up -d

# Create your .env file using .env.example as an example

# Create your api_key
$ node ace generate:key

# install dependencies
$ npm install

Expand Down
2 changes: 0 additions & 2 deletions backend/app/Controllers/Guilds/PlayersWithoutGuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export default class PlayersWithoutGuildController {

const characters_without_guild = await this.guildView.getCharactersWithoutGuild(account.id);

console.log(characters_without_guild);

const characters_with_guild: any = [];

characters_account.forEach((character: any) => {
Expand Down
6 changes: 3 additions & 3 deletions backend/app/Policies/Dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Account from 'App/Models/Account'
import Role from 'Contracts/enums/Role'

export default class Dashboard extends BasePolicy {
public async before(account: Account | null) {
if (account?.type === Role.ADMIN)
public async before(account: Account) {
if (account.type >= Role.ADMIN)
return true;
}

public async admin(account: Account) {
if (account.type === Role.ADMIN)
if (account.type >= Role.ADMIN)
return true;
}
}
2 changes: 1 addition & 1 deletion backend/contracts/enums/Role.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enum Role {
USER = 1,
ADMIN = 6
ADMIN = 5
}

export default Role;
30 changes: 0 additions & 30 deletions backend/default_schema_mariadb.sql

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions backend/docker-compose.yml

This file was deleted.

Loading

0 comments on commit 0c742a4

Please sign in to comment.