Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readne Updated #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
# shortlr2-backend
Source code for backend of Shortlr v2
<h1 align="center"><a href="https://online.codingblocks.com">
<img src="https://raw.githubusercontent.com/YashKumarVerma/shortlr2-backend/readme-update/docs/illustrations/coding-blocks-logo.png" alt="Coding Blocks Online"/></h1>

## Development
<p align="center">
<a href="https://twitter.com/intent/follow?screen_name=codingblocksin">
<img src="https://img.shields.io/twitter/follow/codingblocks.svg?label=Follow%20@codingblocksin" alt="Follow @codingblocksin" />
</a>
</p>

This is the source code for the URL shortener service for Coding Blocks. It has the backend as well as the frontend combined. With goo.gl having shut down and most unique single word links at bit.ly having run out, we have made cb.lk open for anyone to use. Only one catch - you need to login using a Coding Blocks account.

## Prerequisites

### Scripts
You will need the following things properly installed on your computer.

#### `yarn start`
Starts the server
- [Git](https://git-scm.com/)
- [Node.js](https://nodejs.org/)
- [Yarn](https://yarnpkg.com/)

#### `yarn lint`
Shows lint errors
## Installation

#### `yarn lint:fix`
Fixes lint error (those that can be auto fixed)
- Clone the repository using `git clone https://github.com/coding-blocks/shortlr2-backend`
- Open the cloned repository `cd shortlr2-backend`
- Create new client credentials on [OneAuth](https://account.codingblocks.com/clients/add)
- Set `domain` as `localhost:3987`
- Set `client ame` as a string to identify this client uniquely
- Set `callback url` as `http://localhost:3987/login/callback`
- Set `default url` as `http://localhost:3987`
- Enter the `ONEAUTH_CLIENT_ID` and `ONEAUTH_CLIENT_SECRET` obtained in `secrets.json`
- Install packages using `yarn install`.

## Development

#### `yarn test`
Run unit tests
- Start the development version by running `yarn dev`
- Visit [http://localhost:3987](http://localhost:3987).
- To generate coverage reports, run `yarn cover`

#### `yarn cover`
Generate code coverage report
## Production

- Run `yarn start`. This would
- First run linting fixes on application (lint)
- Then transpile the application using typescript (build)
- Then run the tests (test)
- Then launch the application (run)
Binary file added docs/illustrations/coding-blocks-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.