-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
985 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const { BaseCommand } = require('kurami'); | ||
const { getFirestore, collection, addDoc } = require('firebase/firestore'); | ||
const chartData = require('./../charts.json'); | ||
const scoreData = require('../scores.cjs'); | ||
const { initializeApp } = require("firebase/app"); | ||
|
||
class pushDefaultValue extends BaseCommand { | ||
constructor() { | ||
super({ | ||
name: 'load:default:data', | ||
description: 'Push some default charts and scores', | ||
}); | ||
} | ||
|
||
async run() { | ||
const app = initializeApp({ | ||
// firebase config here | ||
}); | ||
|
||
console.log('Pushing default data...') | ||
console.log('Pushing default charts...') | ||
await this.pushDefaultCharts(); | ||
console.log('Pushing default scores...') | ||
await this.pushDefaultScores(); | ||
console.log('Done!') | ||
} | ||
|
||
async pushDefaultCharts() { | ||
// push chartData content to firestore | ||
const db = getFirestore(); | ||
const chartsRef = collection(db, 'Chart'); | ||
for (let i = 0; i < chartData.length; i++) { | ||
const chart = chartData[i]; | ||
await addDoc(chartsRef, chart).then((docRef) => { | ||
console.log("Document written with ID: ", docRef.id); | ||
}).catch((error) => { | ||
console.error("Error adding document: ", error); | ||
}); | ||
} | ||
} | ||
|
||
async pushDefaultScores() { | ||
// push scoreData content to firestore | ||
const db = getFirestore(); | ||
const scoresRef = collection(db, 'Score'); | ||
for (let i = 0; i < scoreData.length; i++) { | ||
const score = scoreData[i]; | ||
await addDoc(scoresRef, score).then((docRef) => { | ||
console.log("Document written with ID: ", docRef.id); | ||
}).catch((error) => { | ||
console.error("Error adding document: ", error); | ||
}); | ||
} | ||
} | ||
} | ||
|
||
module.exports = pushDefaultValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
<!-- Add the image locate in src/assets/test.png --> | ||
<img src="./src/assets/maimai.png" alt="MaiScore" width="15%"> | ||
|
||
# MaiScore - A Maimai Score viewer | ||
Welcome to MaiScore Project! | ||
|
||
## What is MaiScore? | ||
MaiScore is a Maimai Score tracker. It can track your score and show you the score history. | ||
You can look score form precise chart and precise difficulty. | ||
All work manually, you need to post your score in the form linked to each chart. If some chart is missing, a feature to request a new chart is coming soon. | ||
|
||
## Set up local server | ||
1. Install Node.js | ||
2. Clone this repository | ||
3. Run `npm install` in the repository | ||
4. Configure your firebase information in 'src/config.js' and in 'Command/pushDeaultValue.cjs' | ||
5. Use Kurami for run the command to push default value in firebase using 'npm run kurami load:default:data' | ||
6. Run `npm run dev` to start local server | ||
|
||
## TODO | ||
- Add a feature to request a new chart | ||
- Edit admin part for beter design when adding new chart | ||
|
||
## Libraries | ||
- [React](https://reactjs.org/) | ||
- [Vite](https://vitejs.dev/) | ||
- [Firebase](https://firebase.google.com/) | ||
- [Tailwind CSS](https://tailwindcss.com/) | ||
- [React Router](https://reactrouter.com/) | ||
- [Kurami](https://github.com/nesmon/Kurami) | ||
|
||
## Disclaimer | ||
This project is not affiliated with Sega or any of its subsidiaries. | ||
The name "Maimai" and the logo are trademarks of Sega. | ||
|
||
TODO : Write the readme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"commandsPath": "./Commands" | ||
} |
Oops, something went wrong.