Skip to content

Commit c31a8f0

Browse files
committed
Merge branch 'release/0.2.0' into main
2 parents 93db992 + 9f7a210 commit c31a8f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+5366
-2286
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# http://editorconfig.org
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.json]
12+
insert_final_newline = unset
13+
14+
[**.min.js]
15+
indent_style = unset
16+
insert_final_newline = unset
17+
18+
[MakeFile]
19+
indent_style = space
20+
21+
[*.md]
22+
trim_trailing_whitespace = false

.env.example

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
1-
# Since the ".env" file is gitignored, you can use the ".env.example" file to
2-
# build a new ".env" file when you clone the repo. Keep this file up-to-date
3-
# when you add new variables to `.env`.
4-
5-
# This file will be committed to version control, so make sure not to have any
6-
# secrets in it. If you are cloning this repo, create a copy of this file named
7-
# ".env" and populate it with your secrets.
8-
9-
# When adding additional environment variables, the schema in "/src/env.js"
10-
# should be updated accordingly.
11-
NODE_ENV="development"
12-
PORT="3000"
13-
HOSTNAME="localhost"
14-
15-
# Prisma
16-
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
17-
DATABASE_URL="file:./db.sqlite"
18-
19-
# Next Auth
20-
# You can generate a new secret on the command line with:
21-
# openssl rand -base64 32
22-
# https://next-auth.js.org/configuration/options#secret
23-
# NEXTAUTH_SECRET=""
24-
NEXTAUTH_URL="http://localhost:3000"
25-
26-
# Next Auth Twitch Provider
27-
TWITCH_CLIENT_ID=""
28-
TWITCH_CLIENT_SECRET=""
1+
TZ=UTC
2+
PORT=3333
3+
HOST=localhost
4+
LOG_LEVEL=info
5+
APP_KEY=lTtQy5-Mp2Vl-lhSrc92tBLhWitA7JK8
6+
NODE_ENV=development
7+
SESSION_DRIVER=cookie
8+
DB_HOST=127.0.0.1
9+
DB_PORT=5432
10+
DB_USER=postgres
11+
DB_PASSWORD=
12+
DB_DATABASE=

.eslintrc.cjs

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitignore

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,25 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
1+
# Dependencies and AdonisJS build
2+
node_modules
3+
build
4+
tmp
25

3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# database
12-
/prisma/db.sqlite
13-
/prisma/db.sqlite-journal
6+
# Secrets
7+
.env
8+
.env.local
9+
.env.production.local
10+
.env.development.local
1411

15-
# next.js
16-
/.next/
17-
/out/
18-
next-env.d.ts
12+
# Frontend assets compiled code
13+
public/assets
1914

20-
# production
21-
/build
15+
# Build tools specific
16+
npm-debug.log
17+
yarn-error.log
2218

23-
# misc
24-
.DS_Store
25-
*.pem
19+
# Editors specific
20+
.fleet
2621
.idea
22+
.vscode
2723

28-
# debug
29-
npm-debug.log*
30-
yarn-debug.log*
31-
yarn-error.log*
32-
.pnpm-debug.log*
33-
34-
# local env files
35-
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
36-
.env
37-
.env*.local
38-
39-
# vercel
40-
.vercel
41-
42-
# typescript
43-
*.tsbuildinfo
44-
/.env.production
24+
# Platform specific
25+
.DS_Store

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [0.2.0] - 2024-05-01
4+
### Added
5+
- ~~Add i18n handling to the project with `next-intl`.~~
6+
- Switch project from `NextJS` to `AdonisJS`.
7+
38
## [0.1.1] - 2024-04-25
49
### Added
5-
- Add Socket.io to the project.

README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

ace.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
|--------------------------------------------------------------------------
3+
| JavaScript entrypoint for running ace commands
4+
|--------------------------------------------------------------------------
5+
|
6+
| DO NOT MODIFY THIS FILE AS IT WILL BE OVERRIDDEN DURING THE BUILD
7+
| PROCESS.
8+
|
9+
| See docs.adonisjs.com/guides/typescript-build-process#creating-production-build
10+
|
11+
| Since, we cannot run TypeScript source code using "node" binary, we need
12+
| a JavaScript entrypoint to run ace commands.
13+
|
14+
| This file registers the "ts-node/esm" hook with the Node.js module system
15+
| and then imports the "bin/console.ts" file.
16+
|
17+
*/
18+
19+
/**
20+
* Register hook to process TypeScript files using ts-node
21+
*/
22+
import { register } from 'node:module'
23+
register('ts-node/esm', import.meta.url)
24+
25+
/**
26+
* Import ace console entrypoint
27+
*/
28+
await import('./bin/console.js')

adonisrc.ts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import { defineConfig } from '@adonisjs/core/app'
2+
3+
export default defineConfig({
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Commands
7+
|--------------------------------------------------------------------------
8+
|
9+
| List of ace commands to register from packages. The application commands
10+
| will be scanned automatically from the "./commands" directory.
11+
|
12+
*/
13+
commands: [() => import('@adonisjs/core/commands'), () => import('@adonisjs/lucid/commands')],
14+
15+
/*
16+
|--------------------------------------------------------------------------
17+
| Service providers
18+
|--------------------------------------------------------------------------
19+
|
20+
| List of service providers to import and register when booting the
21+
| application
22+
|
23+
*/
24+
providers: [
25+
() => import('@adonisjs/core/providers/app_provider'),
26+
() => import('@adonisjs/core/providers/hash_provider'),
27+
{
28+
file: () => import('@adonisjs/core/providers/repl_provider'),
29+
environment: ['repl', 'test'],
30+
},
31+
() => import('@adonisjs/core/providers/vinejs_provider'),
32+
() => import('@adonisjs/core/providers/edge_provider'),
33+
() => import('@adonisjs/session/session_provider'),
34+
() => import('@adonisjs/vite/vite_provider'),
35+
() => import('@adonisjs/shield/shield_provider'),
36+
() => import('@adonisjs/static/static_provider'),
37+
() => import('@adonisjs/cors/cors_provider'),
38+
() => import('@adonisjs/lucid/database_provider'),
39+
() => import('@adonisjs/auth/auth_provider'),
40+
() => import('@adonisjs/inertia/inertia_provider'),
41+
() => import('@adonisjs/i18n/i18n_provider')
42+
],
43+
44+
/*
45+
|--------------------------------------------------------------------------
46+
| Preloads
47+
|--------------------------------------------------------------------------
48+
|
49+
| List of modules to import before starting the application.
50+
|
51+
*/
52+
preloads: [() => import('#start/routes'), () => import('#start/kernel')],
53+
54+
/*
55+
|--------------------------------------------------------------------------
56+
| Tests
57+
|--------------------------------------------------------------------------
58+
|
59+
| List of test suites to organize tests by their type. Feel free to remove
60+
| and add additional suites.
61+
|
62+
*/
63+
tests: {
64+
suites: [
65+
{
66+
files: ['tests/unit/**/*.spec(.ts|.js)'],
67+
name: 'unit',
68+
timeout: 2000,
69+
},
70+
{
71+
files: ['tests/functional/**/*.spec(.ts|.js)'],
72+
name: 'functional',
73+
timeout: 30000,
74+
},
75+
],
76+
forceExit: false,
77+
},
78+
79+
/*
80+
|--------------------------------------------------------------------------
81+
| Metafiles
82+
|--------------------------------------------------------------------------
83+
|
84+
| A collection of files you want to copy to the build folder when creating
85+
| the production build.
86+
|
87+
*/
88+
metaFiles: [
89+
{
90+
pattern: 'resources/views/**/*.edge',
91+
reloadServer: false,
92+
},
93+
{
94+
pattern: 'public/**',
95+
reloadServer: false,
96+
},
97+
{
98+
pattern: 'resources/lang/**/*.{json,yaml,yml}',
99+
reloadServer: false,
100+
}
101+
],
102+
103+
assetsBundler: false,
104+
unstable_assembler: {
105+
onBuildStarting: [() => import('@adonisjs/vite/build_hook')],
106+
},
107+
})

app/exceptions/handler.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import app from '@adonisjs/core/services/app'
2+
import { HttpContext, ExceptionHandler } from '@adonisjs/core/http'
3+
import type { StatusPageRange, StatusPageRenderer } from '@adonisjs/core/types/http'
4+
5+
export default class HttpExceptionHandler extends ExceptionHandler {
6+
/**
7+
* In debug mode, the exception handler will display verbose errors
8+
* with pretty printed stack traces.
9+
*/
10+
protected debug = !app.inProduction
11+
12+
/**
13+
* Status pages are used to display a custom HTML pages for certain error
14+
* codes. You might want to enable them in production only, but feel
15+
* free to enable them in development as well.
16+
*/
17+
protected renderStatusPages = app.inProduction
18+
19+
/**
20+
* Status pages is a collection of error code range and a callback
21+
* to return the HTML contents to send as a response.
22+
*/
23+
protected statusPages: Record<StatusPageRange, StatusPageRenderer> = {
24+
'404': (error, { inertia }) => inertia.render('errors/not_found', { error }),
25+
'500..599': (error, { inertia }) => inertia.render('errors/server_error', { error }),
26+
}
27+
28+
/**
29+
* The method is used for handling errors and returning
30+
* response to the client
31+
*/
32+
async handle(error: unknown, ctx: HttpContext) {
33+
return super.handle(error, ctx)
34+
}
35+
36+
/**
37+
* The method is used to report error to the logging service or
38+
* the a third party error monitoring service.
39+
*
40+
* @note You should not attempt to send a response from this method.
41+
*/
42+
async report(error: unknown, ctx: HttpContext) {
43+
return super.report(error, ctx)
44+
}
45+
}

0 commit comments

Comments
 (0)