Skip to content

An API to generate Agora.io video call token and register users and schedules.

Notifications You must be signed in to change notification settings

kirodoras/see-me-back

Repository files navigation


logo

See me

Back end Development Project
Browse TypeScript code

Front end repository

Built With

Table of Contents

Description

An API to generate Agora.io video call token and register users and schedules.

Getting Started

This Api can be used in two different ways: by cloning the project or by using your preferred client, such as Insomnia or Postman.

First of all configure an .env file following the .env.example

To clone the project, run the following command:

git clone https://github.com/kirodoras/see-me-back

Then, navigate to the project folder and run the following command:

to install dependencies:

npm i -y

to migrate the database:

npm run migrate

Finally, start the server:

npm run dev

You can now access the API's endpoints by navigating to http://localhost:5008/ or to the deployed URL https://app-see-me.herokuapp.com/.

Running tests

After following the Getting Started steps, follow the commands:

First of all configure an .env.test file

to migrate the test database:

npm run test:migrate

Finally, run the integration tests:

npm run test

or run the unit tests:

npm run test:unit

Coverage

Statements coverage

Draw SQL

Draw SQL

Routes

Token /token

Users /users

Schedules /schedules

Token

GET /token?channelName={NAME}
    - headers: {}
    - body: {}
RESPONSE IN SUCCESS
    - status: 200
    - data: {
        token: AGORA.IO CHANNEL TOKEN
    } 

Users

Login

POST users/login
    - headers: {}
    - body: {
        email: "hulk@email.com",
        name: "Bruce Banner",
        picture: "https://picture.url..."	
    }
RESPONSE IN SUCCESS
    - status: 201
    - data: {
        email: "hulk@email.com",
        name: "Bruce Banner",
        picture: "https://picture.url...",
        token: JWT TOKEN
    } 

Find

POST users/find
    - headers: {}
    - body: {
        email: "hulk@test.com",
    }
RESPONSE IN SUCCESS
    - status: 200
    - data: {
        email: "hulk@email.com",
        name: "Bruce Banner",
        picture: "https://picture.url...",
        token: JWT TOKEN
    }    

Schedules

Create a schedule

POST /schedules/create
    - headers: {
      "Authorization": Bearer [JWT-TOKEN]
    }
    - body: {
        title: "My title",
        hours: "12:12"
    }
RESPONSE IN SUCCESS
    - status: 201
    - data: {
        id: 6,
        title: "My title",
        hours: "12:12",
        user_id: 2
    }

Find schedules by user id

GET /schedules/findByUserId
    - headers: {
      "Authorization": Bearer [JWT-TOKEN]
    }
    - body: {}
RESPONSE IN SUCCESS
    - status: 200
    - data: Object[] of schedules

Delete schedule by id

GET /schedules/delete/:id
    - headers: {
      "Authorization": Bearer [JWT-TOKEN]
    }
    - body: {}
RESPONSE IN SUCCESS
    - status: 200

Contact

LinkedIn

About

An API to generate Agora.io video call token and register users and schedules.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published