Code Monkey home page Code Monkey logo

adonisjs-create-react-app's Introduction

adonisjs-create-react-app

Boilerplate/Starter Project for building APIs using Adonisjs, with a React frontend using Create React App.

Setup

Install AdonisJs CLI globally :

npm i -g @adonisjs/cli

Then create the project :

adonis new <name> --blueprint=jsnomad/adonisjs-create-react-app

Alternatively you can clone the project and install dependencies manually :

git clone https://github.com/jsnomad/adonisjs-create-react-app.git
npm install

Install React dependencies :

cd front
npm install

Start

Run the following command to start the HTTP server :

adonis serve --dev

Runs the React app in development mode :

cd front
npm start

Then you can access to the React App using :

http://localhost:3000/

Make API request

fetch('/api/v1/***')

In development, the React development server will recognize that it’s not a static asset, and will proxy your request to http://localhost:3333/api/v1/*** as a fallback.

Production

Create a React production build :

cd front
npm run build

The build folder will be automatically moved in the Adonisjs public folder.

Then start the HTTP server using a process manager like pm2 (recommended) :

pm2 start server.js

For better performance, consider using nginx as a reverse proxy (faster to server static assets).

adonisjs-create-react-app's People

Contributors

dependabot[bot] avatar jsnomad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.