# PolkaCombat: MAIN Frontend & Backend
<br>
## **Frontend**
PolkaCombat is dApp (Decentralized Application). So the Frontend was built using React and other modern tech related to React. But all in all it's a typical modern React application. The things to note in frontend are:
- It is hosted inside Netlify (*should migrate it to your own Netlify or recommended is to transfer it to DigitalOcean*)
- It is using Web3 to integrate ETH blockchain
- It is using an Infura API key (check .env file)
- It is using GraphQL
Please explore all the directories, for this repo contains lots of sections. Also, please check vital section below.
<br>
:pushpin: **Frontend** Vital
Another thing to take note is the **.env** file related to Blockchain section, change it to your own **mnemonic** key and **don't forget to** **redeploy** the contract **using your own address**.
In order to understand the flow of the repo, the files that should be checked first are:
- App.tsx
- MainGate.tsx
- HomePage.tsx
**Also, very important** - please create a new Netlify account or transfer this frontend repo to DigitalOcean so that all repos will be inside DigitalOcean. Also change the nameservers of www.polkacombat.com to the new server you will create.
<br>
<br>
<br>
## **Backend**
Backend is also a typical modern Node application. The only thing to take note is that it's using Apollo Server since both frontend and backend are communicating using GraphQL (Apollo).
Files that need to be visited first:
- schema/resolvers/Query
- schema/resolvers/Mutation
- schema/typeDefs
If you can improve the email feature of the backend, please do so. Right now, I've implemented SendGrid and NodeMailer as a combination.
<br>
:pushpin: **Backend** Vital
Right now, the database is residing inside Atlas platform, free tier. Just install any GUI for MongoDB, like Compass, then use this connection URI below:
```
mongodb+srv://melodiccrypter:sus3JChrist7!@codespanpersonal.1hpzc.mongodb.net/testGraphqlNodeDB
```
And then export the database and then just create a new MongoDB inside DigitalOcean then import the data you just exported. That way you can manage all data in one platform (DigitalOcean).
Don't forget to change .env file in the backend repo. Also, read the **NOTE** below.
<br>
<br>
<br>
<br>
:::info
:bulb: NOTE: Frontend and Backend of PolkaCombat is always interacting with the Polkacombat Game API Server (https://github.com/MelodicCrypter/RetainLab-Custom-Mugen-Backend). This is the server that sends information on what is currently happening inside the Mugen game. Also this server is what also receives any changes you want to change on any mugen character.
:::