Skip to content

The API will use to create a database of a tracking app. Users can manage the number of tasks and measure the time spent on tasks.

Notifications You must be signed in to change notification settings

jessicafarias/tracking_app_api

Repository files navigation

Trakin Application Programming Interface

This is a back-end API, which provides data to this application that I developed.

Tracking app

Tracking your time

Contributors Forks Stargazers Issues

Track

This project is created with the porpuse of register and tracking the time invested on diferent tasks. The UI has diferent interactive elements like a toogle, a funcional carousel to see the task. Also the login/logout is implemented using tokens so fell free to use any password it will be encripted.

Features:

  • Create a new user and return a token
  • Require authentication for login
  • Filter the password
  • Create tasks for users

Base URL for request

It's deployed here on heroku

Built With

This project was built using these technologies.

  • Ruby on Rails
  • rack-cors
  • GitHub
  • Rubocop
  • Stylelint

Getting Started

To get a local copy up and running follow these simple example steps.

Clone

  • Clone this repo:
    • Clone with SSH:
      [email protected]:jessicafarias/tracking_app_api.git
    
    • Clone with HTTPS
      https://github.com/jessicafarias/tracking_app_api.git
    
    • Clone with GitHub CLI
      gh repo clone jessicafarias/tracking_app_api.git
      
    
  • cd to tracking_app_api.git

Setup

Install dependencies:

$ bundle install

Start the local webserver:

$ rails s -p 3002 will open the project at local webserver at http://localhost:3002/

Using | Requests examples using JS

for all request you will need base URL: const baseUrl = https://jesapi.herokuapp.com

Create New task

const url = `${baseUrl}/tasks`;
const config = `{
    method: 'POST',
    mode: 'cors',
    headers: {
      'Content-Type': 'application/json',
      Authorization: ` Bearer ${token} `,
    },
    redirect: 'follow',
    body: JSON.stringify(data),
  }`

Get all tasks

const url = `${baseUrl}/tasks/`;
const config = `{
    method: 'GET',
    mode: 'cors',
    headers: {
      Authorization: `Bearer ${token} `,
    }`

Get tasks created today

const url = `${baseUrl}/tasks/today`;
const config = `{
    method: 'GET',
    mode: 'cors',
    headers: {
      Authorization: `Bearer ${token}`,
    }`

Get tasks created yesterday

const url = `${baseUrl}/tasks/yesterday`;
const config = `{
    method: 'GET',
    mode: 'cors',
    headers: {
      Authorization: `Bearer ${token}`,
    }`

Get tasks selecting the date

const url = `${baseUrl}/tasks/30-03-2021`;
const config = `{
    method: 'GET',
    mode: 'cors',
    headers: {
      Authorization: `Bearer ${token}`,
    }`

Create User and Session (Sing up)

const url = `${baseUrl}/users/sign_up`;
const config = `{
    method: 'POST',
    mode: 'cors',
    headers: { 'Content-Type': 'application/json' },
    redirect: 'follow',
    body: JSON.stringify(data),
  },`

Create Session (Login)

const url = `${baseUrl}/users/sign_in`;
const config = `{
    method: 'POST',
    mode: 'cors',
    headers: { 'Content-Type': 'application/json' },
    redirect: 'follow',
    body: JSON.stringify(data),
  }`

Destroy session (Sing out)

const apiUrl = `${baseUrl}/users/sign_out`;
const config = `{
    method: 'POST',
    mode: 'cors',
    headers: { 'Content-Type': 'application/json' },
    redirect: 'follow',
    body: JSON.stringify(data),
  }`

Author

👤 Jessica Michelle Farías Rosado:

Working as a FullStack developer on this project.

Website

LINKEDIN

EMAIL

TWITTER

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐ if you like this project!

📝 License

This project is MIT licensed.

About

The API will use to create a database of a tracking app. Users can manage the number of tasks and measure the time spent on tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published