Skip to content

Commit

Permalink
Merge pull request #37 from Badminton-Apps/feat/import_teams_from_com…
Browse files Browse the repository at this point in the history
…petition

Feat/import teams from competition
  • Loading branch information
cskiwi authored Feb 15, 2021
2 parents 285db5c + 02970cc commit bd14fe8
Show file tree
Hide file tree
Showing 132 changed files with 22,093 additions and 17,517 deletions.
54 changes: 50 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,58 @@ Starting from root: `code/backend`

- Install pacakges: `lerna bootstrap`
- Rename all `.env.example` to `.env` and fill in with your values
- Populate data from: `rnd/initial_db.zip`

_eg: `psql "host=localhost port=5432 dbname=ranking user=ranking password=pass" < initial_db.sql`_

- extract data from: `rnd/initial_db.zip`
- Import it via: `psql "host=localhost port=5432 dbname=ranking user=ranking password=pass" < initial_db.sql`_
- Start server: `yarn start`

### OPTIONAL: Debugging
Debugging can be done via `yarn start:inspect` from `code/backend`

If using vscode the following `launch.json` can be used
```js
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Import",
"port": 5858,
"restart": true,
"protocol": "auto",
"stopOnEntry": false
},
{
"type": "node",
"request": "attach",
"name": "Server",
"port": 5859,
"restart": true,
"protocol": "auto",
"stopOnEntry": false
},
{
"type": "node",
"request": "attach",
"name": "Simulate",
"port": 5860,
"restart": true,
"protocol": "auto",
"stopOnEntry": false
}
],
"compounds": [
{
"name": "Full server",
"configurations": ["Import", "Server", "Simulate"],
}
]
}
```

## Contributing

### Contributing Guidelines
Expand Down
9 changes: 4 additions & 5 deletions code/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
},
"dependencies": {
"@supercharge/promise-pool": "^1.2.0",
"@types/bluebird": "^3.5.32",
"@types/jest": "^25.2.1",
"@types/morgan": "^1.9.2",
"@types/node": "14.14.5",
"@types/validator": "^13.1.0",
"@types/node": "^14.14.22",
"@types/validator": "^13.1.3",
"apollo-server": "2.14.2",
"apollo-server-testing": "2.11.0",
"async": "^3.2.0",
Expand All @@ -44,8 +43,8 @@
"pg": "^8.0.0",
"pg-hstore": "^2.3.3",
"reflect-metadata": "^0.1.13",
"sequelize": "cskiwi/sequelize#v5",
"sequelize-typescript": "^1.1.0",
"sequelize": "^6.5.0",
"sequelize-typescript": "^2.0.0",
"sqlite3": "^4.1.1",
"tslint": "^6.1.3",
"zip-stream": "^4.0.2"
Expand Down
6 changes: 4 additions & 2 deletions code/backend/packages/_shared/app.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// import { typeDefs } from './schema';
import { logger } from '@badvlasim/shared';
import cors from 'cors';
import morgan from 'morgan';
import moment from 'moment';
import express, { Application, json } from 'express';
import { createProxyMiddleware } from 'http-proxy-middleware';
import { BaseController } from './models';

moment.suppressDeprecationWarnings = true;

export class App {
public app: Application;
public port: number;
Expand Down Expand Up @@ -96,7 +98,7 @@ export class App {

public listen() {
this.app.listen(this.port, () => {
logger.info(`App listening on the port ${this.port}`);
logger.info(`🚀 App listening on the port ${this.port}`);
});
}
}
3 changes: 2 additions & 1 deletion code/backend/packages/_shared/database/database.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = {
username: process.env.DB_USER,
password: process.env.DB_PASSWORD,
dialect: process.env.DB_DIALECT,
migrationStorageTableSchema: 'public',
migrationStorageTableSchema: 'public',
logging: false,
retry: {
max: retries,
timeout: 30000
Expand Down
Loading

0 comments on commit bd14fe8

Please sign in to comment.