Skip to content

Commit

Permalink
feat: added docs website
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaykumar97 committed Jun 28, 2021
1 parent dbb9966 commit 05f024f
Show file tree
Hide file tree
Showing 26 changed files with 9,621 additions and 0 deletions.
20 changes: 20 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
33 changes: 33 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

## Installation

```console
yarn install
```

## Local Development

```console
yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

## Build

```console
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

## Deployment

```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions website/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
4 changes: 4 additions & 0 deletions website/docs/getting-started/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Getting Started",
"position": 1
}
43 changes: 43 additions & 0 deletions website/docs/getting-started/installing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
sidebar_position: 1
---

# Installing

Generate a new React-Native app using the **@ajaysidhu/react-native-template**:

```shell
npx react-native init MyApp --template @ajaysidhu/react-native-template
```

After that, we need to install the dependencies to use the project on iOS(you can skip this part, if you are using this on Android).

Now run a simple: `npx pod-install` or `cd ios && pod install`. After that, you should be able to use the newly initialised app on both Platforms, iOS and Android.

:::danger Take care

The above command will fail if you have the global legacy `react-native-cli` installed.

:::

Make sure you uninstall it first(only if you have the old version of the `react-native-cli`):

```shell
yarn global remove react-native-cli
```

or if using `npm`

```shell
npm uninstall -g react-native-cli
```

## Older versions

If you need to use an older version of react-native-template, then you will need to run a:

```shell
npx react-native init MyApp --template @ajaysidhu/react-native-template@version
```

You can look at all versions, that I have published [here](https://github.com/ajaykumar97/react-native-template/releases).
15 changes: 15 additions & 0 deletions website/docs/getting-started/libraries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
sidebar_position: 2
---

# Libraries

- Navigation using [react-navigation (v5)](https://reactnavigation.org/)
- State management using [redux](https://redux.js.org/)
- Redux middleware [redux-saga](https://redux-saga.js.org/)
- Env config management using [react-native-config](https://github.com/luggit/react-native-config)
- Splash screen using [react-native-bootsplash](https://github.com/zoontek/react-native-bootsplash)
- API request using [axios](https://github.com/axios/axios)
- Localization using [react-native-localization](https://github.com/stefalda/ReactNativeLocalization)
- Responsive UI using [react-native-size-matters](https://github.com/nirsky/react-native-size-matters)
- Image caching using [react-native-fast-image](https://github.com/DylanVann/react-native-fast-image)
40 changes: 40 additions & 0 deletions website/docs/getting-started/project-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
sidebar_position: 3
---

# Project Structure

```
root
├── __tests__
├── android
├── ios
├── scripts
├── src
│   ├── assets
│   │ ├── fonts
│   │ ├── images
│   │ └── index.js
│   ├── commonComponents
│   ├── localization
| | ├── en.js
| | └── index.js
│   ├── navigation
│   │ ├── AppNavigator.js
│   │ ├── AuthNavigator.js
│   │ └── MainNavigator.js
│   ├── screens
│   ├── store
│ ├── utilities
│ │ ├── constants
│ │ ├── helperFunctions
│ │ ├── layout.js
│ │ ├── logger.js
│ │ ├── NavigationService.js
│ │ └── request.js
│ └── App.js
├── .env
├── .env.production
├── .env.staging
└── index.js
```
84 changes: 84 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'React Native Template',
tagline: 'Reduce project initialization time by 80%',
url: 'https://your-docusaurus-test-site.com',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'ajaykumar97',
projectName: 'react-native-template',
themeConfig: {
navbar: {
title: 'React Native Template',
logo: {
alt: 'react-native-template Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'doc',
docId: 'getting-started/installing',
position: 'left',
label: 'Docs',
},
{
href: 'https://github.com/ajaykumar97/react-native-template',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Installing',
to: '/docs/getting-started/installing',
},
{
label: 'Libraries',
to: '/docs/getting-started/libraries',
},
{
label: 'Project Structure',
to: '/docs/getting-started/project-structure',
},
],
},
],
copyright: 'Made with ❤️ by Ajay Kumar',
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/ajaykumar97/react-native-template/edit/master/website/',
},
blog: {
showReadingTime: true,
editUrl:
'https://github.com/ajaykumar97/react-native-template/edit/master/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};
40 changes: 40 additions & 0 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.1",
"@docusaurus/preset-classic": "2.0.0-beta.1",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"url-loader": "^4.1.1"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
3 changes: 3 additions & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
};
64 changes: 64 additions & 0 deletions website/src/components/HomepageFeatures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from 'react';
import clsx from 'clsx';
import styles from './HomepageFeatures.module.css';

const FeatureList = [
{
title: 'Easy to Use',
Svg: require('../../static/img/undraw_docusaurus_mountain.svg').default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
</>
),
},
{
title: 'Focus on What Matters',
Svg: require('../../static/img/undraw_docusaurus_tree.svg').default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
</>
),
},
{
title: 'Powered by React',
Svg: require('../../static/img/undraw_docusaurus_react.svg').default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
</>
),
},
];

function Feature({Svg, title, description}) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
<Svg className={styles.featureSvg} alt={title} />
</div>
<div className="text--center padding-horiz--md">
<h3>{title}</h3>
<p>{description}</p>
</div>
</div>
);
}

export default function HomepageFeatures() {
return (
<section className={styles.features}>
<div className="container">
<div className="row">
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</div>
</section>
);
}
13 changes: 13 additions & 0 deletions website/src/components/HomepageFeatures.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* stylelint-disable docusaurus/copyright-header */

.features {
display: flex;
align-items: center;
padding: 2rem 0;
width: 100%;
}

.featureSvg {
height: 200px;
width: 200px;
}
Loading

0 comments on commit 05f024f

Please sign in to comment.