Git Product home page Git Product logo

backend's Introduction

The videu Backend Server

Build Status Code Coverage

This is the source tree of the videu backend server, the RESTful HTTP API that powers the FreeTube platform.

WARNING: This Is Pre-Alpha Software!

This application should not be exposed to the Internet because it is not stable yet.

License

Copyright © 2020 The videu Project. All rights reserved.

This software is licensed under the AGPLv3, see the LICENSE file for details.

Development Setup

You will need:

  • NodeJS >= 12.4 (and npm ofc)
  • a MongoDB server (there are plans for using mongodb-memory-server in development mode by default, but this is not a priority right now)
  • a UNIX system (Linux, *BSD and MacOS should all work)
  • a decent IDE with TypeScript support
  • (optionally) an SMTP server with TLS support

You might be able to run it on Windows, but this is not supported and highly discouraged. If you absolutely need to, use the Windows Subsystem for Linux.

Clone the repository, open a shell in the project's root directory and type npm i to install all dependencies. Copy the .env.default file to .env and adjust the configuration parameters accordingly. Finally, type npm run-script dev to start a local development server.

We recommend Postman for sending requests, but you can basically use any other REST debugging tool (or curl if you're a UNIX neckbeard).

The Obligatory Begging for Money

Yes, asking for money when there is almost no working code yet is quite bold, but come on. I am a broke student who literally re-writes YouTube all by himself. If you got some money to spend, I would highly appreciate it if you gave me a buck or two so I don't have to die from starvation.

PayPal: https://paypal.me/sandtler
BTC: bc1q9zj2ay3zz97rpf7kfw8a5w8d7acs73zdkeepny
ETH: 0x99aFdc6EE3e7cAB67e83E56598fee77BFc21dC56

It should be noted, however, that you absolutely don't have to donate something if you don't want to.

backend's People

Contributors

dependabot[bot] avatar fef1312 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

backend's Issues

Certs are always stored in PEM format

JWT certificates that have been generated at initialization (development mode only) are always written to disk in PEM format, even if the configuration specified a .der extension. We could either write a complicated (and possibly error-prone) API for converting certificates to DER based on the file extension from the config, or just abandon DER support all together. I'll probably head for the latter approach since this platform is written for FreeTube and not meant to be run anywhere else, which means that designing the server to be configured in a particularily convenient manner is definitely not a priority.

Implement changing the email address

Email addresses, once a user has signed up, need to be able to change. For that, the backend has to send an email to both the old and new address in order to ensure that the user is always reachable.

Avoid global namespace pollution

Right now, anything that is required in multiple places is either stored in the global.videu object (for configuration data) or the module exporting it is just imported wherever needed (e.g. the repositories).

This scheme kind of works, but making mistakes is quite easy and it gets more and more difficult to maintain as the codebase grows. Especially stuff like modifying types from external packages (express in this case) is probably a time bomb. We should migrate to a more sophisticated, object-oriented design. This not only provides better ways of abstraction, it also enables us to use TypeScript's type system to its full extent (I'm thinking of stuff like the request body from express, which has no central validation system right now and has an any type).

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.