Skip to content

zfauser/SignedIn-Public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SignedIn: A login website using React and Pocketbase

Features

  • Sign in
    • Sign in with GitHub
  • Sign up
    • Sign up with GitHub
  • Reset password
  • Verify email
    • Gold Checkmark System. (This is a feature that allows the admin to give special users a gold checkmark next to their name via the database admin panel.)

What is this?

SignedIn is an example of how to use React and Pocketbas to build a login website. It is a website that allows users to sign in, sign up, reset their password, and verify their email. It also has a feature that allows the admin to give special users a gold checkmark next to their name via the database admin panel. It also uses GitHub OAuth to allow users to sign in and sign up with their GitHub account.

How to run locally and/or deploy to a remote server

  1. Clone the repo
git clone https://github.com/Zfauser/SignedIn-Public.git
  1. Install dependencies
npm install
  1. Run the app  

    3.1. Development mode

    In one terminal window, run:

    npm start

    In another terminal window, run:

    ./pocketbase serve

    The pocketbase executable included is the MacOS version. If you are using a different OS, you can download the executable from here

    NOTE: You will also need to change all of the database urls and redirect urls in the files to your own. By default, the pocketbase server url will be http://127.0.0.1:8090 and the web site will be run on http://127.0.0.1:3000. You will also need to add your own GitHub OAuth info on the Admin panel.

      3.2. Production mode

    npm run build

    Then deploy the build folder to any type of web server. (apache, nginx, etc.)

    Then deploy pocketbase to another server. (You might be able to run it on the same server as the web server through something like a reverse proxy, but I haven't tested it.)

    Then run the following command to start pocketbase via http & https. (you should setup something to make it so this command runs at startup using something like systemd)

    ./pocketbase serve --http="example.com:80" --https="example.com:443"

    Pocketbase is supposed to automatically get a SSL certificate from Let's Encrypt, but it didn't work for me, so I had to manually get another certificate from Certbot and then put it in the pb_data folder on the server.  

How I deployed it

I deployed the static files to an existing apache server I use to run all my other websites. I also needed to get a new SSL certificate for the domain I was using (signedin.zachfauser.com). I used Certbot to get the certificate. I then needed to create a new Oracle Cloud Virtual Machine to run database. I used the same specs as the apache server (2 core arm cpu, 12gb ram, ubuntu). I then installed pocketbase on the new server. I also got a new SSL certificate for the pocketbase server on the domain I was using. I then created a simple Systemd service to make the pocketbase server start on startup and run in the background.

Links to the technologies used