├── .github
├── FUNDING.yml
├── dependabot.yml
└── workflows
│ ├── ci.yml
│ └── release.yml
├── .gitignore
├── LICENSE
├── README.md
├── SECURITY.md
├── assets
├── .DS_Store
├── favicon.png
├── favicon.psd
├── icon.png
├── logo-blue.png
├── logo-dark.png
├── logo-light.png
├── logo.psd
└── mocky-social.png
├── client
├── .babelrc
├── .editorconfig
├── .env
├── .eslintignore
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .yarnclean
├── README.md
├── package.json
├── public
│ ├── apple-touch-icon.png
│ ├── assets
│ │ └── mocky-social-twitter-final.png
│ ├── css
│ │ ├── iconsmind.css
│ │ └── socicon.css
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── favicon.ico
│ ├── favicon.png
│ ├── fonts
│ │ ├── iconsmind.eot
│ │ ├── iconsmind.ttf
│ │ ├── iconsmind.woff
│ │ ├── socicon.eot
│ │ ├── socicon.svg
│ │ ├── socicon.ttf
│ │ └── socicon.woff
│ ├── index.html
│ └── robots.txt
├── server.js
├── src
│ ├── components
│ │ ├── CookieNotification
│ │ │ ├── CookieNotification.tsx
│ │ │ └── styles.css
│ │ ├── ErrorBoundary
│ │ │ └── ErrorBoundary.tsx
│ │ ├── Loader
│ │ │ ├── Loader.tsx
│ │ │ └── styles.css
│ │ ├── ScrollToTopOnNavigationChange
│ │ │ └── ScrollToTopOnNavigationChange.tsx
│ │ ├── SelectCharset
│ │ │ ├── SelectCharset.tsx
│ │ │ └── models.ts
│ │ ├── SelectContentType
│ │ │ ├── SelectContentType.tsx
│ │ │ └── models.ts
│ │ ├── SelectExpirationTime
│ │ │ └── SelectExpirationTime.tsx
│ │ ├── SelectHttpStatusCode
│ │ │ ├── SelectHttpStatusCode.tsx
│ │ │ ├── models.ts
│ │ │ └── styles.css
│ │ ├── TextareaCodeEditor
│ │ │ └── TextareaCodeEditor.tsx
│ │ ├── TextareaHeaders
│ │ │ └── TextareaHeaders.tsx
│ │ └── TrackPageView
│ │ │ └── TrackPageView.tsx
│ ├── index.css
│ ├── index.tsx
│ ├── modules
│ │ ├── about
│ │ │ ├── About.tsx
│ │ │ └── components
│ │ │ │ ├── ProfilePicture.css
│ │ │ │ ├── ProfilePicture.tsx
│ │ │ │ └── assets
│ │ │ │ └── profile.jpg
│ │ ├── designer
│ │ │ ├── Designer.tsx
│ │ │ ├── NewMockConfirmation.tsx
│ │ │ ├── assets
│ │ │ │ └── clem-onojeghuo-DoA2duXyzRM-unsplash.jpg
│ │ │ ├── components
│ │ │ │ ├── DesignerTitle.tsx
│ │ │ │ ├── NewMockFeatures.tsx
│ │ │ │ └── Pub.tsx
│ │ │ ├── form
│ │ │ │ ├── CleanConfirmationOnSubmit.tsx
│ │ │ │ ├── NewMockForm.tsx
│ │ │ │ ├── NewMockFormView.tsx
│ │ │ │ ├── models.ts
│ │ │ │ ├── styles.css
│ │ │ │ └── types.ts
│ │ │ └── styles.css
│ │ ├── faq
│ │ │ └── Faq.tsx
│ │ ├── home
│ │ │ ├── Home.tsx
│ │ │ └── components
│ │ │ │ ├── CallToActionDesignMock.tsx
│ │ │ │ ├── Features.tsx
│ │ │ │ ├── HeadTitle.tsx
│ │ │ │ ├── WhatIsMocky.tsx
│ │ │ │ └── assets
│ │ │ │ └── carbon.svg
│ │ ├── maintenance
│ │ │ ├── Maintenance.tsx
│ │ │ └── assets
│ │ │ │ └── inner-6.jpg
│ │ ├── manager
│ │ │ ├── Manager.tsx
│ │ │ ├── components
│ │ │ │ ├── DeleteMockInformation.tsx
│ │ │ │ ├── ManagerTitle.tsx
│ │ │ │ ├── MockGone.tsx
│ │ │ │ └── SearchingMockLoader.tsx
│ │ │ ├── delete
│ │ │ │ ├── DeleteSuccessful.tsx
│ │ │ │ └── DeletionApproval.tsx
│ │ │ ├── styles.css
│ │ │ ├── table
│ │ │ │ ├── EmptyPlaceholder.tsx
│ │ │ │ ├── ManagerTable.tsx
│ │ │ │ └── assets
│ │ │ │ │ └── sand-bg.jpg
│ │ │ └── types.ts
│ │ ├── policies
│ │ │ ├── CookiePolicy.tsx
│ │ │ └── styles.css
│ │ ├── routing
│ │ │ ├── Page404.tsx
│ │ │ ├── Page500.tsx
│ │ │ └── Routing.tsx
│ │ ├── skeleton
│ │ │ ├── Footer.tsx
│ │ │ ├── NavBar.tsx
│ │ │ └── assets
│ │ │ │ ├── logo-blue.png
│ │ │ │ ├── logo-dark.png
│ │ │ │ └── logo-light.png
│ │ └── sponso-abstract
│ │ │ ├── SponsoConfirmation.jsx
│ │ │ ├── SponsoFooter.jsx
│ │ │ ├── assets
│ │ │ └── chi-hang-leong-hehYcAGhbmY-unsplash.jpg
│ │ │ ├── models.ts
│ │ │ └── styles.css
│ ├── react-app-env.d.ts
│ ├── redux
│ │ ├── mocks
│ │ │ ├── slice.ts
│ │ │ └── types.ts
│ │ └── store.ts
│ ├── serviceWorker.ts
│ ├── services
│ │ ├── Analytics
│ │ │ └── GA.ts
│ │ ├── HTTP.ts
│ │ └── MockyAPI
│ │ │ ├── MockAPITransformer.ts
│ │ │ ├── MockyAPI.ts
│ │ │ └── types.ts
│ └── setupTests.ts
├── tsconfig.json
└── yarn.lock
└── server
├── .gitignore
├── .jvmopts
├── .scalafmt.conf
├── README.md
├── build.sbt
├── project
├── Dependencies.scala
├── build.properties
└── plugins.sbt
├── scripts
├── admin
│ ├── delete.sh
│ └── stats.sh
├── api
│ ├── create.sh
│ ├── delete.sh
│ ├── get.sh
│ ├── stats.sh
│ └── update.sh
└── play-v3.sh
├── src
├── it
│ ├── resources
│ │ └── logback.xml
│ └── scala
│ │ └── MockyServerSpec.scala
├── main
│ ├── resources
│ │ ├── application.conf
│ │ ├── db
│ │ │ └── migration
│ │ │ │ ├── V001__init_table_mocks_v2_v3.sql
│ │ │ │ ├── V002__fake_legacy_data.sql
│ │ │ │ └── V003__fake_v3_data.sql
│ │ └── logback.xml
│ └── scala
│ │ └── io
│ │ └── mocky
│ │ ├── HttpServer.scala
│ │ ├── Routing.scala
│ │ ├── ServerApp.scala
│ │ ├── config
│ │ └── Config.scala
│ │ ├── db
│ │ ├── Database.scala
│ │ └── DoobieLogHandler.scala
│ │ ├── http
│ │ ├── HttpMockResponse.scala
│ │ ├── JsonMarshalling.scala
│ │ └── middleware
│ │ │ ├── Authorization.scala
│ │ │ ├── IPThrottler.scala
│ │ │ ├── Jsonp.scala
│ │ │ └── Sleep.scala
│ │ ├── models
│ │ ├── Gate.scala
│ │ ├── admin
│ │ │ └── Stats.scala
│ │ ├── errors
│ │ │ └── MockNotFoundError.scala
│ │ └── mocks
│ │ │ ├── Mock.scala
│ │ │ ├── MockCreatedResponse.scala
│ │ │ ├── MockResponse.scala
│ │ │ ├── MockStats.scala
│ │ │ ├── actions
│ │ │ ├── CreateUpdateMock.scala
│ │ │ └── DeleteMock.scala
│ │ │ ├── enums
│ │ │ └── Expiration.scala
│ │ │ └── feedbacks
│ │ │ └── MockCreated.scala
│ │ ├── repositories
│ │ ├── MockV2Repository.scala
│ │ └── MockV3Repository.scala
│ │ ├── services
│ │ ├── DesignerService.scala
│ │ ├── MockAdminApiService.scala
│ │ ├── MockApiService.scala
│ │ ├── MockRunnerService.scala
│ │ └── StatusService.scala
│ │ └── utils
│ │ ├── DateUtil.scala
│ │ └── HttpUtil.scala
└── test
│ └── scala
│ └── io
│ └── mocky
│ ├── data
│ └── Fixtures.scala
│ ├── http
│ └── middleware
│ │ ├── IPThrottlerSpec.scala
│ │ └── JsonpSpec.scala
│ └── services
│ ├── MockAPIServiceSpec.scala
│ └── MockRunnerServiceSpec.scala
└── stack
├── docker-compose.yml
└── servers.json
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom: ["https://www.buymeacoffee.com/julienlafont"]
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Dependabot documentation
2 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3 |
4 | version: 2
5 | updates:
6 | # Maintain dependencies for GitHub Actions
7 | - package-ecosystem: "github-actions"
8 | directory: "/"
9 | schedule:
10 | interval: "daily"
11 |
12 | # Maintain dependencies for npm
13 | - package-ecosystem: "npm"
14 | directory: "/client"
15 | schedule:
16 | interval: "daily"
17 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Development CI
2 |
3 | on:
4 | push:
5 | branches: ['**', '!master']
6 | pull_request:
7 | branches: ['**', '!master']
8 |
9 | jobs:
10 | build-server:
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v2.3.4
15 | - name: Set up JDK 1.8
16 | uses: actions/setup-java@v1
17 | with:
18 | java-version: 1.8
19 | - name: Cache SBT ivy cache
20 | uses: actions/cache@v2
21 | with:
22 | path: ~/.ivy2/cache
23 | key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }}
24 | - name: Cache SBT
25 | uses: actions/cache@v2
26 | with:
27 | path: ~/.sbt
28 | key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
29 | - name: Run tests
30 | run: cd server; sbt test it:test
31 |
32 | build-frontend:
33 | runs-on: ubuntu-latest
34 |
35 | steps:
36 | - uses: actions/checkout@v2.3.4
37 | - name: Use Node.js
38 | uses: actions/setup-node@v2.1.2
39 | with:
40 | node-version: '14.x'
41 | - name: Install dependencies
42 | run: cd client; yarn --frozen-lockfile
43 | # Disabled step because... there is not JS tests...
44 | # - name: Run tests
45 | # run: cd client; yarn test
46 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release CI
2 |
3 | on:
4 | push:
5 | branches: [master]
6 | pull_request:
7 | branches: [master]
8 |
9 | jobs:
10 | release:
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v2.3.4
15 |
16 | - name: Fetch tags
17 | uses: fnkr/github-action-git-bash@v1.1
18 | with:
19 | args: git fetch --tags
20 | env:
21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 | - name: Extract last tag name
23 | id: previoustag
24 | uses: WyriHaximus/github-action-get-previous-tag@master
25 | env:
26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 |
28 | - name: API - Cache SBT ivy cache
29 | uses: actions/cache@v2
30 | with:
31 | path: ~/.ivy2/cache
32 | key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }}
33 | - name: API - Cache SBT
34 | uses: actions/cache@v2
35 | with:
36 | path: ~/.sbt
37 | key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
38 | - name: API - Set up JDK 1.8
39 | uses: actions/setup-java@v1
40 | with:
41 | java-version: 1.8
42 | - name: API - Run tests and generate release artifact
43 | run: cd server; sbt test it:test dist
44 | - name: API - Rename artifact
45 | uses: canastro/copy-file-action@master
46 | with:
47 | source: server/target/universal/mocky-2020*.zip
48 | target: mocky-api-release.zip
49 |
50 | - name: CLIENT - Use Node.js
51 | uses: actions/setup-node@v2.1.2
52 | with:
53 | node-version: '14.x'
54 | - name: CLIENT - Install dependencies
55 | run: cd client; yarn --frozen-lockfile
56 | # Disabled step because... there is not JS tests...
57 | # - name: CLIENT - Run tests
58 | # run: cd client; yarn test
59 | - name: CLIENT - Build production app
60 | run: cd client; yarn build
61 | - name: CLIENT - Zip build folder
62 | run: zip -r mocky-front-release.zip client/build
63 |
64 | - name: Create Githbub Release
65 | id: create_release
66 | uses: actions/create-release@v1.1.4
67 | env:
68 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 | with:
70 | tag_name: ${{ steps.previoustag.outputs.tag }}
71 | release_name: Release ${{ steps.previoustag.outputs.tag }}
72 | draft: false
73 | prerelease: false
74 | - name: Upload API release artifact in Github Release
75 | id: upload-api-release-asset
76 | uses: actions/upload-release-asset@v1
77 | env:
78 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79 | with:
80 | upload_url: ${{ steps.create_release.outputs.upload_url }}
81 | asset_path: mocky-api-release.zip
82 | asset_name: mocky-api-${{ steps.previoustag.outputs.tag }}.zip
83 | asset_content_type: application/zip
84 | - name: Upload CLIENT release artifact in Github Release
85 | id: upload-front-release-asset
86 | uses: actions/upload-release-asset@v1
87 | env:
88 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89 | with:
90 | upload_url: ${{ steps.create_release.outputs.upload_url }}
91 | asset_path: mocky-front-release.zip
92 | asset_name: mocky-front-${{ steps.previoustag.outputs.tag }}.zip
93 | asset_content_type: application/zip
94 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | server/.idea
3 | server/src/main/resources/application.clever-cloud.conf
4 |
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Mocky.io Lockdown Edition (2020)
2 |
3 | 
4 | 
5 | 
6 |
7 | ## What is mocky?
8 |
9 | Mocky is a simple app which allows to generate custom HTTP responses. It's helpful when you have to request a build-in-progress WS, when you want to mock the backend response in a single app, or when you want to test your WS client.
10 |
11 | Don't wait for the backend to be ready, generate custom API responses with Mocky and start working on your application straight away
12 |
13 | Mocky is a **free** and **unlimited** online service, accessible on **https://www.mocky.io**. Read the [FAQ](https://designer.mocky.io/faq) for more information about allowed usage.
14 |
15 | _Everything is done to provide the best service quality, but I don't guarantee the sustainability or the stability of the application._
16 |
17 | ## How to host my own Mocky instance
18 |
19 | Work in progress. Please come back in a few days!
20 |
21 | ## Architecture
22 |
23 | ### API
24 |
25 | Mocky API is written in Scala with the [HTTP4s](https://http4s.org/) server. Mocks are stored into PostgreSQL database with [Doobie](https://tpolecat.github.io/doobie/).
26 |
27 | See the [server/README.md](https://github.com/julien-lafont/Mocky/blob/master/server/README.md) for more information about how to build/run the API (WIP).
28 |
29 | ### Frontend
30 |
31 | React/Redux application written in typescript.
32 |
33 | See the [client/README.md](https://github.com/julien-lafont/Mocky/blob/master/client/README.md) for more information about how to build/run the frontend.
34 |
35 | ### Hosting
36 |
37 | Mocky is currently hosted on [Clever-Cloud](https://www.clever-cloud.com/en/).
38 |
39 | > Clever Cloud helps companies and IT professionals to achieve software delivery faster, reduce their feedback loop, focus on their core value and stop worrying about their hosting infrastructure by providing a solution for application sustainability.
40 |
41 | ## Contributors
42 |
43 | - [Julien lafont](https://twitter.com/julien_lafont)
44 |
45 | ## License
46 |
47 | Mocky is licensed under the [Apache License, Version 2.0](https://github.com/julien-lafont/Mocky/blob/master/LICENSE) (the “License”); you may not use this software except in compliance with the License.
48 |
49 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
50 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | | Version | Supported |
6 | | ------- | ------------------ |
7 | | > 3.0 | :white_check_mark: |
8 |
9 | ## Reporting a Vulnerability
10 |
11 | Please report all security issues to [@julien_lafont](https://www.twitter.com/julien_lafont).
12 |
--------------------------------------------------------------------------------
/assets/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/.DS_Store
--------------------------------------------------------------------------------
/assets/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/favicon.png
--------------------------------------------------------------------------------
/assets/favicon.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/favicon.psd
--------------------------------------------------------------------------------
/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/icon.png
--------------------------------------------------------------------------------
/assets/logo-blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/logo-blue.png
--------------------------------------------------------------------------------
/assets/logo-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/logo-dark.png
--------------------------------------------------------------------------------
/assets/logo-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/logo-light.png
--------------------------------------------------------------------------------
/assets/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/logo.psd
--------------------------------------------------------------------------------
/assets/mocky-social.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/assets/mocky-social.png
--------------------------------------------------------------------------------
/client/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["react-app"]
3 | }
4 |
5 |
--------------------------------------------------------------------------------
/client/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 2
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/client/.env:
--------------------------------------------------------------------------------
1 | REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID="UA-40626968-3"
2 | REACT_APP_DOMAIN="http://localhost:3000"
3 | REACT_APP_API_URL="http://localhost:8080"
4 | REACT_APP_MAINTENANCE=false
5 | REACT_APP_SHOW_PROMOTING_PANEL=true
6 | REACT_APP_SHOW_SPONSORING=true
--------------------------------------------------------------------------------
/client/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*
2 | public/*
3 | src/react-app-env.d.ts
4 | src/serviceWorker.ts
--------------------------------------------------------------------------------
/client/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/client/.prettierignore:
--------------------------------------------------------------------------------
1 | src/react-app-env.d.ts
--------------------------------------------------------------------------------
/client/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "tabWidth": 2,
4 | "singleQuote": true,
5 | "trailingComma": "es5",
6 | "semi": true
7 | }
8 |
--------------------------------------------------------------------------------
/client/.yarnclean:
--------------------------------------------------------------------------------
1 | # test directories
2 | __tests__
3 | test
4 | tests
5 | powered-test
6 |
7 | # asset directories
8 | docs
9 | doc
10 | website
11 | images
12 | assets
13 |
14 | # examples
15 | example
16 | examples
17 |
18 | # code coverage directories
19 | coverage
20 | .nyc_output
21 |
22 | # build scripts
23 | Makefile
24 | Gulpfile.js
25 | Gruntfile.js
26 |
27 | # configs
28 | appveyor.yml
29 | circle.yml
30 | codeship-services.yml
31 | codeship-steps.yml
32 | wercker.yml
33 | .tern-project
34 | .gitattributes
35 | .editorconfig
36 | .*ignore
37 | .eslintrc
38 | .jshintrc
39 | .flowconfig
40 | .documentup.json
41 | .yarn-metadata.json
42 | .travis.yml
43 |
44 | # misc
45 | *.md
46 |
--------------------------------------------------------------------------------
/client/README.md:
--------------------------------------------------------------------------------
1 | # Mocky Frontend
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app), using the [Redux](https://redux.js.org/) and [Redux Toolkit](https://redux-toolkit.js.org/) template.
4 |
5 | ## Environment variables
6 |
7 | You must define these environment variables. For local development, fill the `.env` file.
8 |
9 | ### Domain & API
10 |
11 | - `REACT_APP_DOMAIN="http://localhost:3000"`: What is the URL of this frontend
12 | - `REACT_APP_API_URL="https://api.mocky.site"`: What is the URL of the mocky API
13 |
14 | ### Maintenance mode
15 |
16 | - `REACT_APP_MAINTENANCE=false`: Set to true to activate the maintenance page
17 |
18 | ### Analytics tracking
19 |
20 | - `REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID="UA-XXXXXX-X"`: Fill this variable if you want to activate Google analytics tracking
21 |
22 | ### Customization
23 |
24 | - `REACT_APP_SHOW_PROMOTING_PANEL=true`: Display or not the promoting panel (give a shoot on twitter, buy me a beer)
25 |
26 | ## Available Scripts
27 |
28 | In the project directory, you can run:
29 |
30 | ### `yarn start:dev`
31 |
32 | Runs the app in the development mode.
33 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
34 |
35 | The page will reload if you make edits.
36 | You will also see any lint errors in the console.
37 |
38 | ### `yarn test`
39 |
40 | Launches the test runner in the interactive watch mode.
41 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
42 |
43 | ### `yarn build`
44 |
45 | Builds the app for production to the `build` folder.
46 | It correctly bundles React in production mode and optimizes the build for the best performance.
47 |
48 | The build is minified and the filenames include the hashes.
49 | Your app is ready to be deployed!
50 |
51 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
52 |
--------------------------------------------------------------------------------
/client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mocky",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@fortawesome/fontawesome-svg-core": "^1.2.28",
7 | "@fortawesome/free-brands-svg-icons": "^5.13.0",
8 | "@fortawesome/free-regular-svg-icons": "^5.15.1",
9 | "@fortawesome/free-solid-svg-icons": "^5.13.0",
10 | "@fortawesome/react-fontawesome": "^0.1.13",
11 | "@reduxjs/toolkit": "^1.3.5",
12 | "@testing-library/dom": "^7.22.0",
13 | "@testing-library/jest-dom": "^4.2.4",
14 | "@testing-library/react": "^9.3.2",
15 | "@testing-library/user-event": "^12.2.2",
16 | "@types/jest": "^26.0.9",
17 | "@types/moment": "^2.13.0",
18 | "@types/node": "^14.0.27",
19 | "@types/randomstring": "^1.1.6",
20 | "@types/react": "^17.0.0",
21 | "@types/react-copy-to-clipboard": "^4.3.0",
22 | "@types/react-dom": "^16.9.0",
23 | "@types/react-ga": "^2.3.0",
24 | "@types/react-loader-spinner": "^3.1.0",
25 | "@types/react-redux": "^7.1.7",
26 | "@types/react-router-dom": "^5.1.5",
27 | "@types/react-select": "^3.0.13",
28 | "@types/react-textarea-autosize": "^4.3.5",
29 | "@types/unique-random-array": "^2.0.1",
30 | "@types/word-wrap": "^1.2.1",
31 | "@types/yup": "^0.29.4",
32 | "connect-history-api-fallback": "^1.6.0",
33 | "express": "^4.17.1",
34 | "express-sslify": "^1.2.0",
35 | "formik": "^2.1.4",
36 | "moment": "^2.26.0",
37 | "prop-types": "^15.7.2",
38 | "randomstring": "^1.1.5",
39 | "react": "^16.13.1",
40 | "react-copy-to-clipboard": "^5.0.2",
41 | "react-dom": "^16.13.1",
42 | "react-ga": "^3.0.0",
43 | "react-loader-spinner": "^3.1.14",
44 | "react-moment": "^0.9.7",
45 | "react-redux": "^7.2.0",
46 | "react-router-dom": "^5.2.0",
47 | "react-scripts": "3.4.1",
48 | "react-select": "^3.1.0",
49 | "react-textarea-autosize": "^8.0.1",
50 | "react-typed": "^1.2.0",
51 | "react-use": "^15.3.4",
52 | "redux": "^4.0.5",
53 | "redux-localstorage-simple": "^2.2.0",
54 | "typescript": "~3.9.5",
55 | "unique-random-array": "^2.0.0",
56 | "word-wrap": "^1.2.3",
57 | "yup": "^0.29.1"
58 | },
59 | "scripts": {
60 | "start:dev": "react-scripts start",
61 | "start": "node server.js",
62 | "build": "react-scripts build",
63 | "test": "react-scripts test",
64 | "lint": "eslint --ext .js,.jsx,.ts,.tsx src --color",
65 | "format": "prettier --write \"src/**/*.{ts,tsx,css,json}\""
66 | },
67 | "eslintConfig": {
68 | "extends": [
69 | "react-app"
70 | ]
71 | },
72 | "browserslist": {
73 | "production": [
74 | ">0.2%",
75 | "not dead",
76 | "not op_mini all"
77 | ],
78 | "development": [
79 | "last 1 chrome version",
80 | "last 1 firefox version",
81 | "last 1 safari version"
82 | ]
83 | },
84 | "devDependencies": {
85 | "eslint": "6.8.0",
86 | "eslint-config-airbnb": "18.1.0",
87 | "eslint-plugin-import": "2.22.0",
88 | "eslint-plugin-jsx-a11y": "6.2.3",
89 | "eslint-plugin-react": "7.20.0",
90 | "eslint-plugin-react-hooks": "2.5.1",
91 | "prettier": "^2.0.5"
92 | },
93 | "engines": {
94 | "node": "^14"
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/client/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/client/public/assets/mocky-social-twitter-final.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/assets/mocky-social-twitter-final.png
--------------------------------------------------------------------------------
/client/public/css/iconsmind.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'iconsmind';
3 | src: url('../fonts/iconsmind.eot?#iefix-rdmvgc') format('embedded-opentype');
4 | src: url('../fonts/iconsmind.woff') format('woff'), url('../fonts/iconsmind.ttf') format('truetype');
5 | font-weight: normal;
6 | font-style: normal;
7 | }
8 |
9 | [class^='icon-'],
10 | [class*=' icon-'] {
11 | font-family: 'iconsmind';
12 | speak: none;
13 | font-style: normal;
14 | font-weight: normal;
15 | font-variant: normal;
16 | text-transform: none;
17 | line-height: 1;
18 | /* Better Font Rendering =========== */
19 | -webkit-font-smoothing: antialiased;
20 | -moz-osx-font-smoothing: grayscale;
21 | }
22 | .icon-Money-2:before {
23 | content: '\eac6';
24 | }
25 | .icon-Box-Full:before {
26 | content: '\e6e6';
27 | }
28 | .icon-Chemical:before {
29 | content: '\e74d';
30 | }
31 | .icon-Code-Window:before {
32 | content: '\e792';
33 | }
34 |
--------------------------------------------------------------------------------
/client/public/css/socicon.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Socicon';
3 | src: url('../fonts/socicon.eot?a93r5t');
4 | src: url('../fonts/socicon.eot?a93r5t#iefix') format('embedded-opentype'),
5 | url('../fonts/socicon.ttf?a93r5t') format('truetype'), url('../fonts/socicon.woff?a93r5t') format('woff'),
6 | url('../fonts/socicon.svg?a93r5t#Socicon') format('svg');
7 | font-weight: normal;
8 | font-style: normal;
9 | }
10 |
11 | [class^='socicon-'],
12 | [class*=' socicon-'] {
13 | /* use !important to prevent issues with browser extensions that change fonts */
14 | font-family: 'Socicon' !important;
15 | speak: none;
16 | font-style: normal;
17 | font-weight: normal;
18 | font-variant: normal;
19 | text-transform: none;
20 | line-height: 1;
21 |
22 | /* Better Font Rendering =========== */
23 | -webkit-font-smoothing: antialiased;
24 | -moz-osx-font-smoothing: grayscale;
25 | }
26 |
27 | .socicon-twitter:before {
28 | content: '\e08d';
29 | }
30 | .socicon-github:before {
31 | content: '\e032';
32 | }
33 | .socicon-linkedin:before {
34 | content: '\e04c';
35 | }
36 |
--------------------------------------------------------------------------------
/client/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/favicon-16x16.png
--------------------------------------------------------------------------------
/client/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/favicon-32x32.png
--------------------------------------------------------------------------------
/client/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/favicon.ico
--------------------------------------------------------------------------------
/client/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/favicon.png
--------------------------------------------------------------------------------
/client/public/fonts/iconsmind.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/fonts/iconsmind.eot
--------------------------------------------------------------------------------
/client/public/fonts/iconsmind.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/fonts/iconsmind.ttf
--------------------------------------------------------------------------------
/client/public/fonts/iconsmind.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/fonts/iconsmind.woff
--------------------------------------------------------------------------------
/client/public/fonts/socicon.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/fonts/socicon.eot
--------------------------------------------------------------------------------
/client/public/fonts/socicon.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/fonts/socicon.ttf
--------------------------------------------------------------------------------
/client/public/fonts/socicon.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MockyAbstract/Mocky/15d0e7f10c1f6dcf2539272b3f0bf42b746b4d6a/client/public/fonts/socicon.woff
--------------------------------------------------------------------------------
/client/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Mocky: The world's easiest & fastest tool to mock your APIs
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
38 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/client/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/client/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const history = require('connect-history-api-fallback');
3 | const enforce = require('express-sslify');
4 |
5 | const app = express();
6 |
7 | // allow to call history-mode route
8 | app.use(history());
9 |
10 | // Redirect http to https (with "trustProtoHeader" because the app will be behind a LB)
11 | app.use(enforce.HTTPS({ trustProtoHeader: true }));
12 |
13 | // Serve all the files in '/build' directory
14 | app.use(express.static('build'));
15 |
16 | app.listen(process.env.PORT, '0.0.0.0', () => {
17 | console.log(`Mocky is running on port ${process.env.PORT}`); // eslint-disable-line no-console
18 | });
19 |
--------------------------------------------------------------------------------
/client/src/components/CookieNotification/CookieNotification.tsx:
--------------------------------------------------------------------------------
1 | import './styles.css';
2 |
3 | import React from 'react';
4 | import { useCookie } from 'react-use';
5 |
6 | import { faTimes as iconClose } from '@fortawesome/free-solid-svg-icons';
7 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
8 | import { NavLink } from 'react-router-dom';
9 |
10 | export default () => {
11 | const [cookieDefined, setCookie] = useCookie('cookie-banner');
12 |
13 | return (
14 | <>
15 | {!cookieDefined && (
16 |
17 |
18 |
19 | By using our website you agree to our Cookie Policy
20 |
21 |
22 |
23 |
24 |
27 |
28 |
29 | )}
30 | >
31 | );
32 | };
33 |
--------------------------------------------------------------------------------
/client/src/components/CookieNotification/styles.css:
--------------------------------------------------------------------------------
1 | .cookie--block {
2 | z-index: 2147483635;
3 | position: fixed;
4 | max-width: 450px;
5 | left: 0;
6 | right: 0;
7 | bottom: 12px;
8 | margin: 0 auto;
9 | }
10 |
11 | .cookie--body {
12 | padding-top: 10px;
13 | padding-right: 45px;
14 | padding-bottom: 10px;
15 | padding-left: 30px;
16 | color: #ffffff;
17 | background-color: rgba(37, 37, 37, 1);
18 | box-shadow: 0 10px 24px 0 rgba(54, 61, 77, 0.5);
19 | border: 1px solid #aaa;
20 | }
21 |
22 | .cookie--description {
23 | line-height: 1.5;
24 | font-size: 14px;
25 | margin: 0 24px 0 0;
26 | font-weight: 400;
27 | }
28 |
29 | .cookie--description a {
30 | color: #fff;
31 | }
32 |
33 | .cookie--close {
34 | position: absolute;
35 | top: -9px;
36 | right: 0px;
37 | padding: 20px;
38 | }
39 |
40 | .cookie--close button {
41 | color: #666666;
42 | height: auto;
43 | border: 0;
44 | background-color: transparent;
45 | cursor: pointer;
46 | }
47 |
48 | .cookie--close svg:hover {
49 | color: #aaa;
50 | }
51 |
--------------------------------------------------------------------------------
/client/src/components/ErrorBoundary/ErrorBoundary.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component, ErrorInfo } from 'react';
2 | import Page500 from '../../modules/routing/Page500';
3 |
4 | type ErrorBoundaryState = {
5 | hasError: Boolean;
6 | };
7 |
8 | class ErrorBoundary extends Component<{}, ErrorBoundaryState> {
9 | private initialState: ErrorBoundaryState = {
10 | hasError: false,
11 | };
12 |
13 | public state: ErrorBoundaryState = this.initialState;
14 |
15 | public static getDerivedStateFromError(): ErrorBoundaryState {
16 | return { hasError: true };
17 | }
18 |
19 | public componentDidCatch(error: Error, info: ErrorInfo) {
20 | console.error('ErrorBoundary caught an error', error, info);
21 | }
22 |
23 | public render() {
24 | if (this.state.hasError) {
25 | return ;
26 | }
27 |
28 | return this.props.children;
29 | }
30 | }
31 |
32 | export default ErrorBoundary;
33 |
--------------------------------------------------------------------------------
/client/src/components/Loader/Loader.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { default as Loading } from 'react-loader-spinner';
3 |
4 | import 'react-loader-spinner/dist/loader/css/react-spinner-loader.css';
5 | import './styles.css';
6 |
7 | export default () => (
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/client/src/components/Loader/styles.css:
--------------------------------------------------------------------------------
1 | .loaderWrapper {
2 | position: absolute;
3 | top: 30px;
4 | left: 283px;
5 | }
6 |
--------------------------------------------------------------------------------
/client/src/components/ScrollToTopOnNavigationChange/ScrollToTopOnNavigationChange.tsx:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react';
2 | import { useLocation } from 'react-router-dom';
3 |
4 | export default () => {
5 | const { pathname } = useLocation();
6 |
7 | useEffect(() => {
8 | window.scrollTo(0, 0);
9 | }, [pathname]);
10 |
11 | return null;
12 | };
13 |
--------------------------------------------------------------------------------
/client/src/components/SelectCharset/SelectCharset.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Select from 'react-select';
3 | import { charsetOptions } from './models';
4 | import { FieldProps } from 'formik';
5 |
6 | const customStyles = {
7 | input: (provided: any, state: any) => {
8 | return { height: 'fit-content' };
9 | },
10 | };
11 |
12 | const SelectCharset = ({ field, form: { setFieldValue }, ...props }: FieldProps & { label: string }) => {
13 | return (
14 |