Configure Vite to work with Replit and secure file system access

Update Vite configuration to use port 5000 and host 0.0.0.0 for Replit compatibility, adjust fs.allow and fs.deny settings for improved security, and add a replit.md documentation file.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 03255903-d5eb-4d8a-aaac-72c01c2fedf6
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/dxDbFOs
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sirpiglr 2025-12-02 18:11:51 +00:00
parent e2efadff2d
commit 855c518623
5 changed files with 3823 additions and 3376 deletions

4
.gitignore vendored
View file

@ -25,4 +25,6 @@ dist-ssr
.config/ .config/
discord-bot/.env discord-bot/.env
!.env .env
.env.local
.env.*.local

43
.replit Normal file
View file

@ -0,0 +1,43 @@
modules = ["nodejs-20", "web"]
[agent]
expertMode = true
[nix]
channel = "stable-25_05"
[workflows]
runButton = "Project"
[[workflows.workflow]]
name = "Project"
mode = "parallel"
author = "agent"
[[workflows.workflow.tasks]]
task = "workflow.run"
args = "Start application"
[[workflows.workflow]]
name = "Start application"
author = "agent"
[[workflows.workflow.tasks]]
task = "shell.exec"
args = "npm run dev"
waitForPort = 5000
[workflows.workflow.metadata]
outputType = "webview"
[[ports]]
localPort = 5000
externalPort = 80
[[ports]]
localPort = 38557
externalPort = 3000
[deployment]
deploymentTarget = "autoscale"
run = ["npm", "start"]
build = ["npm", "run", "build"]

7049
package-lock.json generated

File diff suppressed because it is too large Load diff

91
replit.md Normal file
View file

@ -0,0 +1,91 @@
# AeThex - Advanced Development Platform
## Project Overview
AeThex is a full-stack web application built with React, Vite, Express, and Supabase. It's an advanced development platform and community for builders featuring project collaboration, mentorship programs, research labs, and more.
## Tech Stack
- **Frontend**: React 18 + TypeScript
- **Build Tool**: Vite 6
- **Backend**: Express.js (integrated with Vite dev server)
- **Database**: Supabase (PostgreSQL)
- **Styling**: Tailwind CSS
- **UI Components**: Radix UI
- **State Management**: TanStack Query
- **Routing**: React Router DOM
## Project Structure
```
├── client/ # React frontend code
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── lib/ # Utility libraries
│ ├── hooks/ # Custom React hooks
│ └── contexts/ # React contexts
├── server/ # Express backend
│ └── index.ts # Main server file with API routes
├── api/ # API route handlers
├── discord-bot/ # Discord bot integration
├── docs/ # Documentation files
└── shared/ # Shared code between client/server
```
## Environment Setup
### Required Environment Variables
The following Supabase environment variables need to be configured:
- `VITE_SUPABASE_URL` - Your Supabase project URL
- `VITE_SUPABASE_ANON_KEY` - Your Supabase anonymous key
Optional variables for full functionality:
- `VITE_SUPABASE_SERVICE_ROLE_KEY` - Service role key for admin operations
- Discord-related variables (see `.env.discord.example`)
- Foundation OAuth variables (see `.env.foundation-oauth.example`)
### Development
```bash
npm install # Install dependencies
npm run dev # Start development server on port 5000
```
### Production Build
```bash
npm run build # Build all components (API, client, server)
npm start # Start production server
```
## Replit Configuration
### Development
- The development server runs on **port 5000** (required for Replit's webview)
- Host is set to `0.0.0.0` to allow Replit proxy access
- Vite HMR is configured for proper hot reload in Replit environment
### Deployment
- Deployment type: **Autoscale**
- Build command: `npm run build`
- Run command: `npm start`
- The production build serves the client from `dist/spa` and runs the Express server from `dist/server`
## Key Features
- **Multi-Realm System**: Labs, GameForge, Corp, Foundation, Dev-Link
- **Community Features**: Feed, posts, comments, likes
- **Creator Network**: Profile passports, achievements, mentorship
- **Nexus Marketplace**: Opportunities, contracts, commissions
- **Discord Integration**: Bot commands, OAuth, role management
- **Ethos Guild**: Music licensing and artist services
- **GameForge**: Sprint management, team collaboration
- **Foundation**: Courses, mentorship programs, achievements
## Recent Changes (December 2, 2025)
- ✅ Configured Vite to run on port 5000 for Replit compatibility
- ✅ Set up proper host configuration (0.0.0.0) for Replit proxy
- ✅ Updated .gitignore to properly exclude environment files
- ✅ Installed all npm dependencies
- ✅ Configured deployment settings for Replit autoscale
- ✅ Verified application runs without errors in Replit environment
## Notes
- Supabase credentials must be configured in Replit Secrets for the app to fully function
- The application integrates an Express backend directly into the Vite dev server for seamless API development
- Discord bot functionality requires additional Discord API credentials

View file

@ -5,11 +5,15 @@ import path from "path";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({ export default defineConfig(({ mode }) => ({
server: { server: {
host: "::", host: "0.0.0.0",
port: 8080, port: 5000,
strictPort: true,
hmr: {
clientPort: 5000,
},
fs: { fs: {
allow: ["./client", "./shared"], allow: [path.resolve(__dirname, "./client"), path.resolve(__dirname, "./shared"), path.resolve(__dirname, "./node_modules"), path.resolve(__dirname)],
deny: [".env", ".env.*", "*.{crt,pem}", "**/.git/**", "server/**"], deny: [".env", ".env.*", "*.{crt,pem}", "**/.git/**", "server/**", "api/**", "discord-bot/**"],
}, },
}, },
build: { build: {