Code Monkey home page Code Monkey logo

random-user's Introduction

Getting Started with Create React App

This project was bootstrapped with Create React App.

How to run project

Package Manager

In the project directory, you can use Yarn as the package manager. First, run:

yarn

This command installs all the project's dependencies. To start the local development server, use the following command:

yarn start

The project will be accessible at http://localhost:3000. To build the project for production use the following command:

yarn build

To serve the production build, you can use the following command:

serve -s build

Again, the project will be accessible at http://localhost:3000.

Folder structure

the structure of the project is inspired by Atomic Design.

.
src/
├── components/
│   ├── elements/
│   │   ├── button/
│   │   │   ├── Button.tsx
|   |   |   ├── button.module.css
│   │   │   └── Button.test.js
│   │   ├── card
│   │   ├── ...
│   │   └── index.ts
│   ├── fragments/
│   │   ├── UserCard/
│   │   │   ├── UserCard.tsx
│   │   │   └── UserCard.test.js
│   │   ├── ...
│   │   └── index.ts
│   ├── layout/
│   │   ├── header/
│   │   │   └── Header.tsx
│   │   ├── footer
│   │   ├── container
│   │   ├── pageLayout
│   │   ├── ...
│   │   └── index.ts
│   └── pages/
│       ├── home/
│       │   ├── components/
│       │   │   ├── AnyComponent.tsx
│       │   └── Home.tsx
│       └── index.ts
├── utils/
│   ├── objectToQueryString.ts
│   ├── request
│   ├── ...
│   └── index.ts
├── hooks/
│   ├── useFetchRandomUser.ts
│   ├── ...
│   └── index.ts
├── consts/
│   ├── endpoints.ts
│   ├── externalLinks.ts
│   ├── ...
│   └── index.ts
└── types/
    ├── user.ts
    ├── ...
    └── index.ts

components folder divided to four modules as following:

  1. Elements: This folder contains shared components, also known as common components, that cannot be further divided into smaller independent components.
  2. Fragments: Fragments are reusable components that are built using elements. They combine multiple elements to form more complex and self-contained components.
  3. Layouts: The layouts folder encompasses components related to the overall layout and container structure of the application. These components define the high-level structure and positioning of other components.
  4. Pages: The pages folder contains components specific to individual pages. These components are unique to a particular.

In addition to these modules, there are other ones such as utils, hooks, queries, ...

Within this architecture, each module has its own index file that serves as a central point of export for all the components within that module.

random-user's People

Contributors

amin-partovi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.