This repository contains the frontend code for PressPass by News Catalyst. It uses Squarelet as its backend.
Inside src/
, each 'logical component' of the app (like account/
, auth/
, etc.) has its own folder. React TypeScript files that are in title case (e.g. EntitlementsList.tsx
) are components whose default export is that component. If the filename is not in title case, it is not a component.
When developing the app, you will need to run this frontend app in tandem with Squarelet. Ensuring that cookies and data is properly shared can be challenging—if you follow this guide, however, you should run into minimal issues.
- Install Squarelet according to its installation instructions.
- On *nix systems, edit your
/etc/hosts
file to pointdev.presspass.com
to127.0.0.1
(the loopback address). - Ensure that your Squarelet environment has its url set to
dev.presspass.com
in its environment settings. (Refer to the Squarelet documentation for more information.) - Run Squarelet using
COMPOSE_FILE=local.yml inv runserver
from within the Squarelet directory. (Alternatively, you can set the environment variableCOMPOSE_FILE
to be set tolocal.yml
in your bash profile and omit it from the command.) - Launch the frontend using
npm start
from within this directory. - Visit the frontend at
http://dev.presspass.com:3000
, preferably in incognito mode. (Developing in incognito mode can help avoid issues in which existing Squarelet cookies allowGET
requests but block CSRF-requiredPOST
s.)
To get the latest version of the ArchieML doc, you need to edit your .env
file to include the following variables:
GAPI_CLIENT_EMAIL="<client email here>"
GAPI_PRIVATE_KEY="<private key here"
GDOC_ID="<id of google doc here>"
With these variables, you can run npm run archie
to get the latest version of the doc. This writes a JSON file to src/archie.json
.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
- File upload for logo
- Add Bulma/form library/field abstractions
- Add notification system for when Squarelet isn't available/network requests fail
- Account registration
- Password management
- Password reset