~> My backend code.
Visit my live website here: https://cars-club.netlify.app
- Click the
Login as a test user
button -
- E-mail: [email protected]
- Password: test
Combining my passion for cars, I created this fullstack project with the primary goal of honing my TypeScript skills. I had focused on setting up a reusable and scalable codebase, laying a solid foundation for seamless integration of additional features. With everything working smoothly, my app is now at a stage where I can continually implement my new ideas into future updates.
- Users can create a Post with an image, then submit this
multipart/form-data
request with all the input values appended to aFormData
. - I'm converting the backend's image value - a binary data - into a
src
value using a function that first converts it toUint8Array
instance, then I'm grabbing thebuffer
property value & passing it as an argument to theBlob
's constructor (but passing the whole instance works as well). Finally withURL.createObjectURL
I'm creating a URL from this Blob that is used as thesrc
value.
- I'm using Multer middleware to process the
FormData
received from amultipart/form-data
request with the storage optionmemoryStorage()
, then usingupload.single
instance middleware to populatereq.file
with metadata about the image. My controller only stores the binary data from thebuffer
property into my PostgreSQL as aBYTEA
column type. - My
refresh_tokens
andposts
tables both have a MANY-TO-ONE relationship with myusers
table.
TypeScript + ReactJS with Redux Toolkit + NodeJS with ExpressJS and MulterJS + PostgreSQL Database. Vite for faster workflow experience.
NOTE: I'm still working on this fullstack project - it's not yet finished & my main goal is to improve my TypeScript skills.
- Login & Register sections.
- Section for cars info & specifications: Catalog.
- Section for posting cars for sales (allowed by all users): Marketplace.
- Posts will be connected to the OP user (original poster) & they can update or delete their post.
- Users not related to a particular post will be able to comment; they will be related to their own comment & be able to update and delete their own comment.
- Clone this project.
- Navigate (
cd
) into your project directory. - Run
npm install
in your command line. - Run
npm run dev
in your command line. - Visit http://localhost:5173 in your browser.
- Vite version 4 has changed the PORT from 3000 to 5173.
- For the full functionality connect it with my backend project.
- If you want to deploy this app on Netlify you should copy the code included in my netlify.toml file.
- For most of my SVG icons I've used a PNG version of icons8 and then converted that PNG into SVG using sites like https://www.pngtosvg.com.