-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProject document
More file actions
192 lines (170 loc) · 4.6 KB
/
Project document
File metadata and controls
192 lines (170 loc) · 4.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# PiMetaConnect Whitepaper: Project Structure and Development Steps
**Date**: April 24, 2025
**Version**: 1.0
**Repository**: [PiMetaConnect Repository](https://github.com/Ze0ro99/PiMetaConnect)
**Maintainer**: Ze0ro99
**Email**: [kamelkadah910@gmail.com]
---
## 1. Folder Structure and Files
```
PiMetaConnect/
├── /client/
│ ├── /src/
│ │ ├── /components/
│ │ │ ├── SocialFeed.js
│ │ │ ├── LiveStream.js
│ │ │ ├── NFTDisplay.js
│ │ ├── /screens/
│ │ │ ├── HomeScreen.js
│ │ │ ├── MetaverseScreen.js
│ │ │ ├── ProfileScreen.js
│ │ ├── /assets/
│ │ ├── /navigation/
│ │ │ ├── AppNavigator.js
│ │ ├── /styles/
│ │ │ ├── theme.js
│ │ ├── App.js
│ ├── package.json
│ ├── .env
│
├── /server/
│ ├── /src/
│ │ ├── /controllers/
│ │ │ ├── userController.js
│ │ │ ├── contentController.js
│ │ │ ├── nftController.js
│ │ ├── /models/
│ │ │ ├── User.js
│ │ │ ├── Content.js
│ │ │ ├── NFT.js
│ │ ├── /routes/
│ │ │ ├── userRoutes.js
│ │ │ ├── contentRoutes.js
│ │ │ ├── nftRoutes.js
│ │ ├── /middleware/
│ │ │ ├── auth.js
│ │ ├── /config/
│ │ │ ├── db.js
│ │ ├── server.js
│ ├── package.json
│ ├── .env
│
├── /metaverse/
│ ├── /Assets/
│ │ ├── /Scenes/
│ │ │ ├── VirtualMall.unity
│ │ │ ├── EventSpace.unity
│ │ ├── /Scripts/
│ │ │ ├── ProductDisplay.cs
│ │ │ ├── UserAvatar.cs
│ ├── ProjectSettings/
│
├── /blockchain/
│ ├── /contracts/
│ │ ├── PiMetaNFT.sol
│ ├── /scripts/
│ │ ├── deploy.js
│ ├── hardhat.config.js
│ ├── package.json
│
├── /scripts/
│ ├── setup.sh
│
├── /docs/
│ ├── README.md
│ ├── WHITEPAPER.md
│
├── .gitignore
├── docker-compose.yml
├── LICENSE
```
---
## 2. Development Steps
### Setup Repository
1. Create a new Git repository on GitHub.
2. Clone the repository: `git clone https://github.com/Ze0ro99/PiMetaConnect.git`.
3. Create the folder structure as listed above.
4. Initialize Git: `git init`.
---
### Install Prerequisites
1. Install Node.js: `npm install -g npm`.
2. Install Yarn: `npm install -g yarn`.
3. Install Unity Hub and Unity Editor.
4. Install Hardhat: `npm install -g hardhat`.
5. Install Docker and Docker Compose.
---
### Create Files
1. Create all files listed in the folder structure.
2. Add `.gitignore` with:
```
node_modules/
build/
dist/
.env
.DS_Store
Thumbs.db
*.log
.env.local
.env.development
temp/
tmp/
*.bak
*.swp
package-lock.json
```
3. Add LICENSE (e.g., MIT License).
4. Add `docker-compose.yml` with the configuration provided in the document.
---
### Automation Script
````bash name=scripts/setup.sh
#!/bin/bash
echo "Starting PiMetaConnect setup..."
# Install Frontend Dependencies
echo "Installing frontend dependencies..."
cd client
yarn install
if [ $? -ne 0 ]; then
echo "Error installing frontend dependencies."
exit 1
fi
# Install Backend Dependencies
echo "Installing backend dependencies..."
cd ../server
yarn install
if [ $? -ne 0 ]; then
echo "Error installing backend dependencies."
exit 1
fi
# Install Blockchain Dependencies
echo "Installing blockchain dependencies..."
cd ../blockchain
yarn install
if [ $? -ne 0 ]; then
echo "Error installing blockchain dependencies."
exit 1
fi
# Build Unity Metaverse Project
echo "Building Unity metaverse project..."
cd ../metaverse
unity -batchmode -projectPath . -buildTarget WebGL -executeMethod BuildScript.Build
if [ $? -ne 0 ]; then
echo "Error building Unity project."
exit 1
fi
# Deploy NFT Smart Contracts
echo "Deploying NFT smart contracts..."
cd ../blockchain
npx hardhat run scripts/deploy.js --network localhost
if [ $? -ne 0 ]; then
echo "Error deploying smart contracts."
exit 1
fi
# Start Services Using Docker Compose
echo "Starting services with Docker Compose..."
cd ..
docker-compose up -d
if [ $? -ne 0 ]; then
echo "Error starting Docker services."
exit 1
fi
echo "PiMetaConnect setup and execution completed successfully!"