Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
9e0d1bf
studio: init shadcn ts vite
surajmn1 Feb 18, 2025
ffebc73
web: update shadcn theme
surajmn1 Feb 19, 2025
6e2a740
add routing and sidebar to the application
rapoler Feb 19, 2025
3cbaad1
studio: use react router v6
surajmn1 Feb 19, 2025
c1c5e21
add redux and ratings
rapoler Feb 21, 2025
c137ea1
resolve merge conflicts
rapoler Feb 21, 2025
0238c6a
resolve merge conflicts
rapoler Feb 21, 2025
e6f5661
resolve merge conflicts
rapoler Feb 21, 2025
b118ad3
Merge pull request #997 from factly/feat/shadcn/sidebar
surajmn1 Feb 24, 2025
e06d2c7
Merge pull request #998 from factly/feat/shadcn/ratings
surajmn1 Feb 24, 2025
0df33e8
Merge branch 'feat/customlogin' into feat/studio/shadcn
surajmn1 Feb 24, 2025
6ec8082
add authentication pages
rapoler Feb 24, 2025
7cd11d9
add organisation and space pages
rapoler Feb 26, 2025
25f27e5
add ratings page
rapoler Mar 3, 2025
da96c67
add settings page
rapoler Mar 5, 2025
e5f1fff
add claimants page
rapoler Mar 6, 2025
9a44b46
add claims page
rapoler Mar 10, 2025
015d3c0
add tags page
rapoler Mar 10, 2025
099c767
Merge pull request #1000 from factly/feat/shadcn/authenticationpages
shreeharsha-factly Mar 10, 2025
12a2167
add categories page
rapoler Mar 11, 2025
1c522cf
Merge pull request #1007 from factly/feat/shadcn/categories
shreeharsha-factly Mar 18, 2025
c26ce3f
add factchecks page
rapoler Mar 18, 2025
b3c4ba2
add posts page
rapoler Mar 20, 2025
e7bebf4
add pages page
rapoler Mar 20, 2025
dd22bed
make all necessary design chnages ,add dashboard
rapoler Mar 27, 2025
124dc95
Merge pull request #1011 from factly/feat/shadcn/dashb
shreeharsha-factly Mar 27, 2025
b67e445
make all necessary fixes
rapoler Apr 1, 2025
0fe3ad9
make all necessary fixes
rapoler Apr 1, 2025
33ca769
make all necessary fixes
rapoler Apr 1, 2025
d8dbb79
add sidebar from shadcn
Apr 1, 2025
a366053
highlight active item
Apr 1, 2025
8db5012
add mobile page to categories
rapoler Apr 1, 2025
64a36d9
add mobile page to categories
rapoler Apr 1, 2025
379954d
icon changes
Apr 1, 2025
0fcd9cb
fix styles
Apr 1, 2025
e5201d1
add mobile page to categories
rapoler Apr 1, 2025
8875a3b
fix styles
Apr 1, 2025
7b958c2
add mobile page to categories
rapoler Apr 1, 2025
2f9702a
Merge branch 'mobile/pages' into feat/shadcn/mobile/categories
Apr 1, 2025
c9c481a
add mobile page to categories
rapoler Apr 2, 2025
e6ab746
add mobile page to tags
rapoler Apr 2, 2025
e569c9d
add mobile page to media
rapoler Apr 2, 2025
040d059
clean up and mobile changes
Apr 2, 2025
1c3b7f6
add mobile page code clean up
rapoler Apr 2, 2025
62e6ea6
fix pagination
Apr 2, 2025
3f73df1
Merge pull request #1015 from factly/feat/mobile-pages
ishpaul777 Apr 2, 2025
cdd67f1
refactor claims
Apr 2, 2025
dbbdf85
pagination styles
Apr 3, 2025
fadb3b3
make changes to the core pages
rapoler Apr 3, 2025
4999a9c
make changes to the settings pages
rapoler Apr 4, 2025
8853269
fix fact checking mobile page
Apr 7, 2025
9449fa4
Merge pull request #1018 from factly/fact-check-pages
rapoler Apr 7, 2025
b07e35b
fix colors
Apr 7, 2025
823dbdd
Merge pull request #1019 from factly/fact-check-pages
rapoler Apr 7, 2025
79a2352
fix heading and font size
Apr 7, 2025
5ee2da6
Merge pull request #1020 from factly/fact-check-pages
rapoler Apr 7, 2025
c231461
make changes required
rapoler Apr 7, 2025
54c81c7
Merge pull request #1021 from factly/feat/shadcn/mobile/core-pages
rapoler Apr 7, 2025
43b16e2
design changes
rapoler Apr 8, 2025
55a23d8
add sorting
Apr 9, 2025
3c078f1
fix width
Apr 9, 2025
1828a43
fix width of modal
Apr 9, 2025
fc68adb
add unauthorised secured button to the application
rapoler Apr 9, 2025
341c373
Merge pull request #1023 from factly/feat/shadcn/securedbutton
rapoler Apr 9, 2025
4e087f5
make design changes to menu form
rapoler Apr 10, 2025
2ff26dd
fix infinite loading issue
rapoler Apr 10, 2025
751ea93
fix type errors in claim and claimants pages
rapoler Apr 11, 2025
7a22eb6
fix types for pages entity
Apr 11, 2025
326782c
studio : update deps
surajmn1 Apr 11, 2025
f8bd4f3
studio : remove comment
surajmn1 Apr 11, 2025
35c6a2a
Merge pull request #1027 from factly/fix/scooter-issues
rapoler Apr 14, 2025
b6b96d1
fix post entity types -1
Apr 14, 2025
9b59353
merge upstream
Apr 14, 2025
842585a
fix post entity types -2
Apr 14, 2025
e7da59f
fix type errors
rapoler Apr 14, 2025
54dc3b2
Merge pull request #1028 from factly/feat/shadcn/typefixes
rapoler Apr 14, 2025
3488a06
add description input to required pages
rapoler Apr 15, 2025
b63b668
Merge pull request #1030 from factly/feat/shadcn/adddescriptionInput
rapoler Apr 15, 2025
0f6dab7
fix categories type and refactoring
Apr 15, 2025
168ce71
fix tags type and refactoring
Apr 15, 2025
ee3f80f
fix fact check reload error
rapoler Apr 15, 2025
eaa7583
make others tab as an accordion trigger
rapoler Apr 15, 2025
105736f
Merge pull request #1032 from factly/feat/shadcn/adddescriptionInput
rapoler Apr 15, 2025
c77ecd7
resolve merge conflicts
rapoler Apr 15, 2025
6f20d14
Merge pull request #1026 from factly/fix-types
rapoler Apr 15, 2025
c8ecc0d
remove sort by asc/desc
rapoler Apr 16, 2025
f394fa6
fix media type
Apr 16, 2025
ccc122e
remove sort by asc/desc
rapoler Apr 16, 2025
f595b37
Merge pull request #1033 from factly/fix/type-errors
rapoler Apr 16, 2025
fb601b9
merge main
Apr 16, 2025
082ab53
merge stashed
Apr 16, 2025
77fea75
merge stash conflicts
Apr 16, 2025
43c96e4
resolve merge conflicts
rapoler Apr 16, 2025
a32af42
Merge pull request #1035 from factly/fix-types
rapoler Apr 16, 2025
8e2da20
resolve merge conflicts
rapoler Apr 16, 2025
a3d0280
resolve merge conflicts
rapoler Apr 16, 2025
ba36e0e
add skeleton loading
rapoler Apr 17, 2025
59c0a63
add design fixes
rapoler Apr 17, 2025
c9773a0
add design fixes
rapoler Apr 21, 2025
aeb928e
add design fixes
rapoler Apr 21, 2025
d0e08d0
server : check keys html json in description field
surajmn1 Apr 23, 2025
b5167da
studio : docker related changes
surajmn1 Apr 23, 2025
a9f2dd8
studio: change dir studio-shadcn to studio
surajmn1 Apr 23, 2025
ca7267f
Merge pull request #1038 from factly/move/dir/studio-shacn-to-studio
shreeharsha-factly Apr 23, 2025
92f65c3
web: resolve merge conflicts
shreeharsha-factly Apr 23, 2025
ba32bdd
web: add related urls section
shreeharsha-factly May 1, 2025
46b3bb7
server: remove iframely hosted api key
shreeharsha-factly May 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,14 @@ services:
args:
- CACHEBUST
environment:
- PUBLIC_URL=http://127.0.0.1:3000
- PUBLIC_URL=http://127.0.0.1:5173
- REACT_APP_SACH_API_URL=https://sach-server.factly.in
- WDS_SOCKET_HOST=127.0.0.1
- VITE_WS_HOST=127.0.0.1
- CHOKIDAR_USEPOLLING=true
- WATCHPACK_POLLING=true
- NODE_ENV=development
ports:
- "3000:3000"
- "5173:5173"
volumes:
- type: bind
source: ./studio
Expand Down
2 changes: 1 addition & 1 deletion server/service/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func RegisterRoutes() http.Handler {

if viper.IsSet("mode") && viper.GetString("mode") == "development" {
r.Use(cors.Handler(cors.Options{
AllowedOrigins: []string{"http://localhost:3000"},
AllowedOrigins: []string{"http://localhost:3000", "http://localhost:5173"},
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowedHeaders: []string{"*"},
ExposedHeaders: []string{"*"},
Expand Down
37 changes: 33 additions & 4 deletions server/util/scooter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package util

import (
"encoding/json"
"errors"
"strings"

"github.com/jinzhu/gorm/dialects/postgres"
)
Expand All @@ -11,20 +13,47 @@ type Description struct {
JSON postgres.Jsonb
}

func hasKeyCaseInsensitive(data map[string]json.RawMessage, key string) bool {
for k := range data {
if strings.EqualFold(k, key) {
return true
}
}
return false
}

func GetDescriptionHTML(jsonData postgres.Jsonb) (string, error) {
var raw map[string]json.RawMessage
if err := json.Unmarshal(jsonData.RawMessage, &raw); err != nil {
return "", err
}

if !hasKeyCaseInsensitive(raw, "html") || !hasKeyCaseInsensitive(raw, "json") {
return "", errors.New("missing required fields 'html' or 'json'")
}

var description Description
err := json.Unmarshal(jsonData.RawMessage, &description)
if err != nil {
if err := json.Unmarshal(jsonData.RawMessage, &description); err != nil {
return "", err
}

return description.HTML, nil
}

func GetJSONDescription(jsonData postgres.Jsonb) (postgres.Jsonb, error) {
var raw map[string]json.RawMessage
if err := json.Unmarshal(jsonData.RawMessage, &raw); err != nil {
return postgres.Jsonb{}, err
}

if !hasKeyCaseInsensitive(raw, "html") || !hasKeyCaseInsensitive(raw, "json") {
return postgres.Jsonb{}, errors.New("missing required fields 'html' or 'json'")
}

var description Description
err := json.Unmarshal(jsonData.RawMessage, &description)
if err != nil {
if err := json.Unmarshal(jsonData.RawMessage, &description); err != nil {
return postgres.Jsonb{}, err
}

return description.JSON, nil
}
5 changes: 0 additions & 5 deletions studio/ .dockerignore

This file was deleted.

24 changes: 24 additions & 0 deletions studio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 0 additions & 1 deletion studio/.npmrc

This file was deleted.

2 changes: 0 additions & 2 deletions studio/.prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions studio/.prettierrc

This file was deleted.

76 changes: 0 additions & 76 deletions studio/CODE_OF_CONDUCT.md

This file was deleted.

26 changes: 14 additions & 12 deletions studio/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# pull official base image
# Use Node.js LTS version
FROM node:18-alpine

# set working directory
ARG CACHEBUST=100

# Set working directory
WORKDIR /app

# install app dependencies
COPY package.json ./
COPY package-lock.json ./
# Copy package files
COPY package.json package-lock.json* ./

# Install dependencies
RUN npm install --legacy-peer-deps

# add app
COPY . ./
EXPOSE 3000
# start app
CMD ["npm", "start"]
# Copy all files
COPY . .

# Expose Vite's default port
EXPOSE 5173

# Start Vite development server with host flag
CMD ["npm", "run", "dev", "--", "--host"]
2 changes: 1 addition & 1 deletion studio/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN npm run build

# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
22 changes: 0 additions & 22 deletions studio/LICENSE

This file was deleted.

81 changes: 50 additions & 31 deletions studio/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
# Dega Admin Portal

### Setup:

Clone the repo: `git clone https://github.com/factly/dega-studio.git`<br />
Install dependencies: `npm i`

### To start the development server:<br />

`npm start` from the root of the folder <br />
Opens in [http://localhost:3000](http://localhost:3000)

### To run tests:<br />

`npm test`

### To generate test coverage:<br />

`npm test -- --coverage`<br />
Generates a `coverage` folder. Open `index.html` in browser.

### To build code for production:<br />

`npm run build`<br />
Bundles React in production mode and optimizes the build for the best performance.

**Releasability:** [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=alert_status)](https://sonarcloud.io/dashboard?id=factly_dega-studio)
**Reliability:** [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=factly_dega-studio) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=bugs)](https://sonarcloud.io/dashboard?id=factly_dega-studio)
**Security:** [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=security_rating)](https://sonarcloud.io/dashboard?id=factly_dega-studio) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=factly_dega-studio)
**Maintainability:** [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=factly_dega-studio) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=sqale_index)](https://sonarcloud.io/dashboard?id=factly_dega-studio) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=code_smells)](https://sonarcloud.io/dashboard?id=factly_dega-studio)
**Other:** [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=ncloc)](https://sonarcloud.io/dashboard?id=factly_dega-studio) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=factly_dega-studio) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=factly_dega-studio&metric=coverage)](https://sonarcloud.io/dashboard?id=factly_dega-studio)
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
1 change: 0 additions & 1 deletion studio/commitlint.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions studio/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/App.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
9 changes: 0 additions & 9 deletions studio/e2e_tests/.gitignore

This file was deleted.

Loading
Loading