Back end code for Reddit-clone
Link to FrontEnd Code: https://github.com/minhquan0902/Reddit-clone-client.git
Official Website: https://quanredditcloneee.xyz/
Hosting provided by Digital Ocean and Dokku
The project was inspired by Ben Awad: https://www.youtube.com/watch?v=I6ypD7qv3Z8&t=44740s but I decided to stick with MikroOrm and calling new fork() for orm.em for handling request context
- Postgres
- type-graphql
- MikroOrm as the main ORM tech
- ApolloServer
- Redis for storing cookies and user cache
- argon2 for password hash
- Express server and express session
- Docker for devops and deploying processes
-
Install PostgreSQL
- Use "postgres" as the password for user "postgres"
- Setup the PATH variable in your operating system if the shell couldn't find "psql" or "createdb"
-
Install Redis
-
Open Terminal or Git Bash to create local db
createdb -U postgres reddit2
-
Clone this repo at
git clone https://github.com/minhquan0902/Reddit-clone-server.git
-
Build the Project
a. Install Node.js. It is recommended that you use
node v14.3.0
or newer.b. Install Yarn.
c. Install all dependencies and package by typing this to the terminal at root folder
$ yarn install
-
To start the server up and running
a) Open the first terminal for redis
$ redis-server
b) Open the second terminal to watch for changes watch
$ yarn watch
c) Start the server up and running
$ yarn dev