A minimalist flash card website designed for studying, built with the MERN stack.
You must have the following installed:
- Node.js
- npm
-
Create the following environment variables in your project's root:
DATABASEURL=/*Your mongo database's URL*/ ACCESS_KEY=/*any string you want (long, random string recommended)*/ REFRESH_KEY=/*any string you want (long, random string recommended)*/
Environment variables can be created either by making a
.env
file at the root directory or by adding it to your deployment settings if deploying it to a cloud platform, like Heroku.If you don't have a mongo database, you can make one on locally or on MongoDB Atlas.
-
Install all necessary dependencies with
npm install
.Note: You must run
npm install
in both your root directory and client directory. -
Build your front-end client by running
npm run build
in your client directory. -
Start your server with either
node server.js
ornpm start
.
Optional - Enable Google OAuth 2.0 by adding the following environment variables, in addition to the variables above:
GOOGLE_CLIENTID=/*Your oauth client id*/
REACT_APP_GOOGLE_CLIENTID=/*Your oauth client id*/
In order to obtain an oauth client id, you can follow these instructions, specifically in the Prerequisites section.
To run this site in a development environment, you must follow these steps, in addition to the ones listed above:
-
Create the following environment variables in your client directory:
REACT_APP_BACKEND_URL=/*Your server's URL*/ REACT_APP_GOOGLE_CLIENTID=/*Your oauth client id*/
-
Run
npm start
in your client directory whenever you start your site.