diff --git a/README.md b/README.md index 5f45ace..8dcc3e1 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,44 @@ -# shortlr2-backend -Source code for backend of Shortlr v2 +

+ Coding Blocks Online

-## Development +

+ + Follow @codingblocksin + +

+ +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) diff --git a/docs/illustrations/coding-blocks-logo.png b/docs/illustrations/coding-blocks-logo.png new file mode 100644 index 0000000..3005563 Binary files /dev/null and b/docs/illustrations/coding-blocks-logo.png differ