diff --git a/README.md b/README.md index 881d2ca..5ba10a0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,10 @@ Sol Journal is a simple, minimal, journaling platform that works offline and across all devices. It can be self-hosted through Firebase and then installed as a PWA, on mobile devices for easy access on a phone, or on Desktops.

- preview of page + preview of page

## Introduction @@ -31,13 +34,25 @@ Sol Journal uses firebase to support offline functionality and authentication, m In the spirit of minimalism, key features are what are in place for a quick, lightweight journaling experience that can work across devices, including: - 🔥 Authentication: Cloud firestore persists registered users to a users document and saved journal entries to an entries document -- 🎨 Dark Theme: the `src/styles/theme.js` file contains a set of colors and default styles that are applied to components with Emotion. A default light and dark theme are already in the file +- 🎨 Theming: the `src/styles/theme.js` file contains a set of colors and default styles that are applied to components with Emotion. A default light and dark theme are already in the file - 🔍 Search: full-text search of a user's entries stored in Firestore for quick access to past entries - 🖥 Mobile Friendly: designed to look great on mobile as well as desktop, with easy navigation on both - 💡 PWA: being a progressive web app makes it installable from Chrome/Safari on desktop, or be added to the homescreen on iOS/Android - 🔌 Offline Support: read/write when you're offline and let the updates happen when your connection is restored - 🗄 Export: backup all of your entries at any time to save your data +## Project setup + +Files are organized into these folders: + +`/components`: user interface pieces to construct the design and layout of the site +`/data`: local data transformed by gatsby to become queryable by Gatsby's GraphQL data layer +`/img`: images used by places like landing pages that are optimized by gatsby-image and then queryable in the GraphQL layer +`/pages`: public pages that can be seen by unauthenticated users and are completely server side rendered by Gatsby during `gatsby build` +`/routes`: private, client only routes only visible to authenticated users that are used by the app section of the journal +`/styles`: role based design tokens and theme definitions +`/util`: simple utility functions, for things like formatting dates + ## Developing Clone the project: @@ -74,10 +89,10 @@ GATSBY_CONFIRMATION_EMAIL_REDIRECT=https://.firebaseapp.com Navigate into the project directory, and then launch the site with this command: ```bash -yarn develop +gatsby develop ``` -The site will be opened up in your default browser on http://localhost:3000 +The site will be opened up in your default browser on http://localhost:8000 Edit code in the `/src`, save your changes, and they'll reload instantly in the browser. @@ -86,10 +101,12 @@ Edit code in the `/src`, save your changes, and they'll reload instantly in the To create an optimized build of the site run this command: ```bash -yarn build +gatsby build ``` -A `/build` folder will be assembled that can be deployed with this command: +A `/build` folder will be assembled that can be deployed to any static file hosting service like Netlify or surge. + +It can be deployed to firebase with this command: ```bash firebase deploy diff --git a/SETUP.md b/SETUP.md index 4a4bfcd..1845cfd 100644 --- a/SETUP.md +++ b/SETUP.md @@ -2,7 +2,6 @@ Setting up Sol Journal requires a free Firebase account since many of the features rely on built in Firebase capabilities to allow functionality offline. The free plan gives you 50,000 reads and 20,000 writes per day, meaning you can easily run a personal version for yourself. - ## Setting up Firebase You will need a Google account to create a Firebase project, then navigate to the Firebase Console: https://console.firebase.google.com/ @@ -71,7 +70,7 @@ In order to prevent would be hackers or nefarious folks from messing with data i ##### Configuration -## Code Setup +## Setting up Code Having node installed is a prerequistie, you can follow instructions to get it setup yourself. @@ -88,3 +87,30 @@ firebase login ``` Follow the prompted instructions to connect your account. + +Clone the repository: + +```bash +git clone https://github.com/gillkyle/sol-journal +``` + +Then change the name of the `.env.sample` file to `.env` (or `.env.production`/`.env.development` if you would like to run the app in different environments) and fill it in, mapping your own keys from your Firebase project to the corresponding names in the file. + +```env +GATSBY_FIREBASE_API_KEY= +GATSBY_DEV_AUTH_DOMAIN=.firebaseapp.com +GATSBY_DEV_DATABASE_URL=https://.firebaseio.com +GATSBY_DEV_PROJECT_ID= +GATSBY_DEV_STORAGE_BUCKET=.appspot.com +GATSBY_DEV_MESSAGING_SENDER_ID=############ + +GATSBY_CONFIRMATION_EMAIL_REDIRECT=https://.firebaseapp.com +``` + +Then run the build command to generate an optimized build in the public directory. + +```bash +gatsby build +``` + +You can upload your `/public` folder to S3, or run the surge command inside the directory to deploy it to a free subdomain. diff --git a/gatsby-config.js b/gatsby-config.js index c2a94fd..820c88a 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,9 +1,7 @@ module.exports = { plugins: [ `gatsby-plugin-react-helmet`, - { - resolve: `gatsby-plugin-emotion`, - }, + `gatsby-plugin-emotion`, // create routes for client side routing { resolve: `gatsby-plugin-create-client-paths`, @@ -53,7 +51,8 @@ module.exports = { path: `./src/data/`, }, }, - // easier imports and exports + // easier imports and exports by defining aliases + // for commonly used folders { resolve: "gatsby-plugin-module-resolver", options: { diff --git a/src/components/Layout.js b/src/components/Layout.js index 801391f..48105ad 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -8,6 +8,7 @@ import { withTheme } from "emotion-theming" const Layout = ({ children, theme }) => ( <> + {/* some styles should applied globally via the layout */} ( ) +// on langing page and simple pages outside the app, simplify link options const SimpleNav = ({ authUser, theme }) => (