Skip to content

Commit

Permalink
Merge pull request #131 from dump-hr/app-cleanup
Browse files Browse the repository at this point in the history
app cleanup
  • Loading branch information
bdeak4 authored Jan 25, 2024
2 parents f710541 + 56347b6 commit 4aa05f1
Show file tree
Hide file tree
Showing 359 changed files with 3,536 additions and 7,727 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.turbo
.turbo
.env.local
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:

- name: Build frontend web apps
run: yarn build --filter=admin... --filter=sponsor...
# TODO: web

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:

- name: Build frontend web apps
run: yarn build --filter=admin... --filter=sponsor...
# TODO: web

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
46 changes: 43 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,48 @@ on:
workflow_dispatch:

jobs:
eslint_web:
name: Run ESLint (web)
# eslint_web:
# name: Run ESLint (web)
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: 18.x
# cache: 'yarn'

# - name: Install dependencies
# run: yarn install --immutable

# - name: Run ESLint
# run: yarn workspace web run lint

eslint_sponsor:
name: Run ESLint (sponsor)
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Run ESLint
run: yarn workspace sponsor run lint

eslint_admin:
name: Run ESLint (admin)
runs-on: ubuntu-latest

steps:
Expand All @@ -23,7 +63,7 @@ jobs:
run: yarn install --immutable

- name: Run ESLint
run: yarn workspace web run lint
run: yarn workspace admin run lint

eslint_api:
name: Run ESLint (api)
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
.turbo
.env.local
dist
14 changes: 7 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"eslint.workingDirectories": [{ "mode": "auto" }],
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
}
}
"eslint.workingDirectories": [{ "mode": "auto" }],
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
}
}
26 changes: 10 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<h1 align="center">DUMP Days App</h1>

DUMP Days App
Env | CI status
---------- | ---------
Production | ![Deploy](https://github.com/dump-hr/ddays-app/actions/workflows/deploy.yml/badge.svg?branch=main) ![Lint](https://github.com/dump-hr/ddays-app/actions/workflows/lint.yml/badge.svg?branch=main)

## Development

Expand All @@ -11,16 +13,12 @@ DUMP Days App

#### Setup environment

1. Run `docker compose up` in separate terminal or follow steps below if you already have postgres server running locally.

If you use local postgres db server, create manually new database named `ddays`
1. Run `docker compose up` in separate terminal or follow steps below if you already have postgres server running locally.

If you use local postgres db server, create manually new database named `ddays-app`

2. Create `.env.local` file that can override configuration options from `.env` in web/api apps.

Add required env variables for `api`:
- `DATABASE_URL`

#### Install dependencies

Run command from workspace level
Expand All @@ -32,28 +30,24 @@ yarn
#### Generate new database migrations (after adding models)

```
yarn generate
yarn db:generate
```

#### Run database migrations

```
yarn migrate
yarn db:migrate
```

#### Run database seed

```
//todo
```
or just restart development server

#### Run app
#### Run development server

```
yarn dev
```

App is now accessible on <http://localhost:5173/>. API routes are prefixed with `/api`.
App is now accessible on <http://localhost:3000/>. API routes are prefixed with `/api`, Admin app is prefixed with `/admin` and Sponsor app is prefixed with `/sponsor`.

## Cookbook

Expand Down
2 changes: 1 addition & 1 deletion apps/admin/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_MSAL_CLIENT_ID='c98e2d15-0979-4dbe-96d1-f8afa75b9207'
VITE_MSAL_CLIENT_ID=c98e2d15-0979-4dbe-96d1-f8afa75b9207
4 changes: 2 additions & 2 deletions apps/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>DUMP Days Admin</title>
<!-- TODO: ubacit react helmet i titleove po pageu kao u sponsor appu -->
</head>
<body>
<div id="root"></div>
Expand Down
4 changes: 2 additions & 2 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
"dependencies": {
"@azure/msal-browser": "^3.6.0",
"@azure/msal-react": "^2.0.8",
"@hookform/resolvers": "^3.3.4",
"axios": "^1.6.2",
"clsx": "^2.0.0",
"date-fns": "^3.0.0",
Expand Down
1 change: 0 additions & 1 deletion apps/admin/public/vite.svg

This file was deleted.

27 changes: 4 additions & 23 deletions apps/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@ import { useMsalAuthentication } from '@azure/msal-react';
import { Toaster } from 'react-hot-toast';
import { Route, Switch } from 'wouter';

import Layout from './components/Layout';
import { Layout } from './components/Layout';
import { Path } from './constants/paths';
import AchievementsPage from './pages/AchievementsPage';
import CompaniesPage from './pages/CompaniesPage';
import EventsPage from './pages/EventsPage';
import FrequentlyAskedQuestionPage from './pages/FrequentlyAskedQuestion';
import GuestPage from './pages/GuestPage';
import HomePage from './pages/HomePage';
import InterestsPage from './pages/InterestsPage';
import NotificationsPage from './pages/NotificationsPage/NotificationsPage';
import SurveyQuestionsPage from './pages/SurveyQuestionsPage';
import { CompanyPage } from './pages/CompanyPage';
import { HomePage } from './pages/HomePage';

export const App = () => {
useMsalAuthentication(InteractionType.Redirect);
Expand All @@ -25,22 +18,10 @@ export const App = () => {
<Layout>
<Switch>
<Route path={Path.Home} component={HomePage} />
<Route path={Path.Guest} component={GuestPage} />˝
<Route path={Path.Events} component={EventsPage} />
<Route path={Path.Achievements} component={AchievementsPage} />
<Route path={Path.Interests} component={InterestsPage} />
<Route
path={Path.FrequentlyAskedQuestions}
component={FrequentlyAskedQuestionPage}
/>
<Route path={Path.SurveyQuestions} component={SurveyQuestionsPage} />
<Route path={Path.Notifications} component={NotificationsPage} />
<Route path={Path.Companies} component={CompaniesPage} />
<Route path={Path.Company} component={CompanyPage} />
</Switch>
</Layout>
<Toaster />
</>
);
};

export default App;
30 changes: 0 additions & 30 deletions apps/admin/src/api/Companies/useCreateCompany.ts

This file was deleted.

11 changes: 0 additions & 11 deletions apps/admin/src/api/Companies/useFetchCompanies.ts

This file was deleted.

15 changes: 0 additions & 15 deletions apps/admin/src/api/Companies/useFetchCompany.ts

This file was deleted.

33 changes: 0 additions & 33 deletions apps/admin/src/api/Companies/useUpdateComapny.ts

This file was deleted.

30 changes: 0 additions & 30 deletions apps/admin/src/api/Interests/useCreateInterest.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/admin/src/api/Interests/useDeleteInterest.ts

This file was deleted.

Loading

0 comments on commit 4aa05f1

Please sign in to comment.