GithubHelp home page GithubHelp logo

isfopo / ambitus-studio-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.83 MB

Ambitus Studio is a collaborative music making platform that allows you to create music across the internet with anyone.

License: MIT License

JavaScript 100.00%

ambitus-studio-api's Introduction

Ambitus Studio API

Ambitus Studio is a collaborative music making platform that allows you to create music across the internet with anyone. Supports both audio and midi tracks and works like many moderns DAWs where the smallest unit of music is a clip which is owned by both a track and a scene. A track assigns the timbre of each clip and can only contain clips of either entirely audio or midi. Roughly, this translates to a single instrument, like a guitar or a drumset. A scene is like a section of music that can contain zero or one clip per track that is meant to be played simultaneously with the rest of the clips in the scene.

Setup

This project will need to use PostgreSQL. If you do not have it installed on your machine, please use the following instructions: Windows || Mac || Linux

To start api run these commands in a location you want to store the project:

git clone https://github.com/isfopo/ambitus-studio-api.git
cd ambitus-studio-api
npm install

After this step, create a .env file that contains the following information:

PORT = // the port to run the server
DB_USER = // the username for the database you created
DB_PASSWORD = // the password for the database you created

SALT_ROUNDS = // the number of salt round for the password hash (13 is recommended)

JWT_SECRET = // a very long string to be used for the JWT

Then finally use:

npm start

This will seed the database and start a server on localhost:3000.

(Uses node.js version 14.15.4)

Demonstration

Using either Insomnia or Postman with the server running, feel free to explore any available route. Routes with multiple functionality (like GET /project) will have separate request demonstrations to show each way to use the route.

Some routes require an authorization token in order to work. The routes that do have a placeholder token, but that token will not work because it is expired. To get a fresh token, use the "Login" request. You can use the default example user "jim" which has access to the rest of the example requests, or, after using the "Create User" request, login to your newly created user.

This token can be copied and pasted into the authorization header of any route that requires it and expires after an hour. After that to continue to use the api, request another token via the "Login" request.

Socket Demo

To see client-to-client real-time updates using Socket.io, open the repo ambitus-studio-api-socket-demo

While having this api running, follow the instructions in the README.md.

Testing

To run tests, have the repo download and the dependencies installed then run:

npm test

This will run all tests. To run only specific test suites, see package.json. All test scripts are prefixed with "test-" and can be run using "npm run script-name"

Challenges

  • Authentication and authorization

    • hashes and safely stores passwords using bcrypt.
    • allows users to have an access token for authentication using JSON Web Token.
    • has two authentication processes - one to authorize the user and another to allow user to have access to a given project.
  • File Storage

    • uses multer to store an audio or image file on the system, saving the path to that file in the database
    • deletes old file when new file is added
  • Testing

    • uses Mocha and the node assert library to drive unit driven development
    • learning best practices regarding breaking down functionality led to smarter refactoring and abstraction of code and ultimately produced better code faster than without testing

Technologies Used

  • Node.js
  • Express
  • PostgreSQL
  • Sequelize
  • Mocha
  • bcrypt
  • JWT
  • multer

For project breakdown, see /documentation/project-plan.md

ambitus-studio-api's People

Contributors

isfopo avatar

Watchers

 avatar

ambitus-studio-api's Issues

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.