-
Install Node.js (npm is packaged with Node).
-
[Optional] Install GitHub tools:
You can use the terminal if you are comfortable with it.
- GitHub CLI (optional)
- GitHub Desktop (optional)
- Fork this repository. Funko Showcase Workshop Repository
- Clone your new repository to your local machine using the web URL or use GitHub Desktop.
- In the root folder of your project, find a file named
.envsample
. - Rename this file to
.env
. - Open this file, and copy & paste this text into the file, and add your specific details.
MONGODB_URI= DATABASE_NAME= COLLECTION_NAME=
- MONGODB_URI should be your full connection string that we created in step 2.2, including your password. Add this after the "=".
- DATABASE_NAME should be the name of your database. We recommended using
funko-database
. Add this after the "=". - COLLECTION_NAME should be the name of your collection. We recommended using
funko-collection
. Add this after the "=". - Save your file.
- In a terminal, open your new code folder.
- Change your working directory to
/start
cd start
- Run the following command to install project dependencies:
npm install
-
Build the application by running the following command in the same
/start
directory.npm run build
-
Run the application:
npm run start
-
Open your browser and navigate to
http://localhost:3000
or whatever the open port is to see what the site looks like.NOTE: Notice that the application currently only shows the images for each item in our collection. After we deploy our app, we will do more work on the UI of our application to show the rest of the metadata.
-
When you're done viewing the app, make sure to hit Ctrl+C in your terminal to end the process.
NOTE: We're going to make a small custom change to our app here, but we will be making future modifications after the app is successfully deployed.
- In your
/start
directory, open the file/components/Header/Header.tsx
. - You will see a code block that defines our page's header.
<Box sx={{ flexGrow: 1 }}> <BackgroundAppBar position="static" sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <Toolbar variant="dense"> <Typography variant="h1" component="div" sx={{ flexGrow: 1, color: 'white', fontFamily: 'Henny Penny' }}> Funko Showcase </Typography> </Toolbar> </BackgroundAppBar> </Box>
- Change the
Funko Showcase
text to something custom to you, likeJeff's Funko Collection
. - Save the file.
- Build and run your application again to see the changes in your browser.
npm run build npm run start
- Refresh your browser to see your changes.
- Now would also be a fun time to add another element to your database. You can click the
Add Funko
button to add another entry to your database.
- Push your updated code up to GitHub (you can also do this in GitHub Desktop):
git add . git commit -m "Initial commit" git push origin main