Giter VIP home page Giter VIP logo

403-fruit / codebases Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reacttips-dev/codebases

0.0 0.0 0.0 91.91 MB

This project is collection of large projects's source code (codebases), built with Reactjs. Eg: Bestbuy, Postman, Trello, Udacity, Coursera, Skillshare, Invision, Intercom, Pipedrive, ... and more.

TypeScript 54.30% HTML 0.99% CSS 1.05% JavaScript 38.52% SCSS 3.09% Less 0.66% Sass 0.26% Mustache 0.08% Stylus 0.81% Pug 0.01% CoffeeScript 0.24%

codebases's Introduction

Codebases

This is collection of some big project's codebases built with Reactjs that direct downloaded from some websites. They're good for reading and studying, but not recommended for using in product.

All of codebases in this repo should be reviewed by our team, to ensure they are good for users to reference.

How we get the source code?

This picture show how we get the source code.

Screen Shot 2021-09-24 at 21 20 37

See the "Automate saving source code files" section for an easy way to export the source-mapped files

Index

Notes:

  • Before you submit a PR to add a codebase to this repo, you must add it to this index
  • Try to keep those items bellow in alphabet sort
  • Named template: NAME (URL) - CATEGORIES / ADDED_BY, ADDED_AT. eg: Zappos (https://www.zappos.com/) - eCommerce / Cong Nguyen, 2021/09/20

A


B


C


D


E


F


G


H


I


J


K


L


M


N


O


P


Q


R


S


T


U


V


W


X


Y


Z

How to contribute

Contributions are always welcome, no matter how large or small!

(document how to make a PR is in construction)

Community

We have a facebook group for update and talking about these codebases. Unfortunately, only Vietnamese is supported now. Click here to visit our group.

Automate saving source code files

Chrome Devtools does not allow you to save entire folders from the sources tab, but you can automate this process by opening a Devtools window for the Devtools window itself. To do this:

  • Navigate to chrome://inspect/#pages in your browser.
  • Look for a title like "DevTools - example.com" where example.com is the target site, and click inspect to open a new Devtools window.
  • In the new devtools window, use the following snippet to generate a JSON of all the source-mapped files from the target site.
    // Chrome update made this obsolete
    // let srcMappings = Bindings.resourceMapping.workspace.uiSourceCodes();
    // let srcFiles = Array.prototype.filter.call(srcMappings, (f) => {
    //     return !/^(webpack:\/\/\/.\/node_modules|debugger:\/\/|chrome-extension:\/\/)/.test(f.parentURLInternal)
    // });
    
    let srcFiles = Bindings.debuggerWorkspaceBinding.workspace.projectsForType("network")
        .find(p => p.idInternal === "jsSourceMaps::main")
        .uiSourceCodesList;
    
    await Promise.all(srcFiles.map(async (f) => {
        let file = await f.requestContent();
        if (file.content === null) file.content = file.error || "Error loading file";
    
        let name = f.displayName();
        if (name === "(index)") name = "index.html";
        if (/\?/.test(name)) name = name.replace(/\?.*/, "");
    
        let originName = f.originInternal.replace(/^https?:\/\//, "").replace(/:?[\/\\]+$/g, "").replace(/[\/\\]+/g, "_");
        return {
            name: f.displayName(),
            path: f.parentURLInternal.replace(f.originInternal, ""),
            content: file.content,
            origin: originName
        };
    }));
  • Copy the JSON output from the previous snippet
  • Using NodeJS, run the following snippet after modifying it with the JSON copied in the previous step.
    const srcFiles = {}; // Replace with copied JSON
    const fs = require("fs");
    const path = require("path");
    
    const outDir = "./output";
    if (!fs.existsSync(outDir)) fs.mkdirSync(outDir);
    
    srcFiles.forEach((file) => {
        file.origin = file.origin.replace(/[\\\/\?\|:\*<>]/g, "");
        file.name = file.name.replace(/\?.*$/g, "").replace(/[\\\/\?\|:\*<>]/g, "");
        const destDir = path.join(outDir, file.origin, file.path).replace(/[\?\|:\*<>]/g, "");
    
        if (!fs.existsSync(destDir)) fs.mkdirSync(destDir, { recursive: true }); 
        try {
            fs.writeFileSync(path.join(destDir, file.name), file.isEncoded ? atob(file.content) : file.content);
        } catch(e) {
            console.warn(`Failed writing file '${path.join(destDir, file.name)}' -`, e.message);
        }
    });

codebases's People

Contributors

403-fruit avatar bboy114crew avatar htdangkhoa avatar ladifire avatar vulxan 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.