Welcome to the Full Stack Contact Form Frontend repository! This project serves as the frontend component of a comprehensive full-stack contact form, designed to enhance user engagement and communication on your web application. The frontend is built using React and incorporates various elements to create an intuitive and visually appealing user interface.
This project is part of a tutorial series available on dev.to that guides you through building a complete full-stack contact form. The series covers the following key steps:
- Part 1 - Building a Full Stack Contact Form: React Frontend
- Part 2 - Building a Full Stack Contact Form: Node.js Backend
- Part 3 - Building a Full Stack Contact Form: Deployment
To see the complete backend code and setup, visit the backend repository on GitHub.
Feel free to explore the code, learn from it, and adapt it to your own projects. If you have any questions or feedback, don't hesitate to get in touch.
Happy coding! 🚀
The default template project for nano-react-app.
npm start
— This will spawn a development server with a default port of5173
.npm run build
— This will output a production build in thedist
directory.npm run preview
— This will run the production build locally with a default port of5173
(this will not work if you haven't generated the production build yet).
You can use the -p
flag to specify a port for development. To do this, you can either run npm start
with an additional flag:
npm start -- --port 3000
Or edit the start
script directly:
vite --port 3000
You can use CSS files with simple ES2015 import
statements anywhere in your Javascript:
import "./index.css";
The Babel preset babel-preset-nano-react-app is used to support the same transforms that Create React App supports.
The Babel configuration lives inside package.json
and will override an external .babelrc
file, so if you want to use .babelrc
remember to delete the babel
property inside package.json
.
You can also deploy your project using GitHub pages.
First install the gh-pages
package:
npm i -D gh-pages
Use the following scripts for deployment:
"scripts": {
"start": "vite",
"build": "vite build",
"predeploy": "rm -rf dist && vite build",
"deploy": "gh-pages -d dist"
},
Then follow the normal procedure in GitHub Pages and select the gh-pages
branch.