Skip to content

Skizzium/Project-Ocean_Depths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,354 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skizzium API [Project Ocean Depths]

Welcome to the Skizzium API repository, housing all the inner workings of Skizzium.
If you're reading this, you're definitely a developer who is probably accessing this repository for their first time.
Let me teach you how stuff works around here.

Needed Software

Before anything, you have to install the following software to help you along on your journey:

  • (Required) MongoDB Community Server
    • A local database to use during development
  • (Practically Required) MongoDB Compass
    • For connecting to your local MongoDB instance and controlling the data on it
  • (Optional) Redis
    • Required for storing data in memory. Currently only used in the Gateway module. If not installed, the Gateway module will exit on startup.
    • If you're on Windows, installation requires the Windows Subsystem for Linux installed.
    • Installation instructions available here.
  • (Optional) RabbitMQ
    • Required for communication between the Gateway and the API modules.
    • Installation instructions available here.
  • (Recommended) Postman
    • For sending HTTP requests to your endpoints to test them
    • Alternatives: Insomnia, cURL
  • (Recommended) Visual Studio Code
    • Prettier Extension (Recommended)
    • ESLint Extension (Recommended)
    • Alternatives: Notepad++, Sublime Text, Atom, JetBrains WebStorm, etc.

Setting Up

It's fairly easy to set up the server

  1. Clone the development branch
  2. Rename the .env-template to .env
  3. Fill out the needed variables in the .env file
  4. Download the MongoDB community setup from the website and run it.
    • Add the path to the bin (eg C:/Program Files/MongoDB/Server/5.0/bin) folder to your Path variable if it wasn't added automatically.
  5. (Optional) Download and setup WSL and Redis
  6. (Optional) Download and setup RabbitMQ
  7. Run npm install to install all dependencies

Starting Up

  1. Run MongoDB with npm run mongo
  2. Run the Nginx reverse proxy with npm run proxy
  3. (Optional) Run wsl and then sudo service redis-server start to start up Redis
  4. (Optional) Run RabbitMQ using the start menu shortcut
  5. Run individual microservices you'll need to develop or use for other work.

Included Services

  • Emails
    • A local email service can be ran which will pretend to send out emails.
    • Start with npm run mail
    • You can access the dashboard at http://localhost::8025
  • File Hosting
    • A local file hosting service can be ran to allow file uploads to work.
    • Start with npm run files
    • If you need to access the files trough a frontend, please run the Media Proxy (npm run media-proxy) as well.
    • You can access the dashboard at http://localhost:9000. The credentials are minioadmin:minioadmin.

The Monorepo

The Skizzium API consists of many microservices (each microservice is a module).
The API consists of the following microservices:

  • Authentication (npm run auth)
    • (Shortened to Auth)
    • Responsible for all authentication tasks, such as logging in, logging out, registering, etc.
    • If you need the register endpoint working, the email service is required
    • If you need logouts and session revokes to work, you need the Redis and RabbitMQ services.
  • Builds (npm run builds)
    • Accepts mod releases and game builds which are then pushed to the S3 bucket.
  • Community (npm run community)
    • Responsible for the community aspects of the API such as editing profile info, uploading avatars and banners, and etc.
    • If you need file uploads and downloads to work (including images), you'll need the files service.
  • Downloads (npm run downloads)
    • Responsible for managing access to mod files and counting downloads.
    • Requires the files service to be running.
  • Gateway (npm run gateway)
    • Gateway API which clients connect to via WebSockets and recieve events. It's also responsible to determine if a session is active or not.
  • Moderation (npm run downloads)
    • Responsible for content moderation
  • Mods (npm run mods)
    • Responsible for the mod distribution aspects of the API such as creating and managing mod pages, posting comments and etc.
    • If you need file uploads and downloads to work (including images), you'll need the files service.

There's also some additional modules which aren't microservices:

  • Common (Legacy)
    • Used for shared code between all microservices. This is usually DB models, constants, utility functions and etc.
  • Common TS (Modern)
    • Used for shared code between all microservices. This is usually DB models, constants, utility functions and etc.
  • Proxy (Not a module anymore)
    • The proxy which accepts all requests and forwards them to the appropriate microservices

If you want to install or uninstall a package only to / from a specific module, use the --workspace=@skizzium-api/<module> parameter.

Prettier & ESLint

This repo utilizes Prettier and ESLint to fix minor issues and keep the code style intact.

All PRs should pass the checks before they are merged. To format everything properly, run npm run fix. If you don't want to do this every time you want to make a new PR, simply install the ESLint and Prettier plugins in your editor.

Tests

To make sure everything works like a charm, we'll require you to write unit tests with the help of Jest and Supertest. All PRs will be tested before they are merged.
Don't worry yet though, we still haven't implemented the system properly.

About

Repository containing the Skizzium backend and API.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors