chainr-ai commited on
Commit
4888678
·
verified ·
1 Parent(s): 22dd5b5

Upload 8536 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. Dockerfile.backend +30 -0
  2. Dockerfile.frontend +27 -0
  3. README.md +41 -0
  4. backend/.env.example +9 -0
  5. backend/node_modules/.bin/browserslist +3 -0
  6. backend/node_modules/.bin/browserslist.cmd +3 -0
  7. backend/node_modules/.bin/browserslist.ps1 +3 -0
  8. backend/node_modules/.bin/create-jest +3 -0
  9. backend/node_modules/.bin/create-jest.cmd +3 -0
  10. backend/node_modules/.bin/create-jest.ps1 +3 -0
  11. backend/node_modules/.bin/esparse +3 -0
  12. backend/node_modules/.bin/esparse.cmd +3 -0
  13. backend/node_modules/.bin/esparse.ps1 +3 -0
  14. backend/node_modules/.bin/esvalidate +3 -0
  15. backend/node_modules/.bin/esvalidate.cmd +3 -0
  16. backend/node_modules/.bin/esvalidate.ps1 +3 -0
  17. backend/node_modules/.bin/import-local-fixture +3 -0
  18. backend/node_modules/.bin/import-local-fixture.cmd +3 -0
  19. backend/node_modules/.bin/import-local-fixture.ps1 +3 -0
  20. backend/node_modules/.bin/jest +3 -0
  21. backend/node_modules/.bin/jest.cmd +3 -0
  22. backend/node_modules/.bin/jest.ps1 +3 -0
  23. backend/node_modules/.bin/js-yaml +3 -0
  24. backend/node_modules/.bin/js-yaml.cmd +3 -0
  25. backend/node_modules/.bin/js-yaml.ps1 +3 -0
  26. backend/node_modules/.bin/jsesc +3 -0
  27. backend/node_modules/.bin/jsesc.cmd +3 -0
  28. backend/node_modules/.bin/jsesc.ps1 +3 -0
  29. backend/node_modules/.bin/json5 +3 -0
  30. backend/node_modules/.bin/json5.cmd +3 -0
  31. backend/node_modules/.bin/json5.ps1 +3 -0
  32. backend/node_modules/.bin/mime +3 -0
  33. backend/node_modules/.bin/mime.cmd +3 -0
  34. backend/node_modules/.bin/mime.ps1 +3 -0
  35. backend/node_modules/.bin/mkdirp +3 -0
  36. backend/node_modules/.bin/mkdirp.cmd +3 -0
  37. backend/node_modules/.bin/mkdirp.ps1 +3 -0
  38. backend/node_modules/.bin/node-which +3 -0
  39. backend/node_modules/.bin/node-which.cmd +3 -0
  40. backend/node_modules/.bin/node-which.ps1 +3 -0
  41. backend/node_modules/.bin/nodemon +3 -0
  42. backend/node_modules/.bin/nodemon.cmd +3 -0
  43. backend/node_modules/.bin/nodemon.ps1 +3 -0
  44. backend/node_modules/.bin/nodetouch +3 -0
  45. backend/node_modules/.bin/nodetouch.cmd +3 -0
  46. backend/node_modules/.bin/nodetouch.ps1 +3 -0
  47. backend/node_modules/.bin/openai +3 -0
  48. backend/node_modules/.bin/openai.cmd +3 -0
  49. backend/node_modules/.bin/openai.ps1 +3 -0
  50. backend/node_modules/.bin/parser +3 -0
Dockerfile.backend ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ # Copy package files
6
+ COPY backend/package*.json ./
7
+
8
+ # Install dependencies
9
+ RUN npm ci --only=production
10
+
11
+ # Copy source code
12
+ COPY backend/ .
13
+
14
+ # Create non-root user
15
+ RUN addgroup -g 1001 -S nodejs
16
+ RUN adduser -S nodejs -u 1001
17
+
18
+ # Change ownership of the app directory
19
+ RUN chown -R nodejs:nodejs /app
20
+ USER nodejs
21
+
22
+ # Expose port
23
+ EXPOSE 5000
24
+
25
+ # Health check
26
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
27
+ CMD node healthcheck.js
28
+
29
+ # Start the application
30
+ CMD ["npm", "start"]
Dockerfile.frontend ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile.frontend
2
+
3
+ # Step 1: Build React App
4
+ FROM node:18-alpine AS build
5
+
6
+ WORKDIR /app
7
+
8
+ # Copy only package files and install dependencies
9
+ COPY frontend/package*.json ./
10
+ RUN npm install
11
+
12
+ # Copy all frontend source code
13
+ COPY frontend/ ./
14
+
15
+ # Run React build
16
+ RUN npm run build
17
+
18
+ # Step 2: Serve with Nginx
19
+ FROM nginx:alpine
20
+
21
+ # Copy built files from step 1
22
+ COPY --from=build /app/build /usr/share/nginx/html
23
+
24
+
25
+ EXPOSE 80
26
+
27
+ CMD ["nginx", "-g", "daemon off;"]
README.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CRAITE AI Chat Application
2
+
3
+ A modern, full-stack AI chat application with Web3 specialization, built with React and Node.js.
4
+
5
+ ## Features
6
+
7
+ - 🤖 AI-powered chat with Web3 specialization
8
+ - 💬 Real-time messaging with Socket.IO
9
+ - 🔐 JWT-based authentication
10
+ - 📱 Responsive design
11
+ - 🗄️ MongoDB database
12
+ - 🚀 Docker containerization
13
+ - 🔍 Search and filter conversations
14
+ - ⚡ Rate limiting and security features
15
+
16
+ ## Tech Stack
17
+
18
+ ### Backend
19
+ - Node.js with Express
20
+ - MongoDB with Mongoose
21
+ - Socket.IO for real-time communication
22
+ - JWT for authentication
23
+ - OpenAI API integration
24
+ - Docker containerization
25
+
26
+ ### Frontend
27
+ - React 18 with hooks
28
+ - React Router for navigation
29
+ - React Query for state management
30
+ - Axios for API calls
31
+ - Socket.IO client
32
+ - Modern CSS with CSS variables
33
+
34
+ ## Quick Start
35
+
36
+ ### Using Docker (Recommended)
37
+
38
+ 1. Clone the repository:
39
+ ```bash
40
+ git clone <repository-url>
41
+ cd craite-ai-chat
backend/.env.example ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ NODE_ENV=development
2
+ PORT=5000
3
+ MONGODB_URI=mongodb://localhost:27017/craite-ai
4
+ JWT_SECRET=your-super-secret-jwt-key-here
5
+ JWT_EXPIRE=7d
6
+ OPENAI_API_KEY=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
7
+ CORS_ORIGIN=http://localhost:3000
8
+ RATE_LIMIT_WINDOW_MS=900000
9
+ RATE_LIMIT_MAX_REQUESTS=100
backend/node_modules/.bin/browserslist ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54fdec30a2fdafa92270bd5f6f8b469eae04d9d691a0efa5c81e5f9720ce43db
3
+ size 387
backend/node_modules/.bin/browserslist.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4256324c48333044314aba80247152ce152284f6198f073471082263ad68e000
3
+ size 324
backend/node_modules/.bin/browserslist.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29aadbfb1ce80642e7c4d82a68013b8e22298eabb2b780fcda40e960fd9fe114
3
+ size 801
backend/node_modules/.bin/create-jest ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38e5ac23118a47a0caf99c4f6a28149a271d45353b079e961d65e590db47f17f
3
+ size 409
backend/node_modules/.bin/create-jest.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41e4989c0f94a27c2774a3428d4d20c90eda53199b162b7e40aa2f0967e64240
3
+ size 335
backend/node_modules/.bin/create-jest.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cbdbb699f46dbe133fcaa4aef69b9961531d65f3e918653c74d5a817c3cc10e4
3
+ size 845
backend/node_modules/.bin/esparse ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de2ea7a4b2ebecc8aa088e2b26cffacdc36674f0b8a06c8f49e69489a121028f
3
+ size 393
backend/node_modules/.bin/esparse.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:524fe1bfee4734c65ba7c337982bb42423360b6265c6a91736807a19a2dbd8ee
3
+ size 327
backend/node_modules/.bin/esparse.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b43deae7c89ad5603b2208444201737818db28e10f7aea1fcb51f71be246a9c2
3
+ size 813
backend/node_modules/.bin/esvalidate ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3dd54563b564cdeb73b643166ee65169b4a0d136d1b063bfdb55afc528cf630e
3
+ size 399
backend/node_modules/.bin/esvalidate.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:baf9b027eceee99f10d7c4185b5488814aeb5bac5c73793df86c414cb5353a39
3
+ size 330
backend/node_modules/.bin/esvalidate.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f4c00c00c3ed5ed266245818bd992f99ca73b53e24b56679cbad8f93790308b
3
+ size 825
backend/node_modules/.bin/import-local-fixture ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f8fef155130111712b7f465187ab142b4c2852102fb0fd6f98f076ccb7e234b
3
+ size 405
backend/node_modules/.bin/import-local-fixture.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39eaffcf6c1b1ddb9d7a53d3f7f1468cccb89f78df938e0153f8e8782d251e36
3
+ size 333
backend/node_modules/.bin/import-local-fixture.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf741e30980d1739072015f66c554bcb7513ea77f654055fceb40c4293ab8d53
3
+ size 837
backend/node_modules/.bin/jest ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5274c13b7ddd367a8811e72ea59b3f916478617da94a41ff27ac2ceea05599a2
3
+ size 381
backend/node_modules/.bin/jest.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc2f4184f1d965dde07d96b5050891710163ccf6a7cac6a2eea867e1a9ae02cb
3
+ size 321
backend/node_modules/.bin/jest.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c38a03d6ce2296ced8653870dd313f0dc9f890203507ea500ca8647cf4d4a075
3
+ size 789
backend/node_modules/.bin/js-yaml ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c46b44b3bd9b2331fe4f659e672d453b88bcb3e04b4a214d19f91de0b3891b3e
3
+ size 393
backend/node_modules/.bin/js-yaml.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6189e86d86dd0fe97fbe0ce650d65f2eec04ab6ccc3e5efbce89acc9741049e4
3
+ size 327
backend/node_modules/.bin/js-yaml.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5a6132c4b32e855a2c1f239b2d69b389320cbd10f890ee5069fe5f550e52882
3
+ size 813
backend/node_modules/.bin/jsesc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e602c28ae389059f8432b215bf7cf139ddf94a0115b7d6f407ed7ec44009b8b4
3
+ size 379
backend/node_modules/.bin/jsesc.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b87fd711d42d591a1f58ff7e1ab5853fec23500124199234e067db1ecf3cac1f
3
+ size 320
backend/node_modules/.bin/jsesc.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1fea8d4906bc84471a56ca344efa060ff05d6d1cc5e924ce80c74a2468e4634
3
+ size 785
backend/node_modules/.bin/json5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6dbbbcf1513aa4adede8edd73bf10cdf666bd2c0ee7fb5b92a9ecc688a278016
3
+ size 381
backend/node_modules/.bin/json5.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac1c85ef42fd4756851c82bcced541694345d9e5196f36f25fef83d2cb4409cd
3
+ size 321
backend/node_modules/.bin/json5.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1928bf0cbc643164307fc9b7529a03657bbf58a74e552c1cd241305c6fafa754
3
+ size 789
backend/node_modules/.bin/mime ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:394b93eaaac25f18a20d7cdd80920ecca1fe43c8e5b37501389e644944c6e01f
3
+ size 371
backend/node_modules/.bin/mime.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd5ca2f059e780c0a4b1aa9cdd6edc7dc10413d30bf51ad537adbd428e5e7a16
3
+ size 316
backend/node_modules/.bin/mime.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a43d8b7d57dbbb21f2f98c331970d011177fa1c6be327aa0dbb84c1ad01e9201
3
+ size 769
backend/node_modules/.bin/mkdirp ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:147017d5c4a64d06818cc410bdd0fa4b974fc79c1c4f1045afa94da1dd35b39a
3
+ size 383
backend/node_modules/.bin/mkdirp.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:373083e436d985be1d1ad725dcabef0f13e048aa1f519c34da3e8aa4ad4feeb9
3
+ size 322
backend/node_modules/.bin/mkdirp.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6340c3df00db2324cf2ebd8f8cfbb46dfdbddba829e7af251b9f6fd0a48b6ce
3
+ size 793
backend/node_modules/.bin/node-which ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae614137ec19cd41eab2f7a85cc508e6a19042b0dda0a2815c07e5fb43a6e059
3
+ size 389
backend/node_modules/.bin/node-which.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:818856453703b9e61de47223e7505ad77cb4f40f456e348dae2ca9cd501abad0
3
+ size 325
backend/node_modules/.bin/node-which.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d293014f7b06fffc145f94cd02bd82b53c2dbbc3eba99ff62dedf882adcc1711
3
+ size 805
backend/node_modules/.bin/nodemon ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66a2e9a75919b51a98f0fecf4746dd603fbb7784350449408a444a87f8d63d1f
3
+ size 393
backend/node_modules/.bin/nodemon.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d79d4631f4d46ef11c589653fc99552ac24cc462558b829fd7d3c2a60baaa994
3
+ size 327
backend/node_modules/.bin/nodemon.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3721509b20daf22ba511568f643bf4c6964976819462cb50ebebe67a7be61019
3
+ size 813
backend/node_modules/.bin/nodetouch ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d90b3a1b9f7d156423056cbb946dfbece388e6f216825dcfaedefd2d6c8034b0
3
+ size 393
backend/node_modules/.bin/nodetouch.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22bef4fdaf686ccdc47f1b67f130727ba8287955695f25321a3d8133db3c624d
3
+ size 327
backend/node_modules/.bin/nodetouch.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b7a495d51e3a579590b9ca894725fa16297321be5c96238da97d30a92ce4c00
3
+ size 813
backend/node_modules/.bin/openai ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cf6c8da562e39b8942d0c5665a14c6ea44ffa6555dc319a4a6294fbbd01a223
3
+ size 377
backend/node_modules/.bin/openai.cmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd3f42de637933faf5dffebb7940b143b248bcd4e3821557304e407a6b85cae8
3
+ size 319
backend/node_modules/.bin/openai.ps1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c6743fabaf851e1e303c41d8699a5d9467fcb2d29fd65ca9a032b06ce385f14
3
+ size 781
backend/node_modules/.bin/parser ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed60a2b4f36fdf4d46331006ab1323a4c4098ce63a14b254e04dbbe92b579986
3
+ size 415