- clone repo
git clone git@github.com:Dj-Viking/typescript-reddit-clone.git
- install dependencies
cd server; npm install; cd ..; cd client; npm install
- Must have installed redis for the user auth session cookies
- if user has mac or linux can use homebrew to install redis
https://phoenixnap.com/kb/install-redis-on-mac
- Must have postgresql installed for database access from the node application
- use this command to sign into postgres after install to begin setting up the database for the application
sudo -u postgres psql template1
- once signed in use this command to set a password for the postgres user to access the db
ALTER USER postgres PASSWORD '<new password>';
and use that password for the DB_PASSWORD - must create a database name to input for the next step which requires logging into the postgresql shell and manually creating the database
CREATE DATABASE <name>;
semicolon is important for the database query!! - and then set a new password for the postgres user
- run this command to create the env file for the following server environment variables
cd server; touch .env
- must set ENV variables for
- DB_NAME,
- DB_PASSWORD,
- DB_USER,
- SECRET,
- NODEMAILER_AUTH_EMAIL, (can use the generated email in the console output after the node.js server runs just once it will print to the console as one of the last things to output which can be used for testing once nodemailer is able to execute)
- NODEMAILER_AUTH_PASS (same as above)
- NODEMAILER_EMAIL_TO - define some valid email for testing purposes. the email actually doesn't get sent out to this address, it just spits a link into the server node console with the link to go reset an account's password. its not using an actual email client
- once everything is installed and configured
- have a few terminal windows open and run each command in a separate window to fully run the fullstack app
- start a local redis server for session cookies
redis-server
- start the typescript compiler
cd server; npm run watch;
- start the nodemon server that runs the compiled typscript out of the /dist folder and connects to the postgresql database on the local db configurations set in the .env file
cd server; npm run dev
- start the client
cd client; npm run dev