Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Api Server #43

Draft
wants to merge 46 commits into
base: rewrite
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
734e7dd
feature: Api Server
l7ssha Dec 9, 2024
e9638bf
Add frontend
l7ssha Dec 10, 2024
bb87c2b
Release 4.10.0-dev.16
l7ssha Dec 10, 2024
fc50bbf
Handle static file properly
l7ssha Dec 10, 2024
3628bcb
Release 4.10.0-dev.17
l7ssha Dec 10, 2024
b3dd7ce
Fix handle static files properly
l7ssha Dec 10, 2024
8ef5619
Release 4.10.0-dev.18
l7ssha Dec 10, 2024
637f35a
Code review; Use Suspense
l7ssha Dec 11, 2024
4a9077a
Load lazy properly
l7ssha Dec 12, 2024
0258620
Improve lazy loading
l7ssha Dec 12, 2024
c710268
Release 4.10.0-dev.19
l7ssha Dec 12, 2024
ee11350
Release 4.10.0-dev.19
l7ssha Dec 12, 2024
e9c51d8
Validate jwt token expiration
l7ssha Dec 14, 2024
e6de0a2
Performance improvements; Remove axios
l7ssha Dec 14, 2024
83b0128
Release 4.10.0-dev.21
l7ssha Dec 14, 2024
d4efb65
Guild APIs progress
l7ssha Dec 15, 2024
4f8be69
reformat code
l7ssha Dec 15, 2024
04b73b7
Progress on guild details page
l7ssha Dec 16, 2024
982e0f9
Improve lazy loading
l7ssha Dec 16, 2024
7d80f4f
Guild features summary
l7ssha Dec 17, 2024
7814120
Proper cors handling; Extend Guild details page
l7ssha Dec 17, 2024
b8b0f5f
Release 4.10.0-dev.22
l7ssha Dec 17, 2024
bf42e61
Implement pagination
l7ssha Dec 18, 2024
30f55bd
Release 4.10.0-dev.23
l7ssha Dec 18, 2024
54d4f2f
format
l7ssha Dec 18, 2024
269488c
Code review
l7ssha Dec 18, 2024
01d24a8
Release 4.10.0-dev.24
l7ssha Dec 18, 2024
84b4cf7
Release 4.10.0-dev.25
l7ssha Dec 18, 2024
38df8d7
Fix pagination
l7ssha Dec 18, 2024
82674e8
Reqquire Jwt
l7ssha Dec 22, 2024
5d98caa
Release 4.10.0-dev.26
l7ssha Dec 22, 2024
d6c499f
Fetch user avatar and username
l7ssha Dec 22, 2024
76d83bf
Trailing new lines
l7ssha Dec 22, 2024
e007800
Add api call response cache
l7ssha Dec 22, 2024
56da131
Add eslint?
l7ssha Dec 22, 2024
14fbdd9
Release 4.10.0-dev.27
l7ssha Dec 22, 2024
348cbdd
Add rate limiter
l7ssha Dec 23, 2024
62198ff
Add cli; Add guild reminder endpoint; Refactor code
l7ssha Dec 23, 2024
4d393ef
Implement reminders panel
l7ssha Dec 25, 2024
45c0aac
Release 4.10.0-dev.28
l7ssha Dec 25, 2024
f0919d8
Add FeatureData element
l7ssha Dec 27, 2024
ac707b1
Allow server admins access their server dashboard
l7ssha Dec 28, 2024
2ea0fd1
Refactor protected elements handlingg
l7ssha Dec 29, 2024
644ad64
Form Dialog
l7ssha Dec 31, 2024
3caadd5
Add loading state
l7ssha Jan 1, 2025
ade5953
Rework filters
l7ssha Jan 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ build/
.idea/

lib_old/

**/node_modules/**
6 changes: 5 additions & 1 deletion .github/workflows/publish_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ jobs:
context: .
target: prod
push: true
build-args: |
REACT_APP_CLIENT_ID=${{ secrets.REACT_APP_CLIENT_ID }}
REACT_APP_REDIRECT_URL=${{ secrets.REACT_APP_REDIRECT_URL }}
REACT_APP_API_SERVER=${{ secrets.REACT_APP_API_SERVER }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Redeploy portainer
uses: muinmomin/webhook-action@v1.0.0
with:
url: ${{ secrets.ROD_PORTAINER_WEBHOOK }}
url: ${{ secrets.ROD_PORTAINER_WEBHOOK }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ doc/api/
*.db

sessions/

public/
!public/.gitkeep
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,29 @@ FROM build AS build_prod

RUN dart run nyxx_commands:compile bin/running_on_dart.dart -o bot

FROM node:lts-slim as build_frontend

ARG REACT_APP_CLIENT_ID
ARG REACT_APP_REDIRECT_URL
ARG REACT_APP_API_SERVER

ENV REACT_APP_CLIENT_ID=$REACT_APP_CLIENT_ID
ENV REACT_APP_REDIRECT_URL=$REACT_APP_REDIRECT_URL
ENV REACT_APP_API_SERVER=$REACT_APP_API_SERVER

WORKDIR /app

COPY ./frontend/ /app

RUN npm install
RUN npm run build

FROM scratch AS prod

WORKDIR /app

COPY --from=build_prod /runtime /
COPY --from=build_prod /app/templates /app/templates
COPY --from=build_prod /app/bot.exe /app
COPY --from=build_frontend /app/build /app/public

CMD [ "./bot.exe" ]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ run: ## Run dev project
upgrade: ## Run dart pub upgrade
dart pub upgrade

build-frontend-dev: ## Build dev frontend
cd frontend/; env-cmd -f .env.development.local yarn build
cp -r frontend/build/** public/

fix-project: fix analyze format ## Fix whole project

check-project: fix-project tests ## Run all checks
1 change: 0 additions & 1 deletion bin/running_on_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void main() async {
IgnoreExceptions(),
commands,
pagination,
SessionManagerPlugin(),
],
));

Expand Down
4 changes: 1 addition & 3 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
version: '3.9'
services:
running_on_dart:
image: ghcr.io/nyxx-discord/running_on_dart:4.10.0-dev.15
image: ghcr.io/nyxx-discord/running_on_dart:4.10.0-dev.21
container_name: running_on_dart
env_file:
- .env
depends_on:
- db
volumes:
- "rod_sessions:/sessions"
networks:
- internal
- nginx-proxy_default
Expand Down
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ services:
- "8088:8088"
depends_on:
- db
volumes:
- "./sessions:/sessions"
- "./templates:/templates"

db:
image: postgres:17
Expand Down
26 changes: 26 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.idea/
*.iml

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Loading
Loading