express-react-starter

July 29, 2021 ยท View on GitHub

A full stack express/react starting point. Implements express, react, mysql, phpMyAdmin, mocha and supertest. A basic integration test for the server and the database is also included.

Run/develop your starter project on Gitpod

Gitpod allows you to develop in the cloud. To use the Gitpod platform you will need to login to Github using your Github credentials.

Run/develop your project locally

You will need a proper installation of Node and MySQL before you get started. phpMyAdmin will not be installed.

  1. Create a new repository on Github.
  2. Use this handy bash function to copy this repository in your new repository.
  3. Clone your new repository, something like this: git clone https://github.com/myusername/mynewrepo.git
  4. Move into your new repository: cd mynewrepo
  5. Install dependencies for the server: cd server && yarn install; cd ..
    • You may run the server on its own by running the following command from the ./server directory: yarn run start_dev
  6. Install dependencies for the client and build the client: cd client && yarn install; yarn run build; cd ..
    • You may run the client on its own running the following from the ./client directory: yarn run start

Run integration tests locally

  1. Start MySql and wait until it is ready. A script has been provided for easy starting and stopping of mysql.
  2. Ensure you have a database to connect to for the test.
  3. Create an .env file with valid credentials (including the proper database name) in ./server using .env.template as your guide.
  4. Run tests: cd server && yarn run test