- TypeScript 86%
- SCSS 12%
- HTML 1.2%
- JavaScript 0.8%
|
|
||
|---|---|---|
| .docker/init | ||
| .idea | ||
| public | ||
| resources | ||
| server | ||
| src | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.example | ||
| .gitignore | ||
| analyze.js | ||
| docker-compose.yml | ||
| Dockerfile.api | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| yarn.lock | ||
Reactive Gallery
This is a React image gallery web app. It uses a NodeJS/Express backend, which can be found in the server directory.
The gallery also includes support for a checkout using Stripe.
It is used live at Roger Stanger Photography, home to my dad's excellent photos, which you should definitely check out.
The project was built for this deployment so there isn't a huge amount of customisation ability out of the box. If any developers after a responsive photo gallery however, this will hopefully serve as a good starting point.
Setup
-
Run
yarnto install dependencies -
Copy
.env.exampleto.envand fill in the environment variables. -
Edit the client settings in
src/config.json. -
Edit the page content in
src/pageContentcontact/TextDescription.tsxrelies on a photo, which is not included in here. Either put aphoto.jpgin the same folder or remove the image from the component.
-
Run
yarn buildto build the server and client -
Copy the contents of
buildto a web server root -
Run
yarn start:serverto start the server.- This is the same as
node build_server. Use this to set up a service for the web server.
- This is the same as
NOTE: The requests from the client are structured in such a way they expect the server and client to share the same host address. This gives you three options for deployment:
- Configure your web server to proxy any requests on
/apito the Node server. - Adjust
src/services/ImageService.tsandsrc/services/UserServiceto fetch from a different origin. - Use the Webpack dev server to automatically proxy traffic with
yarn start:client(not recommended, but good for testing).- You can use
yarn startto start the server and client concurrently.
- You can use