Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.59 KB

README.md

File metadata and controls

66 lines (45 loc) · 1.59 KB

Express & React Template

Starter Template utilizing a React frontend and Express server. The Express server leverages a MySQL database for persistent storage, and JWTs in concert with Passport.js for authentication.

Dependencies

Installation

After cloning the repository:

Create a .env file and add the following with your own secret keys

PASSPORT_SECRET_KEY=<Generate Secret Key>
JWT_SECRET=<Generate Secret Key>

(make sure to add .env to gitignore if you're going to commit the project to source control)

Install dependencies

cd client
npm install

Then do the same in the server directory

cd server
npm install

Database Setup

This project uses MySQL as its database. You will need to have a MySQL server installed and running on your machine.

The project assumes you're running a database named notes_app on 127.0.01, or you can create a new MySQL database and update the server/db.js file with your database information.

One the database is setup, from the server directory run:

npx sequelize-cli db:migrate

Usage

Running the Server

To start the server, run the following command in your terminal:

cd server
npm start

Running the React App

To run the React app, navigate to the client directory and run the following command in your terminal:

cd client
npm start