Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: runs test on PR

on:
pull
35 changes: 34 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ cover/
local_settings.py
db.sqlite3
db.sqlite3-journal
media/
staticfiles/

# Flask stuff:
instance/
Expand Down Expand Up @@ -171,4 +173,35 @@ cython_debug/
.ruff_cache/

# PyPI configuration file
.pypirc
.pypirc

# Node
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnp/
.pnp.js

# Testing
coverage/
.coverage
htmlcov/
.pytest_cache/
.tox/

# IDEs and editors
.idea/
.vscode/
*.swp
*.swo
.DS_Store
Thumbs.db

# Frontend build
frontend/build/
frontend/dist/
frontend/.env.local
frontend/.env.development.local
frontend/.env.test.local
frontend/.env.production.local
120 changes: 120 additions & 0 deletions PRD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# 2D Metaverse - Product Requirements Document

## 🎯 Project Overview
A 2D virtual world platform where users can interact, customize their avatars, and explore different spaces.

## 🎯 Core Features

### 1. User Management
- User registration and authentication
- Profile management
- Avatar customization
- User settings and preferences

### 2. Virtual Spaces
- Multiple customizable rooms/spaces
- Space creation and management (admin)
- Space templates
- Space permissions and access control

### 3. Avatar System
- Avatar creation and customization
- Real-time avatar movement
- Avatar animations
- Avatar interactions with objects

### 4. Interactive Elements
- Furniture and decorative items
- Interactive objects (portals, games, etc.)
- Object placement and rotation
- Collision detection

### 5. Real-time Communication
- WebSocket-based real-time updates
- Chat system
- User presence indicators
- Notifications

### 6. Admin Features
- Space management
- User management
- Content moderation
- Analytics dashboard

## 🎯 Technical Requirements

### Backend
- Django REST Framework for API
- WebSocket support for real-time features
- PostgreSQL database
- Redis for caching
- Celery for background tasks

### Frontend
- React.js for UI
- Phaser.js for 2D rendering
- WebSocket client
- Responsive design
- Progressive Web App capabilities

### Security
- JWT authentication
- HTTPS
- Input validation
- Rate limiting
- CSRF protection

## 🎯 User Stories

### As a User
1. I want to create an account and customize my avatar
2. I want to join and explore different spaces
3. I want to chat with other users
4. I want to interact with objects in the space
5. I want to customize my profile

### As an Admin
1. I want to manage users and spaces
2. I want to moderate content
3. I want to view analytics
4. I want to create and manage templates

## 🎯 Non-Functional Requirements
- Performance: < 100ms response time
- Scalability: Support 1000+ concurrent users
- Availability: 99.9% uptime
- Security: Regular security audits
- Accessibility: WCAG 2.1 compliance

## 🎯 Development Phases

### Phase 1: Foundation
- Basic user authentication
- Avatar system
- Simple space creation
- Basic WebSocket implementation

### Phase 2: Core Features
- Enhanced space management
- Interactive elements
- Real-time chat
- User interactions

### Phase 3: Advanced Features
- Advanced customization
- Game mechanics
- Social features
- Analytics

### Phase 4: Polish & Scale
- Performance optimization
- Enhanced security
- Advanced moderation tools
- Scalability improvements

## 🎯 Success Metrics
- User engagement (time spent, interactions)
- User retention
- Space creation and usage
- System performance
- User satisfaction
152 changes: 111 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,124 @@
🚀 Emoji Commit Message Convention
# 2D Metaverse

We follow an emoji-based commit message convention to make our Git history more readable and organized. Each commit should begin with an appropriate emoji that represents the type of change.
A virtual world platform where users can interact, customize their avatars, and explore different spaces.

## Features

## **🔥 Emoji Commit Message Convention**
- User authentication and registration
- Avatar customization
- Real-time movement and interaction
- Multiple customizable spaces
- Interactive elements
- WebSocket-based communication
- Admin dashboard

## Tech Stack

### 📋 Emoji Guide
### Backend
- Django
- Django REST Framework
- Channels (WebSockets)
- PostgreSQL
- Redis

| Emoji | Name | Meaning | Example Commit Message |
| --- | --- | --- | --- |
| 🎉 **tada** | Initial commit | `🎉 feat: initial project setup` |
| ✨ **sparkles** | New feature | `✨ feat: add user authentication` |
| 🐛 **bug** | Bug fix | `🐛 fix: resolve issue with login form` |
| 🚑 **ambulance** | Critical hotfix | `🚑 fix: urgent API authentication issue` |
| 🛠️ **hammer_and_wrench** | Refactoring | `🛠️ refactor: optimize database queries` |
| 🚀 **rocket** | Performance improvement | `🚀 perf: speed up image processing` |
| 🎨 **art** | UI/UX improvements | `🎨 style: improve button hover effect` |
| 📝 **memo** | Documentation | `📝 docs: update README with setup guide` |
| ✅ **white_check_mark** | Adding tests | `✅ test: add unit test for user model` |
| 🔍 **mag** | Fixing or updating tests | `🔍 test: fix broken API test` |
| 🚨 **rotating_light** | Fixing warnings/errors | `🚨 fix: remove unused imports` |
| 🔥 **fire** | Removing code/files | `🔥 chore: remove unused config file` |
| 📦 **package** | Dependency changes | `📦 chore: upgrade Django to 4.2.1` |
| 🗃️ **card_file_box** | Database changes | `🗃️ db: add new field to User model` |
| 🔄 **repeat** | CI/CD updates | `🔄 ci: update GitHub Actions workflow` |
| 🏗️ **building_construction** | Work in progress (WIP) | `🏗️ wip: implement notifications feature` |
| 🔧 **wrench** | Configuration changes | `🔧 chore: update pytest settings` |
| ⚡ **zap** | Minor optimization | `⚡ perf: reduce API response time` |
| 🔊 **loud_sound** | Logging updates | `🔊 chore: improve error logging` |
| ♻️ **recycle** | Code restructuring without changing behavior | `♻️ refactor: simplify API response formatting` |
### Frontend
- React
- TypeScript
- Phaser.js
- Material-UI

---
## Setup

### ✅ Usage Guidelines
- Keep commit messages **clear and concise**.
- Use **present tense** (e.g., `fix: update layout`, not `fixed` or `fixes`).
- Separate emoji and type with a space (e.g., `✨ feat: add dark mode`).
- Stick to the **convention** to maintain consistency in commit history.
### Prerequisites
- Python 3.8+
- Node.js 14+
- PostgreSQL
- Redis

This helps keep your Git history **clean, readable, and well-organized**! 🚀
### Backend Setup

---
1. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

## **📌 Example Commit Messages Using This Convention**
2. Install dependencies:
```bash
pip install -r requirements.txt
```

1. `✅ test: add API test for Avatar retrieval`
2. `🐛 fix: resolve 404 error in Avatar API`
3. `📝 docs: update API documentation`
4. `🚀 perf: optimize database queries for faster retrieval`
5. `🔍 test: fix failing test case in Avatar endpoint`
3. Set up environment variables:
```bash
cp .env.example .env
# Edit .env with your configuration
```

---
4. Run migrations:
```bash
python manage.py migrate
```

5. Create a superuser:
```bash
python manage.py createsuperuser
```

### Frontend Setup

1. Install dependencies:
```bash
cd frontend
npm install
```

2. Start the development server:
```bash
npm start
```

## Running the Application

1. Start the backend server:
```bash
python manage.py runserver
```

2. Start the frontend development server:
```bash
cd frontend
npm start
```

3. Access the application at `http://localhost:3000`

## API Documentation

### Authentication
- POST `/api/auth/register/` - Register a new user
- POST `/api/auth/login/` - Login and get JWT tokens

### Spaces
- GET `/api/spaces/all/` - List all spaces
- POST `/api/spaces/new/` - Create a new space
- DELETE `/api/spaces/delete/<id>/` - Delete a space

### Avatars
- GET `/api/avatars/<id>/` - Get avatar details
- POST `/api/admin/avatar/new/` - Create a new avatar (admin only)

### Elements
- POST `/api/admin/element/new/` - Create a new element (admin only)
- PUT `/api/admin/element/update/<id>/` - Update an element (admin only)

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m '✨ feat: add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License - see the LICENSE file for details.
Loading