docs: Update project documentation for web-based architecture and development environment
This commit enhances the project documentation by updating the `.cursorrules` file to reflect the transition to a modern web-based photo management application. It includes detailed sections on the development environment, specifying the PostgreSQL server and development server configurations. Additionally, the README.md is updated to include development database information and environment setup instructions, ensuring clarity for new developers and contributors. These changes improve the overall documentation and support for the project's new architecture.
This commit is contained in:
@@ -115,6 +115,30 @@ The application uses **two separate PostgreSQL databases**:
|
||||
|
||||
Both database connections are configured via the `.env` file.
|
||||
|
||||
#### Development Database
|
||||
|
||||
For development, you can use the shared development PostgreSQL server:
|
||||
|
||||
**Dev PostgreSQL Server:**
|
||||
- **Host**: 10.0.10.181
|
||||
- **Port**: 5432
|
||||
- **User**: ladmin
|
||||
- **Password**: C0caC0la
|
||||
|
||||
**Development Server:**
|
||||
- **Host**: 10.0.10.121
|
||||
- **User**: appuser
|
||||
- **Password**: C0caC0la
|
||||
|
||||
Configure your `.env` file for development:
|
||||
```bash
|
||||
# Main database (dev)
|
||||
DATABASE_URL=postgresql+psycopg2://ladmin:C0caC0la@10.0.10.181:5432/punimtag
|
||||
|
||||
# Auth database (dev)
|
||||
DATABASE_URL_AUTH=postgresql+psycopg2://ladmin:C0caC0la@10.0.10.181:5432/punimtag_auth
|
||||
```
|
||||
|
||||
**Install PostgreSQL (if not installed):**
|
||||
```bash
|
||||
# On Ubuntu/Debian:
|
||||
@@ -164,6 +188,8 @@ Alternatively, use the automated script (requires sudo password):
|
||||
|
||||
**Configuration:**
|
||||
The `.env` file in the project root contains database connection strings:
|
||||
|
||||
**Local Development:**
|
||||
```bash
|
||||
# Main application database (PostgreSQL - required)
|
||||
DATABASE_URL=postgresql+psycopg2://punimtag:punimtag_password@localhost:5432/punimtag
|
||||
@@ -172,6 +198,15 @@ DATABASE_URL=postgresql+psycopg2://punimtag:punimtag_password@localhost:5432/pun
|
||||
DATABASE_URL_AUTH=postgresql+psycopg2://punimtag:punimtag_password@localhost:5432/punimtag_auth
|
||||
```
|
||||
|
||||
**Development Server:**
|
||||
```bash
|
||||
# Main database (dev PostgreSQL server)
|
||||
DATABASE_URL=postgresql+psycopg2://ladmin:C0caC0la@10.0.10.181:5432/punimtag
|
||||
|
||||
# Auth database (dev PostgreSQL server)
|
||||
DATABASE_URL_AUTH=postgresql+psycopg2://ladmin:C0caC0la@10.0.10.181:5432/punimtag_auth
|
||||
```
|
||||
|
||||
**Automatic Initialization:**
|
||||
The database and all tables are automatically created on first startup. No manual migration is needed!
|
||||
|
||||
@@ -775,11 +810,86 @@ PunimTag Development Team
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Deployment
|
||||
|
||||
### Development Server Deployment
|
||||
|
||||
The project includes scripts for deploying to the development server.
|
||||
|
||||
**Development Server:**
|
||||
- **Host**: 10.0.10.121
|
||||
- **User**: appuser
|
||||
- **Password**: C0caC0la
|
||||
|
||||
**Development Database:**
|
||||
- **Host**: 10.0.10.181
|
||||
- **Port**: 5432
|
||||
- **User**: ladmin
|
||||
- **Password**: C0caC0la
|
||||
|
||||
#### Build and Deploy to Dev
|
||||
|
||||
```bash
|
||||
# Build all frontends and prepare for deployment
|
||||
npm run deploy:dev
|
||||
|
||||
# Or build individually
|
||||
npm run build:admin
|
||||
npm run build:viewer
|
||||
```
|
||||
|
||||
The deployment script will:
|
||||
1. Build admin-frontend for production
|
||||
2. Build viewer-frontend for production
|
||||
3. Prepare deployment package
|
||||
4. Copy files to deployment directory (ready for manual transfer)
|
||||
|
||||
#### Manual Deployment Steps
|
||||
|
||||
1. **Build the applications:**
|
||||
```bash
|
||||
npm run deploy:dev
|
||||
```
|
||||
|
||||
2. **Transfer files to server:**
|
||||
```bash
|
||||
# Transfer backend and built frontends
|
||||
scp -r backend admin-frontend/dist viewer-frontend/.next appuser@10.0.10.121:/path/to/deployment
|
||||
```
|
||||
|
||||
3. **Set up environment on server:**
|
||||
- Create `.env` file with dev database credentials
|
||||
- Install Python dependencies: `pip install -r requirements.txt`
|
||||
- Set up systemd services or PM2 for process management
|
||||
|
||||
4. **Start services:**
|
||||
- Backend API (FastAPI)
|
||||
- RQ Worker
|
||||
- Frontend servers (nginx or similar)
|
||||
|
||||
See `docs/DEPLOYMENT.md` for detailed deployment instructions.
|
||||
|
||||
### Production Deployment
|
||||
|
||||
For production deployment:
|
||||
1. Update environment variables with production credentials
|
||||
2. Configure PostgreSQL connection strings
|
||||
3. Set up Redis for background jobs
|
||||
4. Configure reverse proxy (nginx)
|
||||
5. Set up SSL certificates
|
||||
6. Configure firewall rules
|
||||
7. Set up monitoring and logging
|
||||
|
||||
See `docs/DEPLOYMENT.md` for complete production deployment guide.
|
||||
|
||||
---
|
||||
|
||||
## 📧 Support
|
||||
|
||||
For questions or issues:
|
||||
1. Check documentation in `docs/`
|
||||
|
||||
2. Review `docs/DEPLOYMENT.md` for deployment questions
|
||||
3. Check `docs/ARCHITECTURE.md` for technical details
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user