All Projects → BrendoSPinheiro → shrtn-it

BrendoSPinheiro / shrtn-it

Licence: MIT license
A url shortener developed as a course completion project

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to shrtn-it

Quora
Building An Exclusive Community of PEC Graduates and Students.The main features of the website are “PEC Quora” and “PEC Connect”
Stars: ✭ 26 (+62.5%)
Mutual labels:  expressjs, axios, bcrypt
GoBarber
💈 Aplicação de agendamento para serviços de beleza, entre provedores e clientes.
Stars: ✭ 84 (+425%)
Mutual labels:  styled-components, expressjs
rocketshoes-react-native
NetShoes Clone with React Native and Redux
Stars: ✭ 38 (+137.5%)
Mutual labels:  styled-components, axios
react-native-with-laravel
React Native + Laravel API 💥
Stars: ✭ 14 (-12.5%)
Mutual labels:  styled-components, axios
Express React Boilerplate
Express, MySQL, React/Redux, NodeJs Application Boilerplate
Stars: ✭ 179 (+1018.75%)
Mutual labels:  expressjs, axios
BotBlock.org
BotBlock - The List of Discord Bot Lists and Services
Stars: ✭ 29 (+81.25%)
Mutual labels:  knex, expressjs
bubbly
Full stack chat application created w/ Next.js, Socket.IO, Express, React and TypeScript
Stars: ✭ 24 (+50%)
Mutual labels:  styled-components, expressjs
Reeakt
A modern React boilerplate to awesome web applications
Stars: ✭ 116 (+625%)
Mutual labels:  styled-components, axios
React Bootstrap Webpack Starter
ReactJS 16.4 + new React Context API +react Router 4 + webpack 4 + babel 7+ hot Reload + Bootstrap 4 + styled-components
Stars: ✭ 103 (+543.75%)
Mutual labels:  styled-components, axios
Placeline Nextjs
HyperTrack Placeline web application sample using NextJS, Ant-Design, Styled-Components, and Heroku
Stars: ✭ 88 (+450%)
Mutual labels:  styled-components, axios
React App Architecture
React.js Isomorphic Web Application Architecture - Learn to build a complete website for a blogging platform like Medium, FreeCodeCamp, MindOrks etc using React.js, Redux, Material-UI, Express.js, Typescript, Webpack, Babel, and Docker. OpenSource project by AfterAcademy
Stars: ✭ 122 (+662.5%)
Mutual labels:  expressjs, axios
Music163 React
🔥基于React全家桶开发:「网易云音乐PC端项目」实战
Stars: ✭ 209 (+1206.25%)
Mutual labels:  styled-components, axios
Angular Full Stack
Angular Full Stack project built using Angular, Express, Mongoose and Node. Whole stack in TypeScript.
Stars: ✭ 1,261 (+7781.25%)
Mutual labels:  expressjs, bcrypt
proffy
React Native + ReactJS + NodeJS project developed on RocketSeat NexLevelWeek. This project is based on an application for connect students and teachers.
Stars: ✭ 30 (+87.5%)
Mutual labels:  styled-components, axios
Node React Ecommerce
Build ECommerce Website Like Amazon By React & Node & MongoDB
Stars: ✭ 1,080 (+6650%)
Mutual labels:  expressjs, axios
MovieCards
React App that uses TMDb API to display movie data. Try it out! ->
Stars: ✭ 38 (+137.5%)
Mutual labels:  styled-components, axios
Book-Trading-Club
A sample application using node.js api and vuejs
Stars: ✭ 20 (+25%)
Mutual labels:  expressjs, axios
passport-examples
A variety of examples using PassportJS with ExpressJS and ReactJS applications
Stars: ✭ 44 (+175%)
Mutual labels:  expressjs, axios
Moveit
🚀 NLW #4 | React+ TypeScript + NextJS + StyledComponents + Firebase + MongoDb +Axios
Stars: ✭ 39 (+143.75%)
Mutual labels:  styled-components, axios
React Cloud Music
React 16.8打造精美音乐WebApp
Stars: ✭ 1,722 (+10662.5%)
Mutual labels:  styled-components, axios

styled-components eslint airbnb-style MIT License PRs Welcome

Table of Contents

About

This project is a URL shortener developed for my course completion project. Its main objective is to have more control over the expiration of urls and validations of broken or nonexistent urls

Web

access the api source code here: WEB

Screenshots

Installing

First clone this repository:

$ git clone https://github.com/BrendoSPinheiro/shrtn-it.git

second go to the web folder

$ cd ./web

third install the dependencies:

$ yarn

Or:

$ npm install

Was installed and configured the eslint to keep the code clean and patterned.

Usage

To start up the app run:

$ yarn start

Or:

$ npm start

API

access the api source code here: API

Installing

First clone this repository:

$ git clone https://github.com/BrendoSPinheiro/shrtn-it.git

second go to the server folder

$ cd ./server

third install the dependencies:

$ yarn

Or:

$ npm install

Was installed and configured the eslint to keep the code clean and patterned.

Configuring

this application uses the PostgreSQL database.

PostgreSQL

Responsible for storing the data used by the application. For the fastest configuration it is recommended to use docker, you can create a postgresql container like this

$ docker run --name pg -e POSTGRES_USER=root -e POSTGRES_PASSWORD=root -p 5432:5432 -d postgres

You can find the application's knexfile.js file in the root folder. It already comes with test and development connection configured, so you will update it only when deploying

Migrations

Remember to run the PostgreSQL database migrations:

$ npx knex migrate:latest

Or:

$ yarn knex migrate:latest

See more information on Knex Migrations.

.env

in this file, you will configure the jwt key.

key description default
JWTSECRET A alphanumeric random string. Used to create signed tokens. -

Usage

To start up the app run:

$ yarn dev

Or:

$ npm run dev

Bearer Token

A few routes expect a Bearer Token in an Authorization header.

You can see these routes in the Routes section.

POST http://localhost:3001/urls Authorization: Bearer <token>

To achieve this token you just need authenticate through the /sessions route and it will return the token key with a valid Bearer Token.

Routes

route HTTP Method params description auth method
/urls GET Lists urls. Bearer
/urls/:id GET :id of the URL. Get url details. Bearer
/:slug GET :slug of the short url. Redirect short url.
/urls POST Body with new short url data. Create a new short url. Bearer
/urls/:id DELETE :id of the URL. Delete short url. Bearer
/users POST Body with new user data. Create a new user.
/session POST Body with user data. User authentication.

Routes with Bearer as auth method expect an Authorization header. See Bearer Token section for more information.

Requests

  • POST /urls

Request body:

// to shorten an unscheduled URL
{
  "title": "Google",
  "full_url": "https://google.com"
}

// to shorten a URL with scheduling by date
{
  "title": "Google",
  "full_url": "https://google.com",
  "scheduling_type": "date",
  "start_expires_date": "2021-01-20",
  "end_expires_date": "2021-01-22"
}

// to shorten a URL with scheduling by hour
{
  "title": "Google",
  "full_url": "https://google.com",
  "scheduling_type": "hour",
  "start_hour": 0,
  "end_hour": 2
}
  • POST /users
{
  "name": "Fulano",
  "email": "[email protected]",
  "password": "123456"
}
  • POST /session
{
  "email": "[email protected]",
  "password": "123456"
}

Contributors


Brendo Souza
Backend


Matheus Oliveira
Frontend


Emmanoell Pasquet
Author of the article

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].