Skip to content

Commit e29c3a4

Browse files
authored
Merge pull request #13 from x-team/dev
Games Intregrations
2 parents 0a1c7aa + 2da6be6 commit e29c3a4

24 files changed

+1288
-503
lines changed

Diff for: .env.example

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# FRONTEND
12
REACT_APP_GAMESHQ_API_URL="http://127.0.0.1:3000"
23

3-
# Firebase
4+
# FIREBASE
45
REACT_APP_FIREBASE_API_KEY=
56
REACT_APP_FIREBASE_AUTH_DOMAIN=
67
REACT_APP_FIREBASE_DATTABASE_URL=
78
REACT_APP_PROJECT_ID=
89
REACT_APP_STORAGE_BUCKET=
910
REACT_APP_MESSAGING_SENDER_ID=
10-
REACT_APP_APP_ID=
11+
REACT_APP_APP_ID=

Diff for: README.md

+118-26
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,138 @@
1-
# Getting Started with Create React App
1+
<h1 align="center">
2+
<br>
3+
<a href="http://www.amitmerchant.com/electron-markdownify"><img src="https://i.imgur.com/njuVb1g.png" alt="Markdownify" width="200"></a>
4+
<br>
5+
Games Admin panel
6+
<br>
7+
</h1>
28

3-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
9+
## What is it?
10+
Headquarters of the games interactions. Games Admin Panel is basically a publishing tool to connect new browser games with the XTU ecosystem.
411

5-
## Available Scripts
12+
The admin panel let game developers integrate their games with the XTU world. It lets them create game key pairs, leaderboards, achievements, monitor statistics, between others.
613

7-
In the project directory, you can run:
14+
The app also works great for XTeam Admins letting them create and manage The arena, and the Tower game rounds, new items, monitor games, between others.
815

9-
### `yarn start`
1016

11-
Runs the app in the development mode.\
12-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
17+
## 📑Contents
1318

14-
The page will reload if you make edits.\
15-
You will also see any lint errors in the console.
19+
* [Tech Stack](#tech-stack)
20+
* [Requirements](#requirements)
21+
* [Project](#project)
22+
* [Environmental Variables](#environmental-variables)
23+
* [Run APP](#run-app)
24+
* [How to contribute](#how-to-contribute)
25+
* [JIRA](#jira)
26+
* [Commits](#commits)
27+
* [Pull Requests](#pull-requests)
28+
* [Continous Integration](#continous-integration)
1629

17-
### `yarn test`
30+
## 📦Tech Stack
31+
* [Node.js](https://nodejs.org/)
32+
* [React](https://es.reactjs.org/)
33+
* [CRACO](https://www.npmjs.com/package/@craco/craco)
1834

19-
Launches the test runner in the interactive watch mode.\
20-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
35+
## 🔎Requirements
36+
* [NVM - Node Version Manager](https://github.com/nvm-sh/nvm)
2137

22-
### `yarn build`
38+
## 🚀Project
39+
Let's setup the project!🥹
2340

24-
Builds the app for production to the `build` folder.\
25-
It correctly bundles React in production mode and optimizes the build for the best performance.
41+
### **🔒Environmental Variables**
42+
The APP needs some env vars to work properly. You can ask @ccmoralesj for this.
2643

27-
The build is minified and the filenames include the hashes.\
28-
Your app is ready to be deployed!
44+
Just grab the `.env.example` file and copy everything into a new file called `.env`. It will look something like this at first.
2945

30-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
46+
```
47+
# FRONTEND
48+
REACT_APP_GAMESHQ_API_URL="http://127.0.0.1:3000"
3149
32-
### `yarn eject`
50+
# FIREBASE
51+
REACT_APP_FIREBASE_API_KEY=
52+
REACT_APP_FIREBASE_AUTH_DOMAIN=
53+
REACT_APP_FIREBASE_DATTABASE_URL=
54+
REACT_APP_PROJECT_ID=
55+
REACT_APP_STORAGE_BUCKET=
56+
REACT_APP_MESSAGING_SENDER_ID=
57+
REACT_APP_APP_ID=
3358
34-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
59+
```
60+
### **🖼️Run App**
61+
We are almost there with the setup.🥲 Now it's time to run the API to connect the APP with. You can go to [Games API repo](https://github.com/x-team/GamesHQ-API) and follow the [README](https://github.com/x-team/GamesHQ-API#readme) to setup you own API, or you can connect with the staging API:
3562

36-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
63+
```bash
64+
https://gameshq-api-staging.x-team.com
65+
```
3766

38-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
67+
Now let's run the FE APP. 🎉
3968

40-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
4169

42-
## Learn More
70+
First, make sure you're using our recommended version of Node and yarn by running these commands:
4371

44-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
72+
```bash
73+
nvm use
74+
```
4575

46-
To learn React, check out the [React documentation](https://reactjs.org/).
76+
Following up, we have to install all required dependencies to run the project:
77+
78+
```bash
79+
npm i --legacy-peer-deps
80+
# We use legacy peer deps due to a compatibility issue in React at the moment
81+
```
82+
83+
Finally, **run the API first** and then the application with the following command:
84+
85+
```bash
86+
npm start
87+
```
88+
89+
The APP should be up and running 🎉at port 3001!🎉 You can verify by browsing to [http://localhost:3001](http://localhost:3001)
90+
91+
Let's start coding!🤓
92+
93+
(GIF: Wait for it...)
94+
![App Running](https://i.imgur.com/puC3sX2.png)
95+
96+
## 🫂How to contribute
97+
Collaborate in this repo is quite easy.
98+
### 📊JIRA
99+
You only need to pick up a ticket from the [JIRA board](https://x-team-internal.atlassian.net/jira/software/c/projects/XTG/boards/48) (If you don't have access you can ask @ccmoralesj)
100+
101+
Each JIRA ticket has an identifier based on a code and a number like XTG-123 which you will use later.
102+
### 💾Commits
103+
Each commit you do needs to have the JIRA ticket identifier so it can be related to the board.
104+
105+
You can use this commit format suggestion.
106+
107+
```
108+
:optional-emoji: XTG-123: New endpoint to handle login
109+
```
110+
111+
| **Emoji** | **Description** |
112+
|-----------|-----------------------------------------|
113+
| **🚀** | New features, or enhancements to code |
114+
| **🐞** | Bug fixes |
115+
| **⚙️** | Refactors |
116+
| **📦** | Build files, dependencies, config files |
117+
| **🔎** | Minor fixes, typos, imports, etc |
118+
| **🪄** | Others |
119+
120+
![Commit Example](https://i.imgur.com/gClC6CV.gif)
121+
122+
### 🕵🏻Pull Requests
123+
Once you're ready. You can create a new Pull Request (PR) by adding the JIRA ticket identifier in the title. The repo will give you a template to fill in the details of your amazing work!
124+
125+
You can use this PR title format suggestion.
126+
127+
```
128+
XTG-123: Login
129+
```
130+
131+
You'll need at least 1 review from your teammates to merge the pull request.
132+
133+
## 🪄Continous Integration
134+
This project is connected to an EC2 instance from AWS.
135+
136+
All code from `main` branch will be deployed to staging.
137+
138+
To **deploy to production** you must create a `new release` and follow the [semantic versioning](https://semver.org/lang/es/) fundamentals. That will trigger an automated deployment to **production**.

Diff for: buildspec.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@ phases:
1414
commands:
1515
- n 16
1616
- npm update -g npm
17-
- npm install -g yarn
1817
- aws --version
1918
- node -v
20-
- yarn -v
21-
- yarn install --frozen-lockfile --production=false
2219
- wget https://github.com/Droplr/aws-env/raw/master/bin/aws-env-linux-amd64 -O aws-env
2320
- chmod +x aws-env
21+
- ls -la
2422

2523
build:
2624
commands:
27-
- eval $(./aws-env --recursive)
28-
- yarn install --frozen-lockfile --production=false
29-
- NODE_ENV=production yarn build
25+
- npm i --legacy-peer-deps
26+
- eval $(./aws-env --recursive) && npm run build
3027

3128
post_build:
3229
commands:
33-
- aws s3 sync build/. s3://$FRONTEND_BUCKET
30+
- aws s3 sync build/. s3://$FRONTEND_BUCKET

0 commit comments

Comments
 (0)