Skip to content

The-Marcy-Lab-School/react-express-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

102 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Name

Project Mission Statement

Team

  • teamMember: Scrum Master, Developer
  • teamMember: Developer
  • teamMember: Developer

Table of Contents

Getting Started

Before you can actually start building, you need to create a database and configure your server's environment variables to connect with it.

  • Create a database with a name of your choice.
  • In the server/ folder, copy the .env.template and name it .env.
  • Update the .env variables to match your Postgres database information (username, password, database name)
  • Replace the SESSION_SECRET value with your own random string. This is used to encrypt the cookie's userId value.
  • Your .env file should look something like this:
# Replace these variables with your Postgres server information
# These values are used by the pg pool to connect to your postgres server
PG_HOST='127.0.0.1'
PG_PORT=5432
PG_USER='itsamemario'
PG_PASS='12345'
PG_DB='my_react_express_auth_database'

# Replace session secret with your own random string!
# This is used by handleCookieSessions to hash your cookie data 
SESSION_SECRET='db8c3cffebb2159b46ee38ded600f437ee080f8605510ee360758f6976866e00d603d9b3399341b0cd37dfb8e599fff3'

# When you deploy your database on render, this string can be used to test SQL queries to the deployed database.
# Leave this value blank until you deploy your database.
PG_CONNECTION_STRING=''

Build and Start Commands

From within the root directory, run the following commands to install dependencies and run the project locally:

# Build Command — install dependencies, build the static assets, and initialize the database schema
cd frontend && npm i && npm run build && cd ../server && npm i && npm run db:init && cd ..

# Start Command
cd server && npm start

Project Structure

  • frontend/: React app.
  • server/index.js: Express server entrypoint and route wiring.
  • server/controllers/: Request handlers for auth and users.
  • server/models/: Database-facing model classes.
  • server/db/pool.js: Shared pg connection pool.
  • server/db/init.js: One-time schema initialization script (npm run db:init).

Technologies Used

  • Node
  • Express
  • Postgresql
  • React
  • pg (node-postgres)
  • etc...

Project Proposal

See PROPOSAL.md for more details on the project proposal.

Roadmap

View the project roadmap here.

Contributing

See CONTRIBUTING.md for contribution guidelines.

Style Guide

This project adheres to the Airbnb Style Guide.

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors