Coder Social home page Coder Social logo

dromzeh / api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from genshindev/api

0.0 0.0 0.0 289.16 MB

A fan-made Genshin Impact API for easy access to game data.

Home Page: https://api.genshin.dev

License: Open Software License 3.0

TypeScript 44.89% Dockerfile 1.25% JavaScript 53.86%

api's Introduction

genshin.dev API

chat on Discord

An API that serves data for the game Genshin Impact by miHoYo (the game is made by miHoYo, not the API).

An always up-to-date version is hosted at https://api.genshin.dev!

Planned Features

  • Entity relationships (e.g. characters linking to the best weapon for them)
  • Web UI to make adding data even more simple

Prerequisites

  • Node.js: ^12.0.0
  • NPM or any other Node.js package manager

Installation

Install packages with your preferred package manager, e.g. npm:

npm install

If you want to have the API running on a different port, rename the .env.example into .env and change the API_PORT field to your preferred port.
Depending on if you want to install the API for production or for development, the process is different.

Production

Build the project using the following command:

npm run build

Then start the server with this command:

node .

Development

Watch the project's files via the following command:

npm run watch

Then start the dev server with this command:

npm run dev

Contributing

Contributing is pretty simple if you want to just add new characters, nations, new entity types, translations etc, which will be explained in the following sections.
Then simply create a new Pull Request with your changes and we will have a look at it as soon as we have time!

Adding a new entity to an existing type

For adding a new entity to an already existing entity type, simply add a new folder in the assets/data/{entityType} folder with {entityType} being replaced with the name of the entity you want to add in all-lowercase and each white-space replaced with a -, e.g. Knights of Favonius becomes knights-of-favonius.
Then create a en.json file which contains all the basic data of the entity you're adding, preferably with the same field names that other entities with the same entity type have. \

Adding a new entity type

Adding a new entity type is very, very simple. All you need to do is create a new folder in the assets/data directory, e.g. nations. The name of the folder should be in all-lowercase and have each white-space replaced with a -, e.g. Cooking Ingredients becomes cooking-ingredients.
Then simply add new entities to your new entity type as described in Adding a new entity to an existing type.

Adding entity translations

Adding translations to an already existing entity is as trivial as adding a new file with the name {countryCode}.json with {countryCode} being replaced with the country code of the language you want to add, e.g. if you wanted to add French it would be fr.
Then simply add overrides for the data that's present on the en.json with the translated content.
Note that it is preferred if you use official translations over your own translations where possible.

Adding images to an entity

For entities like characters, images are being served from assets/images/{entityType}/{entityId}. These images can be in any image format (heic, heif, jpeg, jpg, png, raw, tiff, webp, gif), but have their extension stripped, e.g. icon.webp becomes icon.
Then simply add the file to the assets/images/{entityType}/{entityId} folder or create it if it doesn't already exist.

License

Licensed under Open Software License v3.0

api's People

Contributors

adithamafadil avatar amphy avatar apex2504 avatar augus01 avatar bryanless avatar deepnimma avatar donovangg avatar dromzeh avatar estyms avatar exhabition avatar gergerapex1 avatar ink-soul avatar irevenko avatar jmpjns avatar khelthos avatar liz3 avatar luminettebourgeons avatar m4gicb avatar midna92 avatar oscarsandford avatar psdat123 avatar pv42 avatar r1df avatar rockett68 avatar salomekbg avatar spongerxd avatar stupid-benz avatar tainted06 avatar tokino avatar xlenore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.