Skip to content

Commit e9cde96

Browse files
committed
Merge branch 'main' into feat/update-post
2 parents d1a7234 + 76fd813 commit e9cde96

File tree

361 files changed

+32026
-6506
lines changed

Some content is hidden

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

361 files changed

+32026
-6506
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
extends: ["custom"],
55
settings: {
66
next: {
7-
rootDir: ["apps/*/"],
7+
rootDir: ["apps/*/", "packages/*/"],
88
},
99
},
1010
parserOptions: {

.github/workflows/codeql.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
schedule:
20+
- cron: '44 14 * * 4'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners
29+
# Consider using larger runners for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
32+
permissions:
33+
# required for all workflows
34+
security-events: write
35+
36+
# only required for workflows in private repositories
37+
actions: read
38+
contents: read
39+
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
include:
44+
- language: javascript-typescript
45+
build-mode: none
46+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
47+
# Use `c-cpp` to analyze code written in C, C++ or both
48+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
49+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
50+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
51+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
52+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
53+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v4
57+
58+
# Initializes the CodeQL tools for scanning.
59+
- name: Initialize CodeQL
60+
uses: github/codeql-action/init@v3
61+
with:
62+
languages: ${{ matrix.language }}
63+
build-mode: ${{ matrix.build-mode }}
64+
# If you wish to specify custom queries, you can do so here or in a config file.
65+
# By default, queries listed here will override any specified in a config file.
66+
# Prefix the list here with "+" to use these queries and those in the config file.
67+
68+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
69+
# queries: security-extended,security-and-quality
70+
71+
# If the analyze step fails for one of the languages you are analyzing with
72+
# "We were unable to automatically build your code", modify the matrix above
73+
# to set the build mode to "manual" for that language. Then modify this step
74+
# to build your code.
75+
# ℹ️ Command-line programs to run using the OS shell.
76+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
77+
- if: matrix.build-mode == 'manual'
78+
run: |
79+
echo 'If you are using a "manual" build mode for one or more of the' \
80+
'languages you are analyzing, replace this with the commands to build' \
81+
'your code, for example:'
82+
echo ' make bootstrap'
83+
echo ' make release'
84+
exit 1
85+
86+
- name: Perform CodeQL Analysis
87+
uses: github/codeql-action/analyze@v3
88+
with:
89+
category: "/language:${{matrix.language}}"

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm format

README.md

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<p align="center">
22
<a href="https://codeforstartup.com/">
3-
<img style="width: 180px;" src="./apps/web/public/assets/logo.png">
4-
<h1 align="center">TOPLIST</h1>
3+
<img src="./images/home-screen.png">
4+
<h1 align="center" style="color: red">NEXT FORUM</h1>
55
</a>
66
</p>
77

8-
# About TOPLIST
9-
8+
# About next-forum
109

1110
# Installation
1211

1312
Install
13+
1414
```
1515
turbo install
1616
```
@@ -20,43 +20,69 @@ In the `apps/web` folder, copy the env.example to env.local and enter the enviro
2020
In the `packages/database`, copy the env.example to .env and enter the DATABASE_URL
2121

2222
Migration
23+
2324
```
2425
db:migrate
2526
```
2627

2728
Start
29+
2830
```
2931
turbo dev
3032
```
3133

3234
# Libraries
3335

34-
🤖 ReactJS
35-
🎯 TypeScript
36-
💫 NextJS 14 - App router and server actions
37-
🤗 Prisma
38-
🎰 React Form Hook
39-
🎭 Postgres
40-
🖋 Zod
41-
🎯 TailwindCSS
42-
🚀 Turborepo
43-
💒 Tiptap
44-
🍾 react-textarea-autosize
45-
36+
- ReactJS
37+
- TypeScript
38+
- NextJS 14 - App router and server actions
39+
- next-auth
40+
- Prisma ORM
41+
- Postgres
42+
- Turborepo
43+
- TailwindCSS
44+
- shadcn
45+
- next-themes
46+
- Zod validation
47+
- React Form Hook
48+
- Tsup
49+
- EditorJs
50+
- react-toastify
51+
- react-textarea-autosize
52+
- lucide-react icon
53+
- dayjs
54+
- Eslint
55+
- Husky
56+
- Prettier
4657

4758
# Functions
4859

49-
- [x] Login
50-
- [x] Logout
51-
- [x] Register
52-
- [x] Verify email
53-
- [x] Forgot password
60+
## Front side functions
61+
62+
- [x] Register by email or github
63+
- [x] Login by email, github or magic link
64+
- [x] User logout
5465
- [x] CRUD post
55-
- [x] List post/Filter
56-
- [ ] Like post
57-
- [ ] Comment post
58-
- [ ] Manage tags
59-
- [ ] Follow user
66+
- [x] List post: Search & filter by top or hot week, month, year, infinity
67+
- [x] Like post
68+
- [x] Comment on post
69+
- [x] Share post
70+
- [x] Manage tag
71+
- [x] Follow user
72+
- [x] Multiple theme & dark mode or light mode
73+
- [x] Multiple language
74+
- [x] Follow tag
75+
- [x] Manage user profile
76+
- [ ] Multiple type: post/question
77+
78+
## Admin functions
79+
80+
- [x] Dashboard
81+
- [x] CRUD tags
82+
- [ ] CRUD users
83+
- [ ] Manage posts
84+
- [ ] Manage images
85+
- [ ] Settings: Header/Menu
6086

6187
# DEV NOTES
6288

apps/admin/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["custom"],
4+
parserOptions: {
5+
babelOptions: {
6+
presets: [require.resolve('next/babel')],
7+
},
8+
},
9+
};

apps/admin/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

apps/admin/@/constants/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as routers from "./routes"
2+
3+
export const DEFAULT_TAG_PAGE_LIMIT = 40
4+
5+
export const DEFAULT_PAGE_LIMIT = 20
6+
7+
export { routers }

apps/admin/@/constants/order.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export enum ORDER_BY {
2+
created_at_asc = "created_at_asc",
3+
created_at_desc = "created_at_desc",
4+
updated_at_asc = "updated_at_asc",
5+
updated_at_desc = "updated_at_desc",
6+
total_like_asc = "total_like_asc",
7+
total_like_desc = "total_like_desc",
8+
total_comment_asc = "total_comment_asc",
9+
total_comment_desc = "total_comment_desc",
10+
// total_view_asc = "total_view_asc",
11+
// total_view_desc = "total_view_desc",
12+
}

apps/admin/@/constants/routes.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
const APP_ROUTES = {
2+
DASHBOARD: "/",
3+
4+
POST: {
5+
LIST: "/posts",
6+
DETAIL: "/posts/:id",
7+
ADD: "/posts/add",
8+
EDIT: "/posts/edit/:id",
9+
},
10+
11+
TAG: {
12+
LIST: "/tags",
13+
DETAIL: "/tags/:id",
14+
ADD: "/tags/add",
15+
EDIT: "/tags/edit/:id",
16+
},
17+
18+
ASSETS: {
19+
LIST: "/assets",
20+
DETAIL: "/assets/:id",
21+
ADD: "/assets/add",
22+
EDIT: "/assets/edit/:id",
23+
},
24+
25+
CATEGORY: {
26+
LIST: "/categories",
27+
DETAIL: "/categories/:id",
28+
ADD: "/categories/add",
29+
EDIT: "/categories/edit/:id",
30+
},
31+
32+
USER: {
33+
LIST: "/users",
34+
DETAIL: "/users/:id",
35+
ADD: "/users/add",
36+
EDIT: "/users/edit/:id",
37+
},
38+
39+
ROLE: {
40+
LIST: "/roles",
41+
DETAIL: "/roles/:id",
42+
ADD: "/roles/add",
43+
EDIT: "/roles/edit/:id",
44+
},
45+
46+
PERMISSION: {
47+
LIST: "/permissions",
48+
DETAIL: "/permissions/:id",
49+
ADD: "/permissions/add",
50+
EDIT: "/permissions/edit/:id",
51+
},
52+
53+
SETTINGS: {
54+
LIST: "/settings",
55+
DETAIL: "/settings/:id",
56+
ADD: "/settings/add",
57+
EDIT: "/settings/edit/:id",
58+
},
59+
60+
LOGIN: "/login",
61+
FORGOT_PASSWORD: "/forgot-password",
62+
RESET_PASSWORD: "/reset-password",
63+
REGISTER: "/register",
64+
PROFILE: "/profile",
65+
PROFILE_EDIT: "/profile/edit",
66+
67+
NOT_FOUND: "/404",
68+
SERVER_ERROR: "/500",
69+
UNAUTHORIZED: "/401",
70+
FORBIDDEN: "/403",
71+
}
72+
73+
export default APP_ROUTES

apps/admin/@/font/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Bebas_Neue } from "next/font/google"
2+
3+
export const bebasNeue = Bebas_Neue({
4+
display: "swap",
5+
weight: "400",
6+
subsets: ["latin"],
7+
})

0 commit comments

Comments
 (0)